VirtualBox

Changeset 12579 in vbox for trunk/include


Ignore:
Timestamp:
Sep 18, 2008 3:58:14 PM (16 years ago)
Author:
vboxsync
Message:

VMM: Outlined the per CPU data.

File:
1 edited

Legend:

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

    r12545 r12579  
    4242 * @{
    4343 */
     44
     45
     46/**
     47 * The state of a virtual CPU.
     48 *
     49 * The VM running states are a sub-states of the VMSTATE_RUNNING state. While
     50 * VMCPUSTATE_NOT_RUNNING is a place holder for the other VM states.
     51 */
     52typedef enum VMCPUSTATE
     53{
     54    /** The customary invalid zero. */
     55    VMCPUSTATE_INVALID = 0,
     56
     57    /** Running guest code (VM running). */
     58    VMCPUSTATE_RUN_EXEC,
     59    /** Running guest code in the recompiler (VM running). */
     60    VMCPUSTATE_RUN_EXEC_REM,
     61    /** Halted (VM running). */
     62    VMCPUSTATE_RUN_HALTED,
     63    /** All the other bits we do while running a VM (VM running). */
     64    VMCPUSTATE_RUN_MISC,
     65    /** VM not running, we're servicing requests or whatever. */
     66    VMCPUSTATE_NOT_RUNNING,
     67    /** The end of valid virtual CPU states. */
     68    VMCPUSTATE_END,
     69
     70    /** Ensure 32-bit type. */
     71    VMCPUSTATE_32BIT_HACK = 0x7fffffff
     72} VMCPUSTATE;
     73
     74
     75/**
     76 * Per virtual CPU data.
     77 */
     78typedef struct VMCPU
     79{
     80    /** Per CPU forced action.
     81     * See the VMCPU_FF_* \#defines. Updated atomically. */
     82    uint32_t volatile   fForcedActions;
     83    /** The CPU state. */
     84    VMCPUSTATE volatile enmState;
     85
     86    /** Ring-3 Host Context VM Pointer. */
     87    PVMR3               pVMR3;
     88    /** Ring-0 Host Context VM Pointer. */
     89    PVMR0               pVMR0;
     90    /** Raw-mode Context VM Pointer. */
     91    PVMRC               pVMRC;
     92    /** The CPU ID.
     93     * This is the index into the VM::aCpus array. */
     94    uint32_t            idCpu;
     95    /** The ring-3 thread handle of the emulation thread for this CPU.
     96     * @todo Use the VM_IS_EMT() macro to check if executing in EMT? */
     97    RTTHREAD            hThreadR3;
     98    /** The native ring-3 handle. */
     99    RTNATIVETHREAD      hNativeThreadR3;
     100    /** The native ring-0 handle. */
     101    RTNATIVETHREAD      hNativeThreadR0;
     102
     103    /** Align the next bit on a 64-byte boundrary. */
     104    uint32_t            au32Alignment[HC_ARCH_BITS == 32 ? 7 : 2];
     105
     106    /** CPUM part. */
     107    union
     108    {
     109#if 0 /*def ___CPUMInternal_h */
     110        struct VMCPUCPUM    s;
     111#endif
     112        char                padding[64];
     113    } cpum;
     114} VMCPU;
     115
    44116
    45117/** The name of the Guest Context VMM Core module. */
     
    562634#endif
    563635    } rem;
     636
     637#if HC_ARCH_BITS == 64
     638    /** Padding for aligning the cpu array on a 64 byte boundrary. */
     639    uint32_t u32Reserved2[HC_ARCH_BITS == 32 ? 0 : 8];
     640#endif
     641
     642    /**
     643     * Per virtual CPU state.
     644     */
     645    VMCPU aCpus[1];
    564646} VM;
    565647
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