VirtualBox

Changeset 1938 in vbox for trunk


Ignore:
Timestamp:
Apr 4, 2007 3:25:07 PM (18 years ago)
Author:
vboxsync
Message:

Added DISFetchRegSegEx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/DisasmCore.cpp

    r1935 r1938  
    235235};
    236236
     237static unsigned g_aRegHidSegIndex[] =
     238{
     239    RT_OFFSETOF(CPUMCTXCORE, esHid),         /* USE_REG_ES */
     240    RT_OFFSETOF(CPUMCTXCORE, csHid),         /* USE_REG_CS */
     241    RT_OFFSETOF(CPUMCTXCORE, ssHid),         /* USE_REG_SS */
     242    RT_OFFSETOF(CPUMCTXCORE, dsHid),         /* USE_REG_DS */
     243    RT_OFFSETOF(CPUMCTXCORE, fsHid),         /* USE_REG_FS */
     244    RT_OFFSETOF(CPUMCTXCORE, gsHid)          /* USE_REG_GS */
     245};
     246
    237247/**
    238248 * Macro for accessing segment registers in CPUMCTXCORE structure.
     
    565575
    566576/**
     577 * Returns the value of the specified segment register including a pointer to the hidden register in the supplied cpu context
     578 *
     579 */
     580DISDECL(int) DISFetchRegSegEx(PCPUMCTXCORE pCtx, uint32_t sel, RTSEL *pVal, CPUMSELREGHID **ppSelHidReg)
     581{
     582    AssertReturn(sel < ELEMENTS(g_aRegSegIndex), VERR_INVALID_PARAMETER);
     583
     584    AssertCompile(sizeof(uint16_t) == sizeof(RTSEL));
     585    *pVal = DIS_READ_REGSEG(pCtx, sel);
     586    *ppSelHidReg = (CPUMSELREGHID *)((char *)pCtx + g_aRegHidSegIndex[sel]);
     587    return VINF_SUCCESS;
     588}
     589
     590/**
    567591 * Updates the value of the specified 32 bits general purpose register
    568592 *
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