VirtualBox

Changeset 11944

Show
Ignore:
Timestamp:
09/01/08 19:33:18 (3 months ago)
Author:
vboxsync
Message:

Updates for state saving

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/VBox/ssm.h

    r11808 r11944  
    459459SSMR3DECL(int) SSMR3PutGCPtr(PSSMHANDLE pSSM, RTGCPTR GCPtr); 
    460460SSMR3DECL(int) SSMR3PutGCUIntPtr(PSSMHANDLE pSSM, RTGCUINTPTR GCPtr); 
     461SSMR3DECL(int) SSMR3PutRCPtr(PSSMHANDLE pSSM, RTRCPTR RCPtr); 
    461462SSMR3DECL(int) SSMR3PutHCUInt(PSSMHANDLE pSSM, RTHCUINT u); 
    462463SSMR3DECL(int) SSMR3PutHCSInt(PSSMHANDLE pSSM, RTHCINT i); 
     
    493494SSMR3DECL(int) SSMR3GetGCPtr(PSSMHANDLE pSSM, PRTGCPTR pGCPtr); 
    494495SSMR3DECL(int) SSMR3GetGCUIntPtr(PSSMHANDLE pSSM, PRTGCUINTPTR pGCPtr); 
     496SSMR3DECL(int) SSMR3GetRCPtr(PSSMHANDLE pSSM, PRTRCPTR pRCPtr); 
    495497SSMR3DECL(int) SSMR3GetIOPort(PSSMHANDLE pSSM, PRTIOPORT pIOPort); 
    496498SSMR3DECL(int) SSMR3GetHCUInt(PSSMHANDLE pSSM, PRTHCUINT pu); 
  • trunk/src/VBox/VMM/SSM.cpp

    r11808 r11944  
    23152315 
    23162316/** 
     2317 * Saves an RC virtual address item to the current data unit. 
     2318 * 
     2319 * @returns VBox status. 
     2320 * @param   pSSM            SSM operation handle. 
     2321 * @param   RCPtr           The item to save. 
     2322 */ 
     2323SSMR3DECL(int) SSMR3PutRCPtr(PSSMHANDLE pSSM, RTRCPTR RCPtr) 
     2324{ 
     2325    if (pSSM->enmOp == SSMSTATE_SAVE_EXEC) 
     2326        return ssmr3Write(pSSM, &RCPtr, sizeof(RCPtr)); 
     2327    AssertMsgFailed(("Invalid state %d\n", pSSM->enmOp)); 
     2328    return VERR_SSM_INVALID_STATE; 
     2329} 
     2330 
     2331 
     2332/** 
    23172333 * Saves a GC virtual address (represented as an unsigned integer) item to the current data unit. 
    23182334 * 
     
    28992915{ 
    29002916    Assert(cbGCPtr == sizeof(RTGCPTR32) || cbGCPtr == sizeof(RTGCPTR64)); 
     2917    Log(("SSMR3SetGCPtrSize %d bytes\n", cbGCPtr)); 
    29012918    pSSM->cbGCPtr = cbGCPtr; 
    29022919    return VINF_SUCCESS; 
     
    29302947} 
    29312948 
     2949/** 
     2950 * Loads an RC virtual address item from the current data unit. 
     2951 * 
     2952 * @returns VBox status. 
     2953 * @param   pSSM            SSM operation handle. 
     2954 * @param   pRCPtr          Where to store the RC virtual address. 
     2955 */ 
     2956SSMR3DECL(int) SSMR3GetRCPtr(PSSMHANDLE pSSM, PRTRCPTR pRCPtr) 
     2957{ 
     2958    if (pSSM->enmOp == SSMSTATE_LOAD_EXEC || pSSM->enmOp == SSMSTATE_OPEN_READ) 
     2959        return ssmr3Read(pSSM, pRCPtr, sizeof(*pRCPtr)); 
     2960 
     2961    AssertMsgFailed(("Invalid state %d\n", pSSM->enmOp)); 
     2962    return VERR_SSM_INVALID_STATE; 
     2963} 
    29322964 
    29332965/** 
  • trunk/src/VBox/VMM/VMM.cpp

    r11894 r11944  
    16061606     * The hypervisor stack. 
    16071607     */ 
    1608     SSMR3PutGCPtr(pSSM, pVM->vmm.s.pbGCStackBottom); 
    1609     RTGCPTR GCPtrESP = CPUMGetHyperESP(pVM); 
     1608    SSMR3PutRCPtr(pSSM, pVM->vmm.s.pbGCStackBottom); 
     1609    RTRCPTR GCPtrESP = CPUMGetHyperESP(pVM); 
    16101610    AssertMsg(pVM->vmm.s.pbGCStackBottom - GCPtrESP <= VMM_STACK_SIZE, ("Bottom %VGv ESP=%VGv\n", pVM->vmm.s.pbGCStackBottom, GCPtrESP)); 
    1611     SSMR3PutGCPtr(pSSM, GCPtrESP); 
     1611    SSMR3PutRCPtr(pSSM, GCPtrESP); 
    16121612    SSMR3PutMem(pSSM, pVM->vmm.s.pbHCStack, VMM_STACK_SIZE); 
    16131613    return SSMR3PutU32(pSSM, ~0); /* terminator */ 
     
    16391639     * Check that the stack is in the same place, or that it's fearly empty. 
    16401640     */ 
    1641     RTGCPTR GCPtrStackBottom; 
    1642     SSMR3GetGCPtr(pSSM, &GCPtrStackBottom); 
    1643     RTGCPTR GCPtrESP; 
    1644     int rc = SSMR3GetGCPtr(pSSM, &GCPtrESP); 
     1641    RTRCPTR GCPtrStackBottom; 
     1642    SSMR3GetRCPtr(pSSM, &GCPtrStackBottom); 
     1643    RTRCPTR GCPtrESP; 
     1644    int rc = SSMR3GetRCPtr(pSSM, &GCPtrESP); 
    16451645    if (VBOX_FAILURE(rc)) 
    16461646        return rc; 
     
    16701670    } 
    16711671 
    1672     LogRel(("The stack is not in the same place and it's not empty! GCPtrStackBottom=%VGv pbGCStackBottom=%VGv ESP=%VGv\n", 
     1672    LogRel(("The stack is not in the same place and it's not empty! GCPtrStackBottom=%VRv pbGCStackBottom=%VRv ESP=%VRv\n", 
    16731673            GCPtrStackBottom, pVM->vmm.s.pbGCStackBottom, GCPtrESP)); 
    16741674    if (SSMR3HandleGetAfter(pSSM) == SSMAFTER_DEBUG_IT) 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy