VirtualBox

Changeset 23872 in vbox


Ignore:
Timestamp:
Oct 19, 2009 2:49:13 PM (15 years ago)
Author:
vboxsync
Message:

SSM: Extended and fixed the SSMFIELD_ENTRY_OLD bits.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/ssm.h

    r23816 r23872  
    172172    /** Old host context (HC) virtual address.  */
    173173    SSMFIELDTRANS_OLD_HCPTR,
     174    /** Old host context specific padding.
     175     * The lower word is the size of 32-bit hosts, the upper for 64-bit hosts. */
     176    SSMFIELDTRANS_OLD_PAD_HC,
     177    /** Old padding specific to the 32-bit Microsoft C Compiler. */
     178    SSMFIELDTRANS_OLD_PAD_MSC32,
    174179
    175180    /** Padding that differs between 32-bit and 64-bit hosts.
     
    208213 */
    209214#define SSMFIELDTRANS_IS_OLD(pfn)   \
    210     (   (uintptr_t)(pfn) >= SSMFIELDTRANS_OLD && (uintptr_t)(pfn) <= SSMFIELDTRANS_OLD_HCPTR )
     215    (   (uintptr_t)(pfn) >= SSMFIELDTRANS_OLD && (uintptr_t)(pfn) <= SSMFIELDTRANS_OLD_PAD_MSC32 )
    211216
    212217/**
     
    227232/** Emit a SSMFIELD array entry.
    228233 * @internal  */
    229 #define SSMFIELD_ENTRY_INT(Type, Field, enmTransformer) \
    230     { \
    231         (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), \
    232         RT_OFFSETOF(Type, Field), \
    233         RT_SIZEOFMEMB(Type, Field), \
    234         #Type "::" #Field \
    235     }
     234#define SSMFIELD_ENTRY_INT(Name, off, cb, enmTransformer) \
     235    { (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), (off), (cb), Name }
     236/** Emit a SSMFIELD array entry.
     237 * @internal  */
     238#define SSMFIELD_ENTRY_TF_INT(Type, Field, enmTransformer) \
     239    SSMFIELD_ENTRY_INT(#Type "::" #Field, RT_OFFSETOF(Type, Field), RT_SIZEOFMEMB(Type, Field), enmTransformer)
    236240/** Emit a SSMFIELD array entry for an old field.
    237241 * @internal  */
    238 #define SSMFIELD_ENTRY_OLD_INT(cb, enmTransformer) \
    239     { \
    240         (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), \
    241         UINT32_MAX / 2, \
    242         (cb), \
    243         "<old>" \
    244     }
     242#define SSMFIELD_ENTRY_OLD_INT(Field, cb, enmTransformer) \
     243    SSMFIELD_ENTRY_INT("old::" #Field, UINT32_MAX / 2, (cb), enmTransformer)
    245244/** Emit a SSMFIELD array entry for an alignment padding.
    246245 * @internal  */
    247246#define SSMFIELD_ENTRY_PAD_INT(Type, Field, cb32, cb64, enmTransformer) \
    248     { \
    249         (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), \
    250         RT_OFFSETOF(Type, Field), \
    251         (RT_SIZEOFMEMB(Type, Field) << 16) | (cb32) | ((cb64) << 8), \
    252         #Type "::" #Field \
    253     }
     247    SSMFIELD_ENTRY_INT(#Type "::" #Field, RT_OFFSETOF(Type, Field), \
     248                       (RT_SIZEOFMEMB(Type, Field) << 16) | (cb32) | ((cb64) << 8), enmTransformer)
    254249/** Emit a SSMFIELD array entry for an alignment padding.
    255250 * @internal  */
    256251#define SSMFIELD_ENTRY_PAD_OTHER_INT(Type, Field, cb32, cb64, enmTransformer) \
    257     { \
    258         (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), \
    259         UINT32_MAX / 2, \
    260         0 | (cb32) | ((cb64) << 8), \
    261         #Type "::" #Field \
    262     }
    263 
     252    SSMFIELD_ENTRY_INT(#Type "::" #Field, UINT32_MAX / 2, 0 | (cb32) | ((cb64) << 8), enmTransformer)
    264253
    265254/** Emit a SSMFIELD array entry. */
    266 #define SSMFIELD_ENTRY(Type, Field)                 SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_NO_TRANSFORMATION)
     255#define SSMFIELD_ENTRY(Type, Field)                 SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_NO_TRANSFORMATION)
     256/** Emit a SSMFIELD array entry for a custom made field.  This is intended
     257 *  for working around bitfields in old structures. */
     258#define SSMFIELD_ENTRY_CUSTOM(Field, off, cb)       SSMFIELD_ENTRY_INT("custom::" #Field, off, cb, SSMFIELDTRANS_NO_TRANSFORMATION)
    267259/** Emit a SSMFIELD array entry for a RTGCPHYS type. */
    268 #define SSMFIELD_ENTRY_GCPHYS(Type, Field)          SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_GCPHYS)
     260#define SSMFIELD_ENTRY_GCPHYS(Type, Field)          SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_GCPHYS)
    269261/** Emit a SSMFIELD array entry for a RTGCPTR type. */
    270 #define SSMFIELD_ENTRY_GCPTR(Type, Field)           SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_GCPTR)
     262#define SSMFIELD_ENTRY_GCPTR(Type, Field)           SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_GCPTR)
    271263/** Emit a SSMFIELD array entry for a raw-mode context pointer. */
    272 #define SSMFIELD_ENTRY_RCPTR(Type, Field)           SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_RCPTR)
     264#define SSMFIELD_ENTRY_RCPTR(Type, Field)           SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_RCPTR)
    273265/** Emit a SSMFIELD array entry for a raw-mode context pointer. */
    274 #define SSMFIELD_ENTRY_RCPTR_ARRAY(Type, Field)     SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_RCPTR_ARRAY)
     266#define SSMFIELD_ENTRY_RCPTR_ARRAY(Type, Field)     SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_RCPTR_ARRAY)
    275267/** Emit a SSMFIELD array entry for a ring-0 or ring-3 pointer type that is only
    276268 * of interest as a NULL indicator.
     
    279271 * SSMSTRUCT_FLAGS_DONT_IGNORE is set, the pointer will be saved in its
    280272 * entirety, when clear it will be saved as a boolean. */
    281 #define SSMFIELD_ENTRY_HCPTR_NI(Type, Field)        SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_HCPTR_NI)
     273#define SSMFIELD_ENTRY_HCPTR_NI(Type, Field)        SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_HCPTR_NI)
    282274/** Same as SSMFIELD_ENTRY_HCPTR_NI, except it's an array of the buggers. */
    283 #define SSMFIELD_ENTRY_HCPTR_NI_ARRAY(Type, Field)  SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_HCPTR_NI_ARRAY)
     275#define SSMFIELD_ENTRY_HCPTR_NI_ARRAY(Type, Field)  SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_HCPTR_NI_ARRAY)
    284276/** Emit a SSMFIELD array entry for a ring-0 or ring-3 pointer type that has
    285277 * been hacked such that it will never exceed 32-bit.  No sign extenending. */
    286 #define SSMFIELD_ENTRY_HCPTR_HACK_U32(Type, Field)  SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_HCPTR_HACK_U32)
     278#define SSMFIELD_ENTRY_HCPTR_HACK_U32(Type, Field)  SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_HCPTR_HACK_U32)
    287279
    288280/** Emit a SSMFIELD array entry for a field that can be ignored.
    289281 * It is stored as zeros if SSMSTRUCT_FLAGS_DONT_IGNORE is specified to
    290282 * SSMR3PutStructEx.  The member is never touched upon restore. */
    291 #define SSMFIELD_ENTRY_IGNORE(Type, Field)          SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGNORE)
     283#define SSMFIELD_ENTRY_IGNORE(Type, Field)          SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGNORE)
    292284/** Emit a SSMFIELD array entry for an ignorable RTGCPHYS type. */
    293 #define SSMFIELD_ENTRY_IGN_GCPHYS(Type, Field)      SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGN_GCPHYS)
     285#define SSMFIELD_ENTRY_IGN_GCPHYS(Type, Field)      SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGN_GCPHYS)
    294286/** Emit a SSMFIELD array entry for an ignorable RTGCPHYS type. */
    295 #define SSMFIELD_ENTRY_IGN_GCPTR(Type, Field)       SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGN_GCPTR)
     287#define SSMFIELD_ENTRY_IGN_GCPTR(Type, Field)       SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGN_GCPTR)
    296288/** Emit a SSMFIELD array entry for an ignorable raw-mode context pointer. */
    297 #define SSMFIELD_ENTRY_IGN_RCPTR(Type, Field)       SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGN_RCPTR)
     289#define SSMFIELD_ENTRY_IGN_RCPTR(Type, Field)       SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGN_RCPTR)
    298290/** Emit a SSMFIELD array entry for an ignorable ring-3 or/and ring-0 pointer. */
    299 #define SSMFIELD_ENTRY_IGN_HCPTR(Type, Field)       SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGN_HCPTR)
     291#define SSMFIELD_ENTRY_IGN_HCPTR(Type, Field)       SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGN_HCPTR)
    300292
    301293/** Emit a SSMFIELD array entry for an old field that should be ignored now.
    302294 * It is stored as zeros and skipped on load. */
    303 #define SSMFIELD_ENTRY_OLD(cb)                      SSMFIELD_ENTRY_OLD_INT(cb,               SSMFIELDTRANS_OLD)
     295#define SSMFIELD_ENTRY_OLD(Field, cb)               SSMFIELD_ENTRY_OLD_INT(Field, cb,               SSMFIELDTRANS_OLD)
    304296/** Same as SSMFIELD_ENTRY_IGN_GCPHYS, except there is no structure field. */
    305 #define SSMFIELD_ENTRY_OLD_GCPHYS()                 SSMFIELD_ENTRY_OLD_INT(sizeof(RTGCPHYS), SSMFIELDTRANS_OLD_GCPHYS)
     297#define SSMFIELD_ENTRY_OLD_GCPHYS(Field)            SSMFIELD_ENTRY_OLD_INT(Field, sizeof(RTGCPHYS), SSMFIELDTRANS_OLD_GCPHYS)
    306298/** Same as SSMFIELD_ENTRY_IGN_GCPTR, except there is no structure field. */
    307 #define SSMFIELD_ENTRY_OLD_GCPTR()                  SSMFIELD_ENTRY_OLD_INT(sizeof(RTGCPTR),  SSMFIELDTRANS_OLD_GCPTR)
     299#define SSMFIELD_ENTRY_OLD_GCPTR(Field)             SSMFIELD_ENTRY_OLD_INT(Field, sizeof(RTGCPTR),  SSMFIELDTRANS_OLD_GCPTR)
    308300/** Same as SSMFIELD_ENTRY_IGN_RCPTR, except there is no structure field. */
    309 #define SSMFIELD_ENTRY_OLD_RCPTR()                  SSMFIELD_ENTRY_OLD_INT(sizeof(RTRCPTR),  SSMFIELDTRANS_OLD_RCPTR)
     301#define SSMFIELD_ENTRY_OLD_RCPTR(Field)             SSMFIELD_ENTRY_OLD_INT(Field, sizeof(RTRCPTR),  SSMFIELDTRANS_OLD_RCPTR)
    310302/** Same as SSMFIELD_ENTRY_IGN_HCPTR, except there is no structure field. */
    311 #define SSMFIELD_ENTRY_OLD_HCPTR()                  SSMFIELD_ENTRY_OLD_INT(sizeof(RTHCPTR),  SSMFIELDTRANS_OLD_HCPTR)
     303#define SSMFIELD_ENTRY_OLD_HCPTR(Field)             SSMFIELD_ENTRY_OLD_INT(Field, sizeof(RTHCPTR),  SSMFIELDTRANS_OLD_HCPTR)
     304/** Same as SSMFIELD_ENTRY_PAD_HC, except there is no structure field. */
     305#define SSMFIELD_ENTRY_OLD_PAD_HC(Field, cb32, cb64) \
     306    SSMFIELD_ENTRY_OLD_INT(Field, RT_MAKE_U32((cb32), (cb64)), SSMFIELDTRANS_OLD_PAD_HC)
     307/** Same as SSMFIELD_ENTRY_PAD_HC64, except there is no structure field. */
     308#define SSMFIELD_ENTRY_OLD_PAD_HC64(Field, cb)      SSMFIELD_ENTRY_OLD_PAD_HC(Field, 0, cb)
     309/** Same as SSMFIELD_ENTRY_PAD_HC32, except there is no structure field. */
     310#define SSMFIELD_ENTRY_OLD_PAD_HC32(Field, cb)      SSMFIELD_ENTRY_OLD_PAD_HC(Field, cb, 0)
     311/** Same as SSMFIELD_ENTRY_PAD_HC, except there is no structure field. */
     312#define SSMFIELD_ENTRY_OLD_PAD_MSC32(Field, cb)     SSMFIELD_ENTRY_OLD_INT(Field, cb,               SSMFIELDTRANS_OLD_PAD_MSC32)
    312313
    313314/** Emit a SSMFIELD array entry for a padding that differs in size between
  • trunk/src/VBox/VMM/SSM.cpp

    r23816 r23872  
    838838/** Pointer to a const footer. */
    839839typedef SSMFILEFTR const *PCSSMFILEFTR;
     840
     841
     842/*******************************************************************************
     843*   Global Variables                                                           *
     844*******************************************************************************/
     845/** Zeros used by the struct putter.
     846 * This must be at least 8 bytes or the code breaks. */
     847static uint8_t const    g_abZero[_1K] = {0};
    840848
    841849
     
    32953303
    32963304/**
     3305 * SSMR3PutStructEx helper that puts an arbitrary number of zeros.
     3306 *
     3307 * @returns VBox status code.
     3308 * @param   pSSM            The saved state handle.
     3309 * @param   cbToFill        The number of zeros to stuff into the state.
     3310 */
     3311static int ssmR3PutZeros(PSSMHANDLE pSSM, uint32_t cbToFill)
     3312{
     3313    while (cbToFill > 0)
     3314    {
     3315        size_t cb = RT_MIN(sizeof(g_abZero), cbToFill);
     3316        int rc = ssmR3DataWrite(pSSM, g_abZero, cb);
     3317        if (RT_FAILURE(rc))
     3318            return rc;
     3319        cbToFill -= cb;
     3320    }
     3321    return VINF_SUCCESS;
     3322}
     3323
     3324
     3325/**
    32973326 * Puts a structure, extended API.
    32983327 *
     
    33103339                                uint32_t fFlags, PCSSMFIELD paFields, void *pvUser)
    33113340{
    3312     static uint8_t const s_abZero[_1K] = {0};
    33133341    int rc;
    33143342
     
    33603388                        VERR_SSM_FIELD_NOT_CONSECUTIVE);
    33613389
     3390        rc = VINF_SUCCESS;
    33623391        uint8_t const *pbField = (uint8_t const *)pvStruct + offField;
    33633392        switch ((uintptr_t)pCur->pfnGetPutOrTransformer)
     
    33863415                uint32_t const cEntries = cbField / sizeof(RTRCPTR);
    33873416                AssertMsgReturn(cbField == cEntries * sizeof(RTRCPTR) && cEntries, ("%#x (%s)\n", cbField, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    3388                 rc = VINF_SUCCESS;
    33893417                for (uint32_t i = 0; i < cEntries && RT_SUCCESS(rc); i++)
    33903418                    rc = SSMR3PutRCPtr(pSSM, ((PRTRCPTR)pbField)[i]);
     
    34013429                uint32_t const cEntries = cbField / sizeof(void *);
    34023430                AssertMsgReturn(cbField == cEntries * sizeof(void *) && cEntries, ("%#x (%s)\n", cbField, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    3403                 rc = VINF_SUCCESS;
    34043431                for (uint32_t i = 0; i < cEntries && RT_SUCCESS(rc); i++)
    34053432                    rc = ssmR3PutHCPtrNI(pSSM, ((void * const *)pbField)[i], fFlags);
     
    34123439                rc = ssmR3DataWrite(pSSM, pbField, sizeof(uint32_t));
    34133440                if ((fFlags & SSMSTRUCT_FLAGS_DONT_IGNORE) && sizeof(void *) != sizeof(uint32_t))
    3414                     rc = ssmR3DataWrite(pSSM, s_abZero, sizeof(uint32_t));
     3441                    rc = ssmR3DataWrite(pSSM, g_abZero, sizeof(uint32_t));
    34153442                break;
    34163443
     
    34183445            case SSMFIELDTRANS_IGNORE:
    34193446                if (fFlags & SSMSTRUCT_FLAGS_DONT_IGNORE)
    3420                 {
    3421                     uint32_t cb;
    3422                     for (uint32_t cbLeft = cbField; cbLeft > 0 && RT_SUCCESS(rc); cbLeft -= cb)
    3423                     {
    3424                         cb = RT_MIN(sizeof(s_abZero), cbLeft);
    3425                         rc = ssmR3DataWrite(pSSM, s_abZero, cb);
    3426                     }
    3427                 }
     3447                    rc = ssmR3PutZeros(pSSM, cbField);
    34283448                break;
    34293449
     
    34313451                AssertMsgReturn(cbField == sizeof(RTGCPHYS), ("%#x (%s)\n", cbField, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    34323452                if (fFlags & SSMSTRUCT_FLAGS_DONT_IGNORE)
    3433                     rc = ssmR3DataWrite(pSSM, s_abZero, sizeof(RTGCPHYS));
     3453                    rc = ssmR3DataWrite(pSSM, g_abZero, sizeof(RTGCPHYS));
    34343454                break;
    34353455
     
    34373457                AssertMsgReturn(cbField == sizeof(RTGCPTR), ("%#x (%s)\n", cbField, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    34383458                if (fFlags & SSMSTRUCT_FLAGS_DONT_IGNORE)
    3439                     rc = ssmR3DataWrite(pSSM, s_abZero, sizeof(RTGCPTR));
     3459                    rc = ssmR3DataWrite(pSSM, g_abZero, sizeof(RTGCPTR));
    34403460                break;
    34413461
     
    34433463                AssertMsgReturn(cbField == sizeof(RTRCPTR), ("%#x (%s)\n", cbField, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    34443464                if (fFlags & SSMSTRUCT_FLAGS_DONT_IGNORE)
    3445                     rc = ssmR3DataWrite(pSSM, s_abZero, sizeof(RTRCPTR));
     3465                    rc = ssmR3DataWrite(pSSM, g_abZero, sizeof(RTRCPTR));
    34463466                break;
    34473467
     
    34493469                AssertMsgReturn(cbField == sizeof(void *), ("%#x (%s)\n", cbField, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    34503470                if (fFlags & SSMSTRUCT_FLAGS_DONT_IGNORE)
    3451                     rc = ssmR3DataWrite(pSSM, s_abZero, sizeof(void *));
     3471                    rc = ssmR3DataWrite(pSSM, g_abZero, sizeof(void *));
    34523472                break;
    34533473
    34543474
    34553475            case SSMFIELDTRANS_OLD:
    3456             {
    3457                 uint32_t cb;
    3458                 for (uint32_t cbLeft = pCur->cb; cbLeft > 0 && RT_SUCCESS(rc); cbLeft -= cb)
    3459                 {
    3460                     cb = RT_MIN(sizeof(s_abZero), cbLeft);
    3461                     rc = ssmR3DataWrite(pSSM, s_abZero, cb);
    3462                 }
     3476                AssertMsgReturn(pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
     3477                rc = ssmR3PutZeros(pSSM, pCur->cb);
    34633478                break;
    3464             }
    34653479
    34663480            case SSMFIELDTRANS_OLD_GCPHYS:
    34673481                AssertMsgReturn(pCur->cb == sizeof(RTGCPHYS) && pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    3468                 rc = ssmR3DataWrite(pSSM, s_abZero, sizeof(RTGCPHYS));
     3482                rc = ssmR3DataWrite(pSSM, g_abZero, sizeof(RTGCPHYS));
    34693483                break;
    34703484
    34713485            case SSMFIELDTRANS_OLD_GCPTR:
    34723486                AssertMsgReturn(pCur->cb == sizeof(RTGCPTR) && pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    3473                 rc = ssmR3DataWrite(pSSM, s_abZero, sizeof(RTGCPTR));
     3487                rc = ssmR3DataWrite(pSSM, g_abZero, sizeof(RTGCPTR));
    34743488                break;
    34753489
    34763490            case SSMFIELDTRANS_OLD_RCPTR:
    34773491                AssertMsgReturn(pCur->cb == sizeof(RTRCPTR) && pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    3478                 rc = ssmR3DataWrite(pSSM, s_abZero, sizeof(RTRCPTR));
     3492                rc = ssmR3DataWrite(pSSM, g_abZero, sizeof(RTRCPTR));
    34793493                break;
    34803494
    34813495            case SSMFIELDTRANS_OLD_HCPTR:
    34823496                AssertMsgReturn(pCur->cb == sizeof(void *) && pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    3483                 rc = ssmR3DataWrite(pSSM, s_abZero, sizeof(void *));
     3497                rc = ssmR3DataWrite(pSSM, g_abZero, sizeof(void *));
     3498                break;
     3499
     3500            case SSMFIELDTRANS_OLD_PAD_HC:
     3501                AssertMsgReturn(pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
     3502                rc = ssmR3PutZeros(pSSM, HC_ARCH_BITS == 64 ? RT_HIWORD(pCur->cb) : RT_LOWORD(pCur->cb));
     3503                break;
     3504
     3505            case SSMFIELDTRANS_OLD_PAD_MSC32:
     3506                AssertMsgReturn(pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
     3507                if (SSM_HOST_IS_MSC_32)
     3508                    rc = ssmR3PutZeros(pSSM, pCur->cb);
    34843509                break;
    34853510
     
    35143539                                VERR_SSM_FIELD_INVALID_PADDING_SIZE);
    35153540                if (fFlags & SSMSTRUCT_FLAGS_DONT_IGNORE)
    3516                 {
    3517                     uint32_t cb;
    3518                     for (uint32_t cbLeft = cbSaved; cbLeft > 0 && RT_SUCCESS(rc); cbLeft -= cb)
    3519                     {
    3520                         cb = RT_MIN(sizeof(s_abZero), cbLeft);
    3521                         rc = ssmR3DataWrite(pSSM, s_abZero, cb);
    3522                     }
    3523                 }
     3541                    rc = ssmR3PutZeros(pSSM, cbSaved);
    35243542                break;
    35253543            }
     
    60556073                        VERR_SSM_FIELD_NOT_CONSECUTIVE);
    60566074
     6075        rc = VINF_SUCCESS;
    60576076        uint8_t       *pbField  = (uint8_t *)pvStruct + offField;
    60586077        switch ((uintptr_t)pCur->pfnGetPutOrTransformer)
     
    61486167
    61496168            case SSMFIELDTRANS_OLD:
     6169                AssertMsgReturn(pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    61506170                rc = SSMR3Skip(pSSM, pCur->cb);
    61516171                break;
     
    61696189                AssertMsgReturn(pCur->cb == sizeof(void *) && pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
    61706190                rc = SSMR3Skip(pSSM, ssmR3GetHostBits(pSSM) / 8);
     6191                break;
     6192
     6193            case SSMFIELDTRANS_OLD_PAD_HC:
     6194                AssertMsgReturn(pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
     6195                rc = SSMR3Skip(pSSM, ssmR3GetHostBits(pSSM) == 64 ? RT_HIWORD(pCur->cb) : RT_LOWORD(pCur->cb));
     6196                break;
     6197
     6198            case SSMFIELDTRANS_OLD_PAD_MSC32:
     6199                AssertMsgReturn(pCur->off == UINT32_MAX / 2, ("%#x %#x (%s)\n", pCur->cb, pCur->off, pCur->pszName), VERR_SSM_FIELD_INVALID_SIZE);
     6200                if (ssmR3IsHostMsc32(pSSM))
     6201                    rc = SSMR3Skip(pSSM, pCur->cb);
    61716202                break;
    61726203
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette