VirtualBox

Changeset 9228 in vbox for trunk/include


Ignore:
Timestamp:
May 29, 2008 3:23:15 PM (17 years ago)
Author:
vboxsync
Message:

More updates for 64 bits guest pointers. Introduced AVLOU32TREE.

Location:
trunk/include
Files:
3 edited

Legend:

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

    r9220 r9228  
    9595    uint32_t  fPIF;
    9696    /* PATM inhibit irq address (used by sti) */
    97     RTGCPTR32   GCPtrInhibitInterrupts;
     97    RTRCPTR   GCPtrInhibitInterrupts;
    9898
    9999    /* Scratch room for call patch */
    100     RTGCPTR32   GCCallPatchTargetAddr;
    101     RTGCPTR32   GCCallReturnAddr;
     100    RTRCPTR   GCCallPatchTargetAddr;
     101    RTRCPTR   GCCallReturnAddr;
    102102
    103103    /* Temporary storage for guest registers. */
     
    116116{
    117117    // pointer to original guest code instruction (for emulation)
    118     RTGCPTR32 pNewEIP;
     118    RTRCPTR pNewEIP;
    119119    // pointer to the next guest code instruction
    120     RTGCPTR32 pNextInstr;
     120    RTRCPTR pNextInstr;
    121121    //pointer to the corresponding next instruction in the patch block
    122     RTGCPTR32 pNextPatchInstr;
     122    RTRCPTR pNextPatchInstr;
    123123} PATMTRAPREC, *PPATMTRAPREC;
    124124
     
    195195 * @param   pAddr       Guest context address
    196196 */
    197 PATMDECL(bool) PATMIsPatchGCAddr(PVM pVM, RTGCPTR32 pAddr);
     197PATMDECL(bool) PATMIsPatchGCAddr(PVM pVM, RTRCPTR pAddr);
    198198
    199199/**
     
    203203 * @param   pAddrGC     Guest context address
    204204 */
    205 PATMDECL(bool) PATMShouldUseRawMode(PVM pVM, RTGCPTR32 pAddrGC);
     205PATMDECL(bool) PATMShouldUseRawMode(PVM pVM, RTRCPTR pAddrGC);
    206206
    207207/**
     
    221221 * @param   pCachedData     GC pointer to cached data
    222222 */
    223 PATMDECL(int) PATMSetMMIOPatchInfo(PVM pVM, RTGCPHYS GCPhys, RTGCPTR32 pCachedData);
     223PATMDECL(int) PATMSetMMIOPatchInfo(PVM pVM, RTGCPHYS GCPhys, RTRCPTR pCachedData);
    224224
    225225
     
    233233 * @param   pRelBranchPatch     Relative duplicated function address
    234234 */
    235 PATMDECL(int) PATMAddBranchToLookupCache(PVM pVM, RTGCPTR32 pJumpTableGC, RTGCPTR32 pBranchTarget, RTGCUINTPTR pRelBranchPatch);
     235PATMDECL(int) PATMAddBranchToLookupCache(PVM pVM, RTRCPTR pJumpTableGC, RTRCPTR pBranchTarget, RTGCUINTPTR pRelBranchPatch);
    236236
    237237
     
    256256 * @param   pSize       Original instruction size (out, optional)
    257257 */
    258 PATMDECL(bool) PATMIsInt3Patch(PVM pVM, RTGCPTR32 pInstrGC, uint32_t *pOpcode, uint32_t *pSize);
     258PATMDECL(bool) PATMIsInt3Patch(PVM pVM, RTRCPTR pInstrGC, uint32_t *pOpcode, uint32_t *pSize);
    259259
    260260
     
    310310 *
    311311 */
    312 PATMGCDECL(int) PATMGCHandleWriteToPatchPage(PVM pVM, PCPUMCTXCORE pRegFrame, RTGCPTR32 GCPtr, uint32_t cbWrite);
     312PATMGCDECL(int) PATMGCHandleWriteToPatchPage(PVM pVM, PCPUMCTXCORE pRegFrame, RTRCPTR GCPtr, uint32_t cbWrite);
    313313
    314314/**
     
    402402 * @param   pcb         Size of the patch memory block
    403403 */
    404 PATMR3DECL(RTGCPTR32) PATMR3QueryPatchMemGC(PVM pVM, uint32_t *pcb);
     404PATMR3DECL(RTRCPTR) PATMR3QueryPatchMemGC(PVM pVM, uint32_t *pcb);
    405405
    406406/**
     
    412412 * @param   pPatchAddr  Guest context patch address (if true)
    413413 */
    414 PATMR3DECL(bool) PATMR3IsInsidePatchJump(PVM pVM, RTGCPTR32 pAddr, PRTGCPTR32 pPatchAddr);
     414PATMR3DECL(bool) PATMR3IsInsidePatchJump(PVM pVM, RTRCPTR pAddr, PRTGCPTR32 pPatchAddr);
    415415
    416416
     
    422422 * @param   pAddrGC     Guest context address
    423423 */
    424 PATMR3DECL(RTGCPTR32) PATMR3QueryPatchGCPtr(PVM pVM, RTGCPTR32 pAddrGC);
     424PATMR3DECL(RTRCPTR) PATMR3QueryPatchGCPtr(PVM pVM, RTRCPTR pAddrGC);
    425425
    426426/**
     
    440440 * @param   pAddrGC     GC pointer
    441441 */
    442 PATMR3DECL(R3PTRTYPE(void *)) PATMR3GCPtrToHCPtr(PVM pVM, RTGCPTR32 pAddrGC);
     442PATMR3DECL(R3PTRTYPE(void *)) PATMR3GCPtrToHCPtr(PVM pVM, RTRCPTR pAddrGC);
    443443
    444444
     
    460460 * @param   pNewEip     GC pointer to new instruction
    461461 */
    462 PATMR3DECL(int) PATMR3HandleTrap(PVM pVM, PCPUMCTX pCtx, RTGCPTR32 pEip, RTGCPTR *ppNewEip);
     462PATMR3DECL(int) PATMR3HandleTrap(PVM pVM, PCPUMCTX pCtx, RTRCPTR pEip, RTGCPTR *ppNewEip);
    463463
    464464/**
     
    479479 *
    480480 */
    481 PATMR3DECL(int) PATMR3PatchWrite(PVM pVM, RTGCPTR32 GCPtr, uint32_t cbWrite);
     481PATMR3DECL(int) PATMR3PatchWrite(PVM pVM, RTRCPTR GCPtr, uint32_t cbWrite);
    482482
    483483/**
     
    488488 * @param   addr        GC address of the page to flush
    489489 */
    490 PATMR3DECL(int) PATMR3FlushPage(PVM pVM, RTGCPTR32 addr);
     490PATMR3DECL(int) PATMR3FlushPage(PVM pVM, RTRCPTR addr);
    491491
    492492/**
     
    509509 * @note    returns failure if patching is not allowed or possible
    510510 */
    511 PATMR3DECL(int) PATMR3InstallPatch(PVM pVM, RTGCPTR32 pInstrGC, uint64_t flags);
     511PATMR3DECL(int) PATMR3InstallPatch(PVM pVM, RTRCPTR pInstrGC, uint64_t flags);
    512512
    513513/**
     
    519519 * @param   flags       Patch flags
    520520 */
    521 PATMR3DECL(int) PATMR3AddHint(PVM pVM, RTGCPTR32 pInstrGC, uint32_t flags);
     521PATMR3DECL(int) PATMR3AddHint(PVM pVM, RTRCPTR pInstrGC, uint32_t flags);
    522522
    523523/**
     
    541541 *
    542542 */
    543 PATMR3DECL(RTGCPTR32) PATMR3PatchToGCPtr(PVM pVM, RTGCPTR32 pPatchGC, PATMTRANSSTATE *pEnmState);
     543PATMR3DECL(RTRCPTR) PATMR3PatchToGCPtr(PVM pVM, RTRCPTR pPatchGC, PATMTRANSSTATE *pEnmState);
    544544
    545545/**
     
    551551 *
    552552 */
    553 PATMR3DECL(RTGCPTR32) PATMR3GuestGCPtrToPatchGCPtr(PVM pVM, RCPTRTYPE(uint8_t*) pInstrGC);
     553PATMR3DECL(RTRCPTR) PATMR3GuestGCPtrToPatchGCPtr(PVM pVM, RCPTRTYPE(uint8_t*) pInstrGC);
    554554
    555555/**
     
    563563 *
    564564 */
    565 PATMR3DECL(int) PATMR3QueryOpcode(PVM pVM, RTGCPTR32 pInstrGC, uint8_t *pByte);
     565PATMR3DECL(int) PATMR3QueryOpcode(PVM pVM, RTRCPTR pInstrGC, uint8_t *pByte);
    566566
    567567/**
     
    575575 *
    576576 */
    577 PATMR3DECL(int) PATMR3DisablePatch(PVM pVM, RTGCPTR32 pInstrGC);
     577PATMR3DECL(int) PATMR3DisablePatch(PVM pVM, RTRCPTR pInstrGC);
    578578
    579579
     
    588588 *
    589589 */
    590 PATMR3DECL(int) PATMR3EnablePatch(PVM pVM, RTGCPTR32 pInstrGC);
     590PATMR3DECL(int) PATMR3EnablePatch(PVM pVM, RTRCPTR pInstrGC);
    591591
    592592
     
    601601 *
    602602 */
    603 PATMR3DECL(int) PATMR3RemovePatch(PVM pVM, RTGCPTR32 pInstrGC);
     603PATMR3DECL(int) PATMR3RemovePatch(PVM pVM, RTRCPTR pInstrGC);
    604604
    605605
     
    612612 * @param   pConflictGC Guest context pointer to check
    613613 */
    614 PATMR3DECL(int) PATMR3DetectConflict(PVM pVM, RTGCPTR32 pInstrGC, RTGCPTR32 pConflictGC);
     614PATMR3DECL(int) PATMR3DetectConflict(PVM pVM, RTRCPTR pInstrGC, RTRCPTR pConflictGC);
    615615
    616616
     
    622622 * @param   pInstrGC    Guest context pointer to instruction
    623623 */
    624 PATMR3DECL(bool) PATMR3HasBeenPatched(PVM pVM, RTGCPTR32 pInstrGC);
     624PATMR3DECL(bool) PATMR3HasBeenPatched(PVM pVM, RTRCPTR pInstrGC);
    625625
    626626
     
    634634 *
    635635 */
    636 PATMR3DECL(int) PATMInstallSpinlockPatch(PVM pVM, RTGCPTR32 pCallAcquireSpinlockGC, uint32_t cbAcquireSpinlockCall);
     636PATMR3DECL(int) PATMInstallSpinlockPatch(PVM pVM, RTRCPTR pCallAcquireSpinlockGC, uint32_t cbAcquireSpinlockCall);
    637637
    638638
     
    645645 *
    646646 */
    647 PATMR3DECL(bool) PATMIsSpinlockAcquire(PVM pVM, RTGCPTR32 pCallTargetGC);
     647PATMR3DECL(bool) PATMIsSpinlockAcquire(PVM pVM, RTRCPTR pCallTargetGC);
    648648
    649649/**
     
    655655 *
    656656 */
    657 PATMR3DECL(bool) PATMIsSpinlockRelease(PVM pVM, RTGCPTR32 pCallTargetGC);
     657PATMR3DECL(bool) PATMIsSpinlockRelease(PVM pVM, RTRCPTR pCallTargetGC);
    658658
    659659/**
     
    665665 *
    666666 */
    667 PATMR3DECL(bool) PATMIsSpinlockReleasePatch(PVM pVM, RTGCPTR32 pCallTargetGC);
     667PATMR3DECL(bool) PATMIsSpinlockReleasePatch(PVM pVM, RTRCPTR pCallTargetGC);
    668668
    669669/** @} */
  • trunk/include/iprt/avl.h

    r8245 r9228  
    162162/** @} */
    163163
     164/**
     165 * AVL uint32_t type for the relative offset pointer scheme.
     166 */
     167typedef int32_t     AVLOU32;
     168
     169typedef uint32_t     AVLOU32KEY;
     170
     171/**
     172 * AVL Core node.
     173 */
     174typedef struct _AVLOU32NodeCore
     175{
     176    /** Key value. */
     177    AVLOU32KEY          Key;
     178    /** Offset to the left leaf node, relative to this field. */
     179    AVLOU32             pLeft;
     180    /** Offset to the right leaf node, relative to this field. */
     181    AVLOU32             pRight;
     182    /** Height of this tree: max(height(left), height(right)) + 1 */
     183    unsigned char       uchHeight;
     184} AVLOU32NODECORE, *PAVLOU32NODECORE;
     185
     186/** A offset base tree with uint32_t keys. */
     187typedef AVLOU32         AVLOU32TREE;
     188/** Pointer to a offset base tree with uint32_t keys. */
     189typedef AVLOU32TREE    *PAVLOU32TREE;
     190
     191/** Pointer to an internal tree pointer.
     192 * In this case it's a pointer to a relative offset. */
     193typedef AVLOU32TREE    *PPAVLOU32NODECORE;
     194
     195/** Callback function for RTAvloU32DoWithAll(). */
     196typedef DECLCALLBACK(int)   AVLOU32CALLBACK(PAVLOU32NODECORE pNode, void *pvUser);
     197/** Pointer to callback function for RTAvloU32DoWithAll(). */
     198typedef AVLOU32CALLBACK *PAVLOU32CALLBACK;
     199
     200RTDECL(bool)                  RTAvloU32Insert(PAVLOU32TREE pTree, PAVLOU32NODECORE pNode);
     201RTDECL(PAVLOU32NODECORE)      RTAvloU32Remove(PAVLOU32TREE pTree, AVLOU32KEY Key);
     202RTDECL(PAVLOU32NODECORE)      RTAvloU32Get(PAVLOU32TREE pTree, AVLOU32KEY Key);
     203RTDECL(int)                   RTAvloU32DoWithAll(PAVLOU32TREE pTree, int fFromLeft, PAVLOU32CALLBACK pfnCallBack, void *pvParam);
     204RTDECL(PAVLOU32NODECORE)      RTAvloU32GetBestFit(PAVLOU32TREE ppTree, AVLOU32KEY Key, bool fAbove);
     205RTDECL(PAVLOU32NODECORE)      RTAvloU32RemoveBestFit(PAVLOU32TREE ppTree, AVLOU32KEY Key, bool fAbove);
     206RTDECL(int)                   RTAvloU32Destroy(PAVLOU32TREE pTree, PAVLOU32CALLBACK pfnCallBack, void *pvParam);
     207
     208/** @} */
    164209
    165210
  • trunk/include/iprt/types.h

    r9223 r9228  
    913913 */
    914914#define NIL_RTRCPTR    ((RTRCPTR)0)
     915
     916typedef int32_t       RTRCINTPTR;
     917typedef uint32_t      RTRCUINTPTR;
     918
    915919/** @} */
    916920
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