VirtualBox

Changeset 23785 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Oct 14, 2009 11:53:37 PM (15 years ago)
Author:
vboxsync
Message:

SSM: Added an _OLD field family for skipping obsolete field. May have other uses as well.

File:
1 edited

Legend:

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

    r23783 r23785  
    134134    /** No transformation. */
    135135    SSMFIELDTRANS_NO_TRANSFORMATION,
     136    /** Guest context (GC) physical address. */
     137    SSMFIELDTRANS_GCPHYS,
    136138    /** Guest context (GC) virtual address. */
    137139    SSMFIELDTRANS_GCPTR,
    138     /** Guest context (GC) physical address. */
    139     SSMFIELDTRANS_GCPHYS,
    140140    /** Raw-mode context (RC) virtual address. */
    141141    SSMFIELDTRANS_RCPTR,
     
    152152    /** Ignorable field. See SSMFIELD_ENTRY_IGNORE. */
    153153    SSMFIELDTRANS_IGNORE,
     154    /** Ignorable guest context (GC) physical address. */
     155    SSMFIELDTRANS_IGN_GCPHYS,
    154156    /** Ignorable guest context (GC) virtual address. */
    155157    SSMFIELDTRANS_IGN_GCPTR,
    156     /** Ignorable guest context (GC) physical address. */
    157     SSMFIELDTRANS_IGN_GCPHYS,
    158158    /** Ignorable raw-mode context (RC) virtual address. */
    159159    SSMFIELDTRANS_IGN_RCPTR,
    160160    /** Ignorable host context (HC) virtual address.  */
    161161    SSMFIELDTRANS_IGN_HCPTR,
     162
     163    /** Old field.
     164     * Save as zeros and skip on restore (nowhere to restore it any longer).  */
     165    SSMFIELDTRANS_OLD,
     166    /** Old guest context (GC) physical address. */
     167    SSMFIELDTRANS_OLD_GCPHYS,
     168    /** Old guest context (GC) virtual address. */
     169    SSMFIELDTRANS_OLD_GCPTR,
     170    /** Old raw-mode context (RC) virtual address. */
     171    SSMFIELDTRANS_OLD_RCPTR,
     172    /** Old host context (HC) virtual address.  */
     173    SSMFIELDTRANS_OLD_HCPTR,
    162174
    163175    /** Padding that differs between 32-bit and 64-bit hosts.
     
    190202    (   (uintptr_t)(pfn) >= SSMFIELDTRANS_PAD_HC && (uintptr_t)(pfn) <= SSMFIELDTRANS_PAD_MSC32_AUTO )
    191203
     204/** Tests if it's an entry for an old field.
     205 *
     206 * @returns true / false.
     207 * @param   pfn     The SSMFIELD::pfnGetPutOrTransformer value.
     208 */
     209#define SSMFIELDTRANS_IS_OLD(pfn)   \
     210    (   (uintptr_t)(pfn) >= SSMFIELDTRANS_OLD && (uintptr_t)(pfn) <= SSMFIELDTRANS_OLD_HCPTR )
     211
    192212/**
    193213 * A structure field description.
     
    213233        RT_SIZEOFMEMB(Type, Field), \
    214234        #Type "::" #Field \
     235    }
     236/** Emit a SSMFIELD array entry for an old field.
     237 * @internal  */
     238#define SSMFIELD_ENTRY_OLD_INT(cb, enmTransformer) \
     239    { \
     240        (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), \
     241        UINT32_MAX / 2, \
     242        (cb), \
     243        "<old>" \
    215244    }
    216245/** Emit a SSMFIELD array entry for an alignment padding.
     
    233262    }
    234263
     264
    235265/** Emit a SSMFIELD array entry. */
    236266#define SSMFIELD_ENTRY(Type, Field)                 SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_NO_TRANSFORMATION)
     267/** Emit a SSMFIELD array entry for a RTGCPHYS type. */
     268#define SSMFIELD_ENTRY_GCPHYS(Type, Field)          SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_GCPHYS)
    237269/** Emit a SSMFIELD array entry for a RTGCPTR type. */
    238270#define SSMFIELD_ENTRY_GCPTR(Type, Field)           SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_GCPTR)
    239 /** Emit a SSMFIELD array entry for a RTGCPHYS type. */
    240 #define SSMFIELD_ENTRY_GCPHYS(Type, Field)          SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_GCPHYS)
    241271/** Emit a SSMFIELD array entry for a raw-mode context pointer. */
    242272#define SSMFIELD_ENTRY_RCPTR(Type, Field)           SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_RCPTR)
     
    259289 * It is stored as zeros if SSMSTRUCT_FLAGS_DONT_IGNORE is specified to
    260290 * SSMR3PutStructEx.  The member is never touched upon restore. */
    261 #define SSMFIELD_ENTRY_IGNORE(Type, Field)          SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGNORE)
     291#define SSMFIELD_ENTRY_IGNORE(Type, Field)          SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_OLD)
    262292/** Emit a SSMFIELD array entry for an ignorable RTGCPHYS type. */
    263 #define SSMFIELD_ENTRY_IGN_GCPHYS(Type, Field)      SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGN_GCPHYS)
     293#define SSMFIELD_ENTRY_IGN_GCPHYS(Type, Field)      SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_OLD_GCPHYS)
    264294/** Emit a SSMFIELD array entry for an ignorable RTGCPHYS type. */
    265 #define SSMFIELD_ENTRY_IGN_GCPTR(Type, Field)       SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGN_GCPTR)
     295#define SSMFIELD_ENTRY_IGN_GCPTR(Type, Field)       SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_OLD_GCPTR)
    266296/** Emit a SSMFIELD array entry for an ignorable raw-mode context pointer. */
    267 #define SSMFIELD_ENTRY_IGN_RCPTR(Type, Field)       SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGN_RCPTR)
     297#define SSMFIELD_ENTRY_IGN_RCPTR(Type, Field)       SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_OLD_RCPTR)
    268298/** Emit a SSMFIELD array entry for an ignorable ring-3 or/and ring-0 pointer. */
    269 #define SSMFIELD_ENTRY_IGN_HCPTR(Type, Field)       SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGN_HCPTR)
     299#define SSMFIELD_ENTRY_IGN_HCPTR(Type, Field)       SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_OLD_HCPTR)
     300
     301/** Emit a SSMFIELD array entry for an old field that should be ignored now.
     302 * It is stored as zeros and skipped on load. */
     303#define SSMFIELD_ENTRY_OLD(cb)                      SSMFIELD_ENTRY_OLD_INT(cb, SSMFIELDTRANS_IGNORE)
     304/** 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_IGN_GCPHYS)
     306/** 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_IGN_GCPTR)
     308/** 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_IGN_RCPTR)
     310/** 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_IGN_HCPTR)
    270312
    271313/** Emit a SSMFIELD array entry for a padding that differs in size between
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