VirtualBox

Changeset 9223 in vbox


Ignore:
Timestamp:
May 29, 2008 1:47:32 PM (17 years ago)
Author:
vboxsync
Message:

Introduced RTRCPTR type. Raw mode context pointer aka 32 guest context pointer.

Location:
trunk
Files:
8 edited

Legend:

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

    r9212 r9223  
    930930 *
    931931 */
    932 DECLASM(void) CPUMGCCallGuestTrapHandler(PCPUMCTXCORE pRegFrame, uint32_t selCS, RTGCPTR32 pHandler, uint32_t eflags, uint32_t selSS, RTGCPTR32 pEsp);
     932DECLASM(void) CPUMGCCallGuestTrapHandler(PCPUMCTXCORE pRegFrame, uint32_t selCS, RTRCPTR pHandler, uint32_t eflags, uint32_t selSS, RTRCPTR pEsp);
    933933
    934934/**
  • trunk/include/iprt/asmdefs.mac

    r9212 r9223  
    449449
    450450
     451;; @def RTRCPTR_DEF
     452; The pesudo-instruction used to declare an initialized pointer variable in the raw mode context.
     453%define RTRCPTR_DEF    dd
     454
     455;; @def RTRCPTR_RES
     456; The pesudo-instruction used to declare (=reserve space for) an uninitialized pointer
     457; variable of the raw mode context.
     458%define RTRCPTR_RES    resd
     459
     460;; @def RTRCPTR_PRE
     461; The memory operand prefix used for a pointer in the raw mode context.
     462%define RTRCPTR_PRE    dword
     463
     464;; @def RTRCPTR_CB
     465; The size in bytes of a pointer in the raw mode context.
     466%define RTRCPTR_CB     4
     467
    451468
    452469;; @def RT_CCPTR_DEF
     
    464481
    465482%ifdef IN_GC
    466  %define RTCCPTR_DEF        RTGCPTR_DEF
    467  %define RTCCPTR_RES        RTGCPTR_RES
    468  %define RTCCPTR_PRE        RTGCPTR_PRE
    469  %define RTCCPTR_CB         RTGCPTR_CB
     483 %define RTCCPTR_DEF        RTRCPTR_DEF
     484 %define RTCCPTR_RES        RTRCPTR_RES
     485 %define RTCCPTR_PRE        RTRCPTR_PRE
     486 %define RTCCPTR_CB         RTRCPTR_CB
    470487%else
    471488 %ifdef IN_RING0
  • trunk/include/iprt/cdefs.h

    r9212 r9223  
    237237
    238238/** @def RCPTRTYPE
    239  * Declare a pointer which is used in GC but appears in structure(s) used by
    240  * both HC and GC. The main purpose is to make sure structures have the same
     239 * Declare a pointer which is used in the raw mode context but appears in structure(s) used by
     240 * both HC and RC. The main purpose is to make sure structures have the same
    241241 * size when built for different architectures.
    242242 *
    243  * @param   GCType  The GC type.
    244  */
    245 #define RCPTRTYPE(GCType)       CTXTYPE(GCType, RTGCPTR32, RTGCPTR32)
     243 * @param   RCType  The RC type.
     244 */
     245#define RCPTRTYPE(RCType)       CTXTYPE(RCType, RTRCPTR, RTRCPTR)
    246246
    247247/** @def R3R0PTRTYPE
  • trunk/include/iprt/types.h

    r9212 r9223  
    891891/** @} */
    892892
     893/** @defgroup grp_rt_types_rc  Raw mode Context Basic Types
     894 * @ingroup grp_rt_types
     895 * @{
     896 */
     897
     898/** Raw mode context pointer; a 32 bits guest context pointer
     899 * Keep in mind that this type is an unsigned integer in
     900 * HC and void pointer in GC.
     901 */
     902#ifdef IN_GC
     903typedef void *          RTRCPTR;
     904#else
     905typedef uint32_t        RTRCPTR;
     906#endif
     907/** Pointer to a raw mode context pointer. */
     908typedef RTRCPTR        *PRTRCPTR;
     909/** Pointer to a const raw mode context pointer. */
     910typedef const RTRCPTR  *PCRTRCPTR;
     911/** @def NIL_RTGCPTR
     912 * NIL RC pointer.
     913 */
     914#define NIL_RTRCPTR    ((RTRCPTR)0)
     915/** @} */
     916
    893917
    894918/** @defgroup grp_rt_types_cc  Current Context Basic Types
  • trunk/src/VBox/VMM/TRPMInternal.h

    r9212 r9223  
    152152    /** Temporary Hypervisor trap handlers.
    153153     * NULL means default action. */
    154     RTGCPTR32      aTmpTrapHandlers[256];
     154    RCPTRTYPE(void *) aTmpTrapHandlers[256];
    155155
    156156    /** GC Pointer to the IDT shadow area (aIdt) placed in Hypervisor memory arena. */
    157     RTGCPTR32      GCPtrIdt;
     157    RCPTRTYPE(void *) GCPtrIdt;
    158158    /** Current (last) Guest's IDTR. */
    159159    VBOXIDTR        GuestIdtr;
     
    163163
    164164    /** Checked trap & interrupt handler array */
    165     RTGCPTR32      aGuestTrapHandler[256];
     165    RCPTRTYPE(void *) aGuestTrapHandler[256];
    166166
    167167    /** GC: The number of times writes to the Guest IDT were detected. */
  • trunk/src/VBox/VMM/TRPMInternal.mac

    r9212 r9223  
    5252    .aIdt               resd 512
    5353    .au32IdtPatched     resd 8
    54     .aTmpTrapHandlers   RTGCPTR32_RES 256
     54    .aTmpTrapHandlers   RTRCPTR_RES 256
    5555
    56     .GCPtrIdt           RTGCPTR32_RES 1
     56    .GCPtrIdt           RTRCPTR_RES 1
    5757    .GuestIdtr          resb 6
    5858    .au8Padding         resb 2
    5959
    60     .aGuestTrapHandler  resd 256
     60    .aGuestTrapHandler  RTRCPTR_RES 256
    6161
    6262    .StatGCWriteGuestIDTFault  resb STAMCOUNTER_size
  • trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp

    r9212 r9223  
    694694                        STAM_PROFILE_ADV_STOP(&pVM->trpm.s.aStatGCTraps[iOrgTrap], o);
    695695
    696                     CPUMGCCallGuestTrapHandler(pRegFrame, GuestIdte.Gen.u16SegSel | 1, pVM->trpm.s.aGuestTrapHandler[iGate], eflags.u32, ss_r0, (RTGCPTR32)esp_r0);
     696                    CPUMGCCallGuestTrapHandler(pRegFrame, GuestIdte.Gen.u16SegSel | 1, pVM->trpm.s.aGuestTrapHandler[iGate], eflags.u32, ss_r0, (RTRCPTR)esp_r0);
    697697                    /* does not return */
    698698#else
  • trunk/src/VBox/VMM/VMMGC/TRPMGC.cpp

    r9212 r9223  
    6969     * Install handler.
    7070     */
    71     pVM->trpm.s.aTmpTrapHandlers[iTrap] = (RTGCPTR32)(RTGCUINTPTR)pfnHandler;
     71    pVM->trpm.s.aTmpTrapHandlers[iTrap] = (RTRCPTR)pfnHandler;
    7272    return VINF_SUCCESS;
    7373}
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