VirtualBox

Changeset 9212 in vbox for trunk/include/iprt


Ignore:
Timestamp:
May 29, 2008 9:38:38 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
31380
Message:

Major changes for sizeof(RTGCPTR) == uint64_t.
Introduced RCPTRTYPE for pointers valid in raw mode only (RTGCPTR32).

Disabled by default. Enable by adding VBOX_WITH_64_BITS_GUESTS to your LocalConfig.kmk.

Location:
trunk/include/iprt
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm.h

    r9183 r9212  
    38603860
    38613861#  elif RT_INLINE_ASM_GNU_STYLE
    3862     RTUINTREG uDummy;
     3862    RTCCUINTREG uDummy;
    38633863#   ifdef RT_ARCH_AMD64
    38643864    __asm__ __volatile__ ("rep stosq"
     
    41294129# else /* !RT_ARCH_AMD64 */
    41304130#  if RT_INLINE_ASM_GNU_STYLE
    4131     RTUINTREG uDummy;
     4131    RTCCUINTREG uDummy;
    41324132    __asm__ __volatile__("divl %3"
    41334133                         : "=a" (u32), "=d"(uDummy)
     
    41634163# else /* !RT_ARCH_AMD64 */
    41644164#  if RT_INLINE_ASM_GNU_STYLE
    4165     RTUINTREG iDummy;
     4165    RTCCUINTREG iDummy;
    41664166    __asm__ __volatile__("idivl %3"
    41674167                         : "=a" (i32), "=d"(iDummy)
  • trunk/include/iprt/asmdefs.mac

    r9145 r9212  
    429429%endif
    430430
     431%define RTGCPTR32_RES   resd
     432%define RTGCPTR64_RES   resq
     433
    431434;; @def RTGCPTR_PRE
    432435; The memory operand prefix used for a pointer in the guest context.
     
    504507%define RTGCPHYS_DEF    dq
    505508
    506 ;; @def RTGCPTR_RES
     509;; @def RTGCPHYS_RES
    507510; The pesudo-instruction used to declare (=reserve space for) an uninitialized
    508511; guest physical address variable
  • trunk/include/iprt/cdefs.h

    r9148 r9212  
    217217 * @param   R3Type  The R3 type.
    218218 * @param   R0Type  The R0 type.
    219  * @remark  For pointers used only in one context use GCPTRTYPE(), R3R0PTRTYPE(), R3PTRTYPE() or R0PTRTYPE().
     219 * @remark  For pointers used only in one context use RCPTRTYPE(), R3R0PTRTYPE(), R3PTRTYPE() or R0PTRTYPE().
    220220 */
    221221#ifdef IN_GC
     
    232232 * @param   GCType  The GC type.
    233233 * @param   HCType  The HC type.
    234  * @remark  For pointers used only in one context use GCPTRTYPE(), R3R0PTRTYPE(), R3PTRTYPE() or R0PTRTYPE().
     234 * @remark  For pointers used only in one context use RCPTRTYPE(), R3R0PTRTYPE(), R3PTRTYPE() or R0PTRTYPE().
    235235 */
    236236#define GCTYPE(GCType, HCType)  CTXTYPE(GCType, HCType, HCType)
    237237
    238 /** @def GCPTRTYPE
     238/** @def RCPTRTYPE
    239239 * Declare a pointer which is used in GC but appears in structure(s) used by
    240240 * both HC and GC. The main purpose is to make sure structures have the same
     
    243243 * @param   GCType  The GC type.
    244244 */
    245 #define GCPTRTYPE(GCType)       CTXTYPE(GCType, RTGCPTR32, RTGCPTR32)
     245#define RCPTRTYPE(GCType)       CTXTYPE(GCType, RTGCPTR32, RTGCPTR32)
    246246
    247247/** @def R3R0PTRTYPE
  • trunk/include/iprt/log.h

    r8964 r9212  
    193193typedef DECLCALLBACK(void) FNRTLOGFLUSHGC(PRTLOGGERGC pLogger);
    194194/** Pointer to logger function. */
    195 typedef GCPTRTYPE(FNRTLOGFLUSHGC *) PFNRTLOGFLUSHGC;
     195typedef RCPTRTYPE(FNRTLOGFLUSHGC *) PFNRTLOGFLUSHGC;
    196196
    197197
     
    212212     * instance pointer onto the stack before jumping to the real logger function.
    213213     * A very unfortunate hack to work around the missing variadic macro support in C++. */
    214     GCPTRTYPE(PFNRTLOGGER)  pfnLogger;
     214    RCPTRTYPE(PFNRTLOGGER)  pfnLogger;
    215215    /** Pointer to the flush function. */
    216216    PFNRTLOGFLUSHGC         pfnFlush;
  • trunk/include/iprt/spinlock.h

    r8245 r9212  
    5656# elif defined(RT_OS_WINDOWS)
    5757    /** The saved [R|E]FLAGS. */
    58     RTUINTREG       uFlags;
     58    RTCCUINTREG       uFlags;
    5959    /** The KIRQL. */
    6060    unsigned char   uchIrqL;
     
    6868# elif defined(RT_OS_DARWIN)
    6969    /** The saved [R|E]FLAGS. */
    70     RTUINTREG       uFlags;
     70    RTCCUINTREG       uFlags;
    7171#  define RTSPINLOCKTMP_INITIALIZER { 0 }
    7272
    7373# elif defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS)
    7474    /** The saved [R|E]FLAGS. (dummy) */
    75     RTUINTREG       uFlags;
     75    RTCCUINTREG       uFlags;
    7676#  define RTSPINLOCKTMP_INITIALIZER { 0 }
    7777
     
    7979#  error "Your OS is not supported.\n"
    8080    /** The saved [R|E]FLAGS. */
    81     RTUINTREG       uFlags;
     81    RTCCUINTREG       uFlags;
    8282# endif
    8383
     
    8585    /** The saved [R|E]FLAGS.
    8686     * (RT spinlocks will by definition disable interrupts.) */
    87     RTUINTREG       uFlags;
     87    RTCCUINTREG       uFlags;
    8888# define RTSPINLOCKTMP_INITIALIZER { 0 }
    8989#endif /* !IN_RING0 */
  • trunk/include/iprt/time.h

    r8245 r9212  
    842842typedef struct RTTIMENANOTSDATAGC
    843843{
    844     GCPTRTYPE(uint64_t volatile  *) pu64Prev;
     844    RCPTRTYPE(uint64_t volatile  *) pu64Prev;
    845845    DECLGCCALLBACKMEMBER(void, pfnBad,(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS));
    846846    DECLGCCALLBACKMEMBER(uint64_t, pfnRediscover,(PRTTIMENANOTSDATA pData));
    847     RTGCPTR             pvDummy;
     847    RCPTRTYPE(void *)   pvDummy;
    848848    uint32_t            c1nsSteps;
    849849    uint32_t            cExpired;
  • trunk/include/iprt/types.h

    r9145 r9212  
    707707
    708708/** Natural signed integer in the GC. */
     709#if GC_ARCH_BITS == 32
    709710typedef int32_t         RTGCINT;
     711#elif GC_ARCH_BITS == 64
     712typedef int64_t         RTGCINT;
     713#endif
    710714/** Pointer to natural signed interger in GC. */
    711715typedef RTGCINT        *PRTGCINT;
     
    713717typedef const RTGCINT  *PCRTGCINT;
    714718
    715 /** Natural signed uninteger in the GC. */
     719/** Natural unsigned integer in the GC. */
     720#if GC_ARCH_BITS == 32
    716721typedef uint32_t        RTGCUINT;
    717 /** Pointer to natural unsigned interger in GC. */
     722#elif GC_ARCH_BITS == 64
     723typedef uint64_t        RTGCUINT;
     724#endif
     725/** Pointer to natural unsigned integer in GC. */
    718726typedef RTGCUINT       *PRTGCUINT;
    719 /** Pointer to const natural unsigned interger in GC. */
     727/** Pointer to const natural unsigned integer in GC. */
    720728typedef const RTGCUINT *PCRTGCUINT;
    721729
     
    725733#elif GC_ARCH_BITS == 64
    726734typedef int64_t         RTGCINTPTR;
    727 #else
    728 #  error Unsupported GC_ARCH_BITS value.
    729735#endif
    730736/** Pointer to signed interger which can contain a GC pointer. */
     
    808814 * HC and void pointer in GC.
    809815 */
    810 #ifdef IN_GC
    811 typedef void           *RTGCPTR32;
    812 #else
    813816typedef RTGCUINTPTR32   RTGCPTR32;
    814 #endif
    815817/** Pointer to a guest context pointer. */
    816818typedef RTGCPTR32      *PRTGCPTR32;
     
    863865
    864866/** Unsigned integer register in the guest context. */
     867typedef uint32_t              RTGCUINTREG32;
     868/** Pointer to an unsigned integer register in the guest context. */
     869typedef RTGCUINTREG32        *PRTGCUINTREG32;
     870/** Pointer to a const unsigned integer register in the guest context. */
     871typedef const RTGCUINTREG32  *PCRTGCUINTREG32;
     872
     873typedef uint64_t              RTGCUINTREG64;
     874/** Pointer to an unsigned integer register in the guest context. */
     875typedef RTGCUINTREG64        *PRTGCUINTREG64;
     876/** Pointer to a const unsigned integer register in the guest context. */
     877typedef const RTGCUINTREG64  *PCRTGCUINTREG64;
     878
    865879#if GC_ARCH_BITS == 64
    866 typedef uint64_t            RTGCUINTREG;
     880typedef RTGCUINTREG64       RTGCUINTREG;
    867881#elif GC_ARCH_BITS == 32
    868 typedef uint32_t            RTGCUINTREG;
     882typedef RTGCUINTREG32       RTGCUINTREG;
    869883#else
    870884# error "Unsupported GC_ARCH_BITS!"
     
    904918#endif
    905919
     920/** Unsigned integer register in the current 32 bits context. */
     921typedef uint32_t              RTCCUINTREG32;
     922/** Pointer to an unsigned integer register in the current context. */
     923typedef RTCCUINTREG32        *PRTCCUINTREG32;
     924/** Pointer to a const unsigned integer register in the current context. */
     925typedef const RTCCUINTREG32  *PCRTCCUINTREG32;
     926
     927/** Unsigned integer register in the current 64 bits context. */
     928typedef uint64_t              RTCCUINTREG64;
     929/** Pointer to an unsigned integer register in the current context. */
     930typedef RTCCUINTREG64        *PRTCCUINTREG64;
     931/** Pointer to a const unsigned integer register in the current context. */
     932typedef const RTCCUINTREG64  *PCRTCCUINTREG64;
     933
    906934/** Unsigned integer register in the current context. */
    907935#if ARCH_BITS == 32
    908 typedef uint32_t            RTCCUINTREG;
     936typedef RTCCUINTREG32         RTCCUINTREG;
     937/** Pointer to an unsigned integer register in the current context. */
     938typedef PRTCCUINTREG32        PRTCCUINTREG;
     939/** Pointer to a const unsigned integer register in the current context. */
     940typedef PCRTCCUINTREG32       PCRTCCUINTREG;
    909941#elif ARCH_BITS == 64
    910 typedef uint64_t            RTCCUINTREG;
     942typedef RTCCUINTREG64         RTCCUINTREG;
     943/** Pointer to an unsigned integer register in the current context. */
     944typedef PRTCCUINTREG64      PRTCCUINTREG;
     945/** Pointer to a const unsigned integer register in the current context. */
     946typedef PCRTCCUINTREG64     PCRTCCUINTREG;
    911947#else
    912948# error "Unsupported ARCH_BITS!"
    913949#endif
    914 /** Pointer to an unsigned integer register in the current context. */
    915 typedef RTCCUINTREG        *PRTCCUINTREG;
    916 /** Pointer to a const unsigned integer register in the current context. */
    917 typedef const RTCCUINTREG  *PCRTCCUINTREG;
    918 
    919 /** @deprecated */
    920 typedef RTCCUINTREG         RTUINTREG;
    921 /** @deprecated */
    922 typedef RTCCUINTREG        *PRTUINTREG;
    923 /** @deprecated */
    924 typedef const RTCCUINTREG  *PCRTUINTREG;
    925950
    926951/** @} */
Note: See TracChangeset for help on using the changeset viewer.

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