cpum.h revision 5688240acd49e283aa46a0a19932a553192050ee
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * CPUM - CPU Monitor(/ Manager).
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * available from http://www.virtualbox.org. This file is free software;
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * you can redistribute it and/or modify it under the terms of the GNU
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * General Public License (GPL) as published by the Free Software
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * The contents of this file may alternatively be used under the terms
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * of the Common Development and Distribution License Version 1.0
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * VirtualBox OSE distribution, in which case the provisions of the
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * CDDL are applicable instead of those of the GPL.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * You may elect to license modified versions of this file under the
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * terms and conditions of either the GPL or the CDDL or both.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * additional information or have any questions.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync/** @defgroup grp_cpum The CPU Monitor(/Manager) API
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * Selector hidden registers.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync /** Base register.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * Long mode remarks:
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * - Unused in long mode for CS, DS, ES, SS
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * - 32 bits for FS & GS; FS(GS)_BASE msr used for the base address
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * - 64 bits for TR & LDTR
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync /** Limit (expanded). */
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * This is the high 32-bit word of the descriptor entry.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * Only the flags, dpl and type are used. */
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * The sysenter register set.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsynctypedef struct CPUMSYSENTER
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync /** Ring 0 cs.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * This value + 8 is the Ring 0 ss.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * This value + 16 is the Ring 3 cs.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * This value + 24 is the Ring 3 ss.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync /** Ring 0 eip. */
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync /** Ring 0 esp. */
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsync * CPU context core.
395cc0446583ac5a00c8f4a2f0a64ab009e8d636vboxsynctypedef struct CPUMCTXCORE
/* Note: lss esp, [] in the switcher needs some space, so we reserve it here instead of relying on the exact esp & ss layout as before. */
} CPUMCTXCORE;
#pragma pack()
typedef struct CPUMCTX
/* Note: lss esp, [] in the switcher needs some space, so we reserve it here instead of relying on the exact esp & ss layout as before (prevented us from using a union with rsp). */
} CPUMCTX;
#pragma pack()
typedef struct CPUMCPUID
} CPUMCPUID;
typedef enum CPUMCPUIDFEATURE
typedef enum CPUMCPUVENDOR
CPUMDECL(void) CPUMGetGuestCpuId(PVM pVM, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx);
typedef enum CPUMMODE
CPUMMODE_INVALID = 0,
} CPUMMODE;
#ifdef IN_RING3
#ifdef DEBUG
#ifdef IN_GC
DECLASM(void) CPUMGCCallGuestTrapHandler(PCPUMCTXCORE pRegFrame, uint32_t selCS, RTRCPTR pHandler, uint32_t eflags, uint32_t selSS, RTRCPTR pEsp);
#ifdef IN_RING0