VirtualBox

Changeset 26855 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Feb 26, 2010 2:30:43 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
58133
Message:

Introduced EMInterpretInstructionCPUEx to allow user-level instruction emulation.

File:
1 edited

Legend:

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

    r25816 r26855  
    8282} EMSTATE;
    8383
     84
     85/**
     86 * EMInterpretInstructionCPUEx execution modes.
     87 */
     88typedef enum
     89{
     90    /** Only supervisor code (CPL=0). */
     91    EMCODETYPE_SUPERVISOR,
     92    /** User-level code only. */
     93    EMCODETYPE_USER,
     94    /** Supervisor and user-level code (use with great care!). */
     95    EMCODETYPE_ALL,
     96    /** Just a hack to ensure that we get a 32-bit integer. */
     97    EMCODETYPE_32BIT_HACK = 0x7fffffff
     98} EMCODETYPE;
     99
    84100VMMDECL(EMSTATE) EMGetState(PVMCPU pVCpu);
    85101VMMDECL(void)    EMSetState(PVMCPU pVCpu, EMSTATE enmNewState);
     
    126142                                          PDISCPUSTATE pDISState, unsigned *pcbInstr);
    127143VMMDECL(int)        EMInterpretInstruction(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize);
    128 VMMDECL(int)        EMInterpretInstructionCPU(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDISState, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize);
     144VMMDECL(int)        EMInterpretInstructionCPUEx(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDISState, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize, EMCODETYPE enmCodeType);
    129145VMMDECL(int)        EMInterpretCpuId(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
    130146VMMDECL(int)        EMInterpretRdtsc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
     
    143159VMMDECL(int)        EMInterpretRdmsr(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
    144160VMMDECL(int)        EMInterpretWrmsr(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
     161
     162/* Wrap EMInterpretInstructionCPUEx for supervisor code only interpretation.
     163 */
     164inline int EMInterpretInstructionCPU(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDISState, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize)
     165{
     166    return EMInterpretInstructionCPUEx(pVM, pVCpu, pDISState, pRegFrame, pvFault, pcbSize, EMCODETYPE_SUPERVISOR);
     167}
    145168
    146169/** @name Assembly routines
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