VirtualBox

Changeset 9380 in vbox for trunk/src/VBox/VMM/CPUM.cpp


Ignore:
Timestamp:
Jun 4, 2008 11:44:45 AM (17 years ago)
Author:
vboxsync
Message:

Wrote a quick summary of CPUM for doxygen. Use UTINTxx_C(). Adjusted some spaces and comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/CPUM.cpp

    r9354 r9380  
    11/* $Id$ */
    22/** @file
    3  * CPUM - CPU Monitor(/Manager)
     3 * CPUM - CPU Monitor / Manager.
    44 */
    55
     
    2020 */
    2121
     22/** @page pg_cpum
     23 * The CPU Monitor / Manager keeps track of all the CPU registers. It is
     24 * also responsible for lazy FPU handling and some of the context loading
     25 * in raw mode.
     26 *
     27 * There are three CPU contexts, the most important one is the guest one (GC).
     28 * When running in raw-mode (RC) there is a special hyper context for the VMM
     29 * that floats around inside the guest address space. When running in raw-mode
     30 * or when using 64-bit guests on a 32-bit host, CPUM also maintains a host
     31 * context for saving and restoring registers accross world switches. This latter
     32 * is done in cooperation with the world switcher (@see pg_vmm).
     33 */
    2234
    2335/*******************************************************************************
     
    5870
    5971/**
    60  * What kind of cpu info dump to performe.
     72 * What kind of cpu info dump to perform.
    6173 */
    6274typedef enum CPUMDUMPTYPE
     
    6678    CPUMDUMPTYPE_VERBOSE
    6779
    68 } CPUMDUMPTYPE, *PCPUMDUMPTYPE;
     80} CPUMDUMPTYPE;
     81/** Pointer to a cpu info dump type. */
     82typedef CPUMDUMPTYPE *PCPUMDUMPTYPE;
    6983
    7084
     
    7387*******************************************************************************/
    7488static int cpumR3CpuIdInit(PVM pVM);
    75 static DECLCALLBACK(int) cpumR3Save(PVM pVM, PSSMHANDLE pSSM);
    76 static DECLCALLBACK(int) cpumR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t u32Version);
     89static DECLCALLBACK(int)  cpumR3Save(PVM pVM, PSSMHANDLE pSSM);
     90static DECLCALLBACK(int)  cpumR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t u32Version);
    7791static DECLCALLBACK(void) cpumR3InfoAll(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    7892static DECLCALLBACK(void) cpumR3InfoGuest(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
     
    147161    /* Bogus on AMD? */
    148162    if (!pVM->cpum.s.CPUFeatures.edx.u1SEP)
    149     {
    150163        Log(("The CPU doesn't support SYSENTER/SYSEXIT!\n"));
    151     }
    152164
    153165    /*
     
    171183        &&  uECX == X86_CPUID_VENDOR_AMD_ECX
    172184        &&  uEDX == X86_CPUID_VENDOR_AMD_EDX)
    173     {
    174185        pVM->cpum.s.enmCPUVendor = CPUMCPUVENDOR_AMD;
    175     }
    176186    else if (    uEAX >= 1
    177                 &&  uEBX == X86_CPUID_VENDOR_INTEL_EBX
    178                 &&  uECX == X86_CPUID_VENDOR_INTEL_ECX
    179                 &&  uEDX == X86_CPUID_VENDOR_INTEL_EDX)
    180     {
     187             &&  uEBX == X86_CPUID_VENDOR_INTEL_EBX
     188             &&  uECX == X86_CPUID_VENDOR_INTEL_ECX
     189             &&  uEDX == X86_CPUID_VENDOR_INTEL_EDX)
    181190        pVM->cpum.s.enmCPUVendor = CPUMCPUVENDOR_INTEL;
    182     }
    183     else /* @todo Via */
     191    else /** @todo Via */
    184192        pVM->cpum.s.enmCPUVendor = CPUMCPUVENDOR_UNKNOWN;
    185193
     
    502510CPUMR3DECL(int) CPUMR3Term(PVM pVM)
    503511{
    504     /** @todo */
     512    /** @todo ? */
    505513    return 0;
    506514}
     
    530538
    531539    pCtx->cs                        = 0xf000;
    532     pCtx->csHid.u32Base             = 0xffff0000;
     540    pCtx->csHid.u32Base             = UINT32_C(0xffff0000);
    533541    pCtx->csHid.u32Limit            = 0x0000ffff;
    534542    pCtx->csHid.Attr.n.u1DescType   = 1; /* code/data segment */
     
    572580    pCtx->trHid.Attr.n.u4Type       = X86_SEL_TYPE_SYS_286_TSS_BUSY;
    573581
    574     pCtx->dr6                       = 0xFFFF0FF0;
     582    pCtx->dr6                       = UINT32_C(0xFFFF0FF0);
    575583    pCtx->dr7                       = 0x400;
    576584
     
    579587
    580588    /* Init PAT MSR */
    581     pCtx->msrPAT                    = 0x0007040600070406ULL; /* @todo correct? */
    582 }
    583 
     589    pCtx->msrPAT                    = UINT64_C(0x0007040600070406); /** @todo correct? */
     590}
    584591
    585592
     
    10341041#endif
    10351042}
     1043
    10361044
    10371045/**
     
    18691877}
    18701878
    1871 
    18721879#ifdef DEBUG
     1880
    18731881/**
    18741882 * Disassemble an instruction and dump it to the log
     
    19111919}
    19121920
    1913 #endif
     1921#endif /* DEBUG */
    19141922
    19151923#ifdef DEBUG
     
    19231931    pVM->cpum.s.GuestEntry = pVM->cpum.s.Guest;
    19241932}
    1925 #endif
     1933#endif /* DEBUG */
    19261934
    19271935
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