2007-07-17 22:29:40 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 The Hewlett-Packard Development Company
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use of this software in source and binary forms,
|
|
|
|
* with or without modification, are permitted provided that the
|
|
|
|
* following conditions are met:
|
|
|
|
*
|
|
|
|
* The software must be used only for Non-Commercial Use which means any
|
|
|
|
* use which is NOT directed to receiving any direct monetary
|
|
|
|
* compensation for, or commercial advantage from such use. Illustrative
|
|
|
|
* examples of non-commercial use are academic research, personal study,
|
|
|
|
* teaching, education and corporate research & development.
|
|
|
|
* Illustrative examples of commercial use are distributing products for
|
|
|
|
* commercial advantage and providing services using the software for
|
|
|
|
* commercial advantage.
|
|
|
|
*
|
|
|
|
* If you wish to use this software or functionality therein that may be
|
|
|
|
* covered by patents for commercial use, please contact:
|
|
|
|
* Director of Intellectual Property Licensing
|
|
|
|
* Office of Strategy and Technology
|
|
|
|
* Hewlett-Packard Company
|
|
|
|
* 1501 Page Mill Road
|
|
|
|
* Palo Alto, California 94304
|
|
|
|
*
|
|
|
|
* Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer. Redistributions
|
|
|
|
* in binary form must reproduce the above copyright notice, this list of
|
|
|
|
* conditions and the following disclaimer in the documentation and/or
|
|
|
|
* other materials provided with the distribution. Neither the name of
|
|
|
|
* the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived from
|
|
|
|
* this software without specific prior written permission. No right of
|
|
|
|
* sublicense is granted herewith. Derivatives of the software and
|
|
|
|
* output created using the software may be prepared, but only for
|
|
|
|
* Non-Commercial Uses. Derivatives of the software may be shared with
|
|
|
|
* others provided: (i) the others agree to abide by the list of
|
|
|
|
* conditions herein which includes the Non-Commercial Use restrictions;
|
|
|
|
* and (ii) such Derivatives of the software include the above copyright
|
|
|
|
* notice to acknowledge the contribution from this software where
|
|
|
|
* applicable, this list of conditions and the disclaimer below.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* Authors: Gabe Black
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ARCH_X86_MISCREGS_HH__
|
|
|
|
#define __ARCH_X86_MISCREGS_HH__
|
|
|
|
|
2007-12-02 08:03:39 +01:00
|
|
|
#include "arch/x86/segmentregs.hh"
|
2007-08-30 05:34:52 +02:00
|
|
|
#include "arch/x86/x86_traits.hh"
|
2007-07-17 22:29:40 +02:00
|
|
|
#include "base/bitunion.hh"
|
|
|
|
|
2007-09-25 02:39:56 +02:00
|
|
|
//These get defined in some system headers (at least termbits.h). That confuses
|
|
|
|
//things here significantly.
|
|
|
|
#undef CR0
|
|
|
|
#undef CR2
|
|
|
|
#undef CR3
|
|
|
|
|
2007-07-17 22:29:40 +02:00
|
|
|
namespace X86ISA
|
|
|
|
{
|
|
|
|
enum CondFlagBit {
|
|
|
|
CFBit = 1 << 0,
|
|
|
|
PFBit = 1 << 2,
|
|
|
|
ECFBit = 1 << 3,
|
|
|
|
AFBit = 1 << 4,
|
|
|
|
EZFBit = 1 << 5,
|
|
|
|
ZFBit = 1 << 6,
|
|
|
|
SFBit = 1 << 7,
|
2007-08-05 05:24:18 +02:00
|
|
|
DFBit = 1 << 10,
|
2007-07-17 22:29:40 +02:00
|
|
|
OFBit = 1 << 11
|
|
|
|
};
|
|
|
|
|
2007-07-19 01:12:39 +02:00
|
|
|
enum MiscRegIndex
|
|
|
|
{
|
|
|
|
// Control registers
|
|
|
|
// Most of these are invalid.
|
2007-08-05 05:07:42 +02:00
|
|
|
MISCREG_CR_BASE,
|
|
|
|
MISCREG_CR0 = MISCREG_CR_BASE,
|
2007-07-19 01:12:39 +02:00
|
|
|
MISCREG_CR1,
|
|
|
|
MISCREG_CR2,
|
|
|
|
MISCREG_CR3,
|
|
|
|
MISCREG_CR4,
|
|
|
|
MISCREG_CR5,
|
|
|
|
MISCREG_CR6,
|
|
|
|
MISCREG_CR7,
|
|
|
|
MISCREG_CR8,
|
|
|
|
MISCREG_CR9,
|
|
|
|
MISCREG_CR10,
|
|
|
|
MISCREG_CR11,
|
|
|
|
MISCREG_CR12,
|
|
|
|
MISCREG_CR13,
|
|
|
|
MISCREG_CR14,
|
|
|
|
MISCREG_CR15,
|
|
|
|
|
|
|
|
// Debug registers
|
2007-08-30 05:34:52 +02:00
|
|
|
MISCREG_DR_BASE = MISCREG_CR_BASE + NumCRegs,
|
2007-08-05 05:07:42 +02:00
|
|
|
MISCREG_DR0 = MISCREG_DR_BASE,
|
2007-07-19 01:12:39 +02:00
|
|
|
MISCREG_DR1,
|
|
|
|
MISCREG_DR2,
|
|
|
|
MISCREG_DR3,
|
|
|
|
MISCREG_DR4,
|
|
|
|
MISCREG_DR5,
|
|
|
|
MISCREG_DR6,
|
|
|
|
MISCREG_DR7,
|
|
|
|
|
|
|
|
// Flags register
|
2007-08-30 05:34:52 +02:00
|
|
|
MISCREG_RFLAGS = MISCREG_DR_BASE + NumDRegs,
|
2007-07-19 01:12:39 +02:00
|
|
|
|
2007-10-08 03:16:00 +02:00
|
|
|
/*
|
|
|
|
* Model Specific Registers
|
|
|
|
*/
|
|
|
|
// Time stamp counter
|
|
|
|
MISCREG_TSC,
|
|
|
|
|
|
|
|
MISCREG_MTRRCAP,
|
|
|
|
|
|
|
|
MISCREG_SYSENTER_CS,
|
|
|
|
MISCREG_SYSENTER_ESP,
|
|
|
|
MISCREG_SYSENTER_EIP,
|
|
|
|
|
|
|
|
MISCREG_MCG_CAP,
|
|
|
|
MISCREG_MCG_STATUS,
|
|
|
|
MISCREG_MCG_CTL,
|
|
|
|
|
|
|
|
MISCREG_DEBUG_CTL_MSR,
|
|
|
|
|
|
|
|
MISCREG_LAST_BRANCH_FROM_IP,
|
|
|
|
MISCREG_LAST_BRANCH_TO_IP,
|
|
|
|
MISCREG_LAST_EXCEPTION_FROM_IP,
|
|
|
|
MISCREG_LAST_EXCEPTION_TO_IP,
|
|
|
|
|
|
|
|
MISCREG_MTRR_PHYS_BASE_BASE,
|
|
|
|
MISCREG_MTRR_PHYS_BASE_0 = MISCREG_MTRR_PHYS_BASE_BASE,
|
|
|
|
MISCREG_MTRR_PHYS_BASE_1,
|
|
|
|
MISCREG_MTRR_PHYS_BASE_2,
|
|
|
|
MISCREG_MTRR_PHYS_BASE_3,
|
|
|
|
MISCREG_MTRR_PHYS_BASE_4,
|
|
|
|
MISCREG_MTRR_PHYS_BASE_5,
|
|
|
|
MISCREG_MTRR_PHYS_BASE_6,
|
|
|
|
MISCREG_MTRR_PHYS_BASE_7,
|
|
|
|
|
|
|
|
MISCREG_MTRR_PHYS_MASK_BASE,
|
|
|
|
MISCREG_MTRR_PHYS_MASK_0 = MISCREG_MTRR_PHYS_MASK_BASE,
|
|
|
|
MISCREG_MTRR_PHYS_MASK_1,
|
|
|
|
MISCREG_MTRR_PHYS_MASK_2,
|
|
|
|
MISCREG_MTRR_PHYS_MASK_3,
|
|
|
|
MISCREG_MTRR_PHYS_MASK_4,
|
|
|
|
MISCREG_MTRR_PHYS_MASK_5,
|
|
|
|
MISCREG_MTRR_PHYS_MASK_6,
|
|
|
|
MISCREG_MTRR_PHYS_MASK_7,
|
|
|
|
|
|
|
|
MISCREG_MTRR_FIX_64K_00000,
|
|
|
|
MISCREG_MTRR_FIX_16K_80000,
|
|
|
|
MISCREG_MTRR_FIX_16K_A0000,
|
|
|
|
MISCREG_MTRR_FIX_4K_C0000,
|
2007-10-13 01:37:55 +02:00
|
|
|
MISCREG_MTRR_FIX_4K_C8000,
|
2007-10-08 03:16:00 +02:00
|
|
|
MISCREG_MTRR_FIX_4K_D0000,
|
|
|
|
MISCREG_MTRR_FIX_4K_D8000,
|
|
|
|
MISCREG_MTRR_FIX_4K_E0000,
|
|
|
|
MISCREG_MTRR_FIX_4K_E8000,
|
|
|
|
MISCREG_MTRR_FIX_4K_F0000,
|
|
|
|
MISCREG_MTRR_FIX_4K_F8000,
|
|
|
|
|
|
|
|
MISCREG_PAT,
|
|
|
|
|
|
|
|
MISCREG_DEF_TYPE,
|
|
|
|
|
|
|
|
MISCREG_MC_CTL_BASE,
|
|
|
|
MISCREG_MC0_CTL = MISCREG_MC_CTL_BASE,
|
|
|
|
MISCREG_MC1_CTL,
|
|
|
|
MISCREG_MC2_CTL,
|
|
|
|
MISCREG_MC3_CTL,
|
|
|
|
MISCREG_MC4_CTL,
|
|
|
|
|
|
|
|
MISCREG_MC_STATUS_BASE,
|
|
|
|
MISCREG_MC0_STATUS = MISCREG_MC_STATUS_BASE,
|
|
|
|
MISCREG_MC1_STATUS,
|
|
|
|
MISCREG_MC2_STATUS,
|
|
|
|
MISCREG_MC3_STATUS,
|
|
|
|
MISCREG_MC4_STATUS,
|
|
|
|
|
|
|
|
MISCREG_MC_ADDR_BASE,
|
|
|
|
MISCREG_MC0_ADDR = MISCREG_MC_ADDR_BASE,
|
|
|
|
MISCREG_MC1_ADDR,
|
|
|
|
MISCREG_MC2_ADDR,
|
|
|
|
MISCREG_MC3_ADDR,
|
|
|
|
MISCREG_MC4_ADDR,
|
|
|
|
|
|
|
|
MISCREG_MC_MISC_BASE,
|
|
|
|
MISCREG_MC0_MISC = MISCREG_MC_MISC_BASE,
|
|
|
|
MISCREG_MC1_MISC,
|
|
|
|
MISCREG_MC2_MISC,
|
|
|
|
MISCREG_MC3_MISC,
|
|
|
|
MISCREG_MC4_MISC,
|
|
|
|
|
2007-10-08 03:10:42 +02:00
|
|
|
// Extended feature enable register
|
|
|
|
MISCREG_EFER,
|
|
|
|
|
2007-10-08 03:16:00 +02:00
|
|
|
MISCREG_STAR,
|
|
|
|
MISCREG_LSTAR,
|
|
|
|
MISCREG_CSTAR,
|
|
|
|
|
|
|
|
MISCREG_SF_MASK,
|
|
|
|
|
|
|
|
MISCREG_KERNEL_GS_BASE,
|
|
|
|
|
|
|
|
MISCREG_TSC_AUX,
|
|
|
|
|
|
|
|
MISCREG_PERF_EVT_SEL_BASE,
|
|
|
|
MISCREG_PERF_EVT_SEL0 = MISCREG_PERF_EVT_SEL_BASE,
|
|
|
|
MISCREG_PERF_EVT_SEL1,
|
|
|
|
MISCREG_PERF_EVT_SEL2,
|
|
|
|
MISCREG_PERF_EVT_SEL3,
|
|
|
|
|
|
|
|
MISCREG_PERF_EVT_CTR_BASE,
|
|
|
|
MISCREG_PERF_EVT_CTR0 = MISCREG_PERF_EVT_CTR_BASE,
|
|
|
|
MISCREG_PERF_EVT_CTR1,
|
|
|
|
MISCREG_PERF_EVT_CTR2,
|
|
|
|
MISCREG_PERF_EVT_CTR3,
|
|
|
|
|
|
|
|
MISCREG_SYSCFG,
|
|
|
|
|
|
|
|
MISCREG_IORR_BASE_BASE,
|
|
|
|
MISCREG_IORR_BASE0 = MISCREG_IORR_BASE_BASE,
|
|
|
|
MISCREG_IORR_BASE1,
|
|
|
|
|
|
|
|
MISCREG_IORR_MASK_BASE,
|
|
|
|
MISCREG_IORR_MASK0 = MISCREG_IORR_MASK_BASE,
|
|
|
|
MISCREG_IORR_MASK1,
|
|
|
|
|
|
|
|
MISCREG_TOP_MEM,
|
|
|
|
MISCREG_TOP_MEM2,
|
|
|
|
|
|
|
|
MISCREG_VM_CR,
|
|
|
|
MISCREG_IGNNE,
|
|
|
|
MISCREG_SMM_CTL,
|
|
|
|
MISCREG_VM_HSAVE_PA,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Segment registers
|
|
|
|
*/
|
2007-07-19 01:12:39 +02:00
|
|
|
// Segment selectors
|
2007-08-05 05:07:42 +02:00
|
|
|
MISCREG_SEG_SEL_BASE,
|
|
|
|
MISCREG_ES = MISCREG_SEG_SEL_BASE,
|
2007-07-19 01:12:39 +02:00
|
|
|
MISCREG_CS,
|
|
|
|
MISCREG_SS,
|
|
|
|
MISCREG_DS,
|
|
|
|
MISCREG_FS,
|
|
|
|
MISCREG_GS,
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_HS,
|
|
|
|
MISCREG_TSL,
|
|
|
|
MISCREG_TSG,
|
|
|
|
MISCREG_LS,
|
|
|
|
MISCREG_MS,
|
|
|
|
MISCREG_TR,
|
|
|
|
MISCREG_IDTR,
|
2007-07-19 01:12:39 +02:00
|
|
|
|
|
|
|
// Hidden segment base field
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_SEG_BASE_BASE = MISCREG_SEG_SEL_BASE + NUM_SEGMENTREGS,
|
2007-08-05 05:07:42 +02:00
|
|
|
MISCREG_ES_BASE = MISCREG_SEG_BASE_BASE,
|
2007-07-19 01:12:39 +02:00
|
|
|
MISCREG_CS_BASE,
|
|
|
|
MISCREG_SS_BASE,
|
|
|
|
MISCREG_DS_BASE,
|
|
|
|
MISCREG_FS_BASE,
|
|
|
|
MISCREG_GS_BASE,
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_HS_BASE,
|
|
|
|
MISCREG_TSL_BASE,
|
|
|
|
MISCREG_TSG_BASE,
|
|
|
|
MISCREG_LS_BASE,
|
|
|
|
MISCREG_MS_BASE,
|
|
|
|
MISCREG_TR_BASE,
|
|
|
|
MISCREG_IDTR_BASE,
|
2007-07-19 01:12:39 +02:00
|
|
|
|
2007-12-02 08:00:15 +01:00
|
|
|
// The effective segment base, ie what is actually added to an
|
|
|
|
// address. In 64 bit mode this can be different from the above,
|
|
|
|
// namely 0.
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_SEG_EFF_BASE_BASE = MISCREG_SEG_BASE_BASE + NUM_SEGMENTREGS,
|
2007-12-02 08:00:15 +01:00
|
|
|
MISCREG_ES_EFF_BASE = MISCREG_SEG_EFF_BASE_BASE,
|
|
|
|
MISCREG_CS_EFF_BASE,
|
|
|
|
MISCREG_SS_EFF_BASE,
|
|
|
|
MISCREG_DS_EFF_BASE,
|
|
|
|
MISCREG_FS_EFF_BASE,
|
|
|
|
MISCREG_GS_EFF_BASE,
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_HS_EFF_BASE,
|
|
|
|
MISCREG_TSL_EFF_BASE,
|
|
|
|
MISCREG_TSG_EFF_BASE,
|
|
|
|
MISCREG_LS_EFF_BASE,
|
|
|
|
MISCREG_MS_EFF_BASE,
|
|
|
|
MISCREG_TR_EFF_BASE,
|
|
|
|
MISCREG_IDTR_EFF_BASE,
|
2007-12-02 08:00:15 +01:00
|
|
|
|
2007-07-19 01:12:39 +02:00
|
|
|
// Hidden segment limit field
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_SEG_LIMIT_BASE = MISCREG_SEG_EFF_BASE_BASE + NUM_SEGMENTREGS,
|
2007-08-05 05:07:42 +02:00
|
|
|
MISCREG_ES_LIMIT = MISCREG_SEG_LIMIT_BASE,
|
2007-07-19 01:12:39 +02:00
|
|
|
MISCREG_CS_LIMIT,
|
|
|
|
MISCREG_SS_LIMIT,
|
|
|
|
MISCREG_DS_LIMIT,
|
|
|
|
MISCREG_FS_LIMIT,
|
|
|
|
MISCREG_GS_LIMIT,
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_HS_LIMIT,
|
|
|
|
MISCREG_TSL_LIMIT,
|
|
|
|
MISCREG_TSG_LIMIT,
|
|
|
|
MISCREG_LS_LIMIT,
|
|
|
|
MISCREG_MS_LIMIT,
|
|
|
|
MISCREG_TR_LIMIT,
|
|
|
|
MISCREG_IDTR_LIMIT,
|
2007-07-19 01:12:39 +02:00
|
|
|
|
|
|
|
// Hidden segment limit attributes
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_SEG_ATTR_BASE = MISCREG_SEG_LIMIT_BASE + NUM_SEGMENTREGS,
|
2007-08-05 05:07:42 +02:00
|
|
|
MISCREG_ES_ATTR = MISCREG_SEG_ATTR_BASE,
|
2007-07-19 01:12:39 +02:00
|
|
|
MISCREG_CS_ATTR,
|
|
|
|
MISCREG_SS_ATTR,
|
|
|
|
MISCREG_DS_ATTR,
|
|
|
|
MISCREG_FS_ATTR,
|
|
|
|
MISCREG_GS_ATTR,
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_HS_ATTR,
|
|
|
|
MISCREG_TSL_ATTR,
|
|
|
|
MISCREG_TSG_ATTR,
|
|
|
|
MISCREG_LS_ATTR,
|
|
|
|
MISCREG_MS_ATTR,
|
2007-07-19 01:12:39 +02:00
|
|
|
MISCREG_TR_ATTR,
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_IDTR_ATTR,
|
2007-07-19 01:12:39 +02:00
|
|
|
|
2007-09-20 03:26:42 +02:00
|
|
|
// Floating point control registers
|
2007-12-02 08:03:39 +01:00
|
|
|
MISCREG_X87_TOP =
|
|
|
|
MISCREG_SEG_ATTR_BASE + NUM_SEGMENTREGS,
|
2007-09-20 03:26:42 +02:00
|
|
|
|
2007-07-19 01:12:39 +02:00
|
|
|
//XXX Add "Model-Specific Registers"
|
|
|
|
|
2008-02-27 05:39:53 +01:00
|
|
|
MISCREG_APIC_BASE,
|
|
|
|
|
|
|
|
MISCREG_APIC_START,
|
|
|
|
MISCREG_APIC_ID = MISCREG_APIC_START,
|
|
|
|
MISCREG_APIC_VERSION,
|
|
|
|
MISCREG_APIC_TASK_PRIORITY,
|
|
|
|
MISCREG_APIC_ARBITRATION_PRIORITY,
|
|
|
|
MISCREG_APIC_PROCESSOR_PRIORITY,
|
|
|
|
MISCREG_APIC_EOI,
|
|
|
|
MISCREG_APIC_LOGICAL_DESTINATION,
|
|
|
|
MISCREG_APIC_DESTINATION_FORMAT,
|
|
|
|
MISCREG_APIC_SPURIOUS_INTERRUPT_VECTOR,
|
|
|
|
|
|
|
|
MISCREG_APIC_IN_SERVICE_BASE,
|
|
|
|
|
|
|
|
MISCREG_APIC_TRIGGER_MODE_BASE = MISCREG_APIC_IN_SERVICE_BASE + 16,
|
|
|
|
|
|
|
|
MISCREG_APIC_INTERRUPT_REQUEST_BASE =
|
|
|
|
MISCREG_APIC_TRIGGER_MODE_BASE + 16,
|
|
|
|
|
|
|
|
MISCREG_APIC_ERROR_STATUS = MISCREG_APIC_INTERRUPT_REQUEST_BASE + 16,
|
|
|
|
MISCREG_APIC_INTERRUPT_COMMAND_LOW,
|
|
|
|
MISCREG_APIC_INTERRUPT_COMMAND_HIGH,
|
|
|
|
MISCREG_APIC_LVT_TIMER,
|
|
|
|
MISCREG_APIC_LVT_THERMAL_SENSOR,
|
|
|
|
MISCREG_APIC_LVT_PERFORMANCE_MONITORING_COUNTERS,
|
|
|
|
MISCREG_APIC_LVT_LINT0,
|
|
|
|
MISCREG_APIC_LVT_LINT1,
|
|
|
|
MISCREG_APIC_LVT_ERROR,
|
|
|
|
MISCREG_APIC_INITIAL_COUNT,
|
|
|
|
MISCREG_APIC_CURRENT_COUNT,
|
|
|
|
MISCREG_APIC_DIVIDE_COUNT,
|
|
|
|
MISCREG_APIC_END = MISCREG_APIC_DIVIDE_COUNT,
|
|
|
|
|
|
|
|
// "Fake" MSRs for internally implemented devices
|
2008-02-27 05:38:01 +01:00
|
|
|
MISCREG_PCI_CONFIG_ADDRESS,
|
|
|
|
|
2007-09-20 03:26:42 +02:00
|
|
|
NUM_MISCREGS
|
2007-07-19 01:12:39 +02:00
|
|
|
};
|
|
|
|
|
2007-08-30 05:34:52 +02:00
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_CR(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_CR_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_DR(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_DR_BASE + index);
|
|
|
|
}
|
|
|
|
|
2007-10-08 03:16:00 +02:00
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_MTRR_PHYS_BASE(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_MTRR_PHYS_BASE_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_MTRR_PHYS_MASK(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_MTRR_PHYS_MASK_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_MC_CTL(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_MC_CTL_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_MC_STATUS(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_MC_STATUS_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_MC_ADDR(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_MC_ADDR_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_MC_MISC(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_MC_MISC_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_PERF_EVT_SEL(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_PERF_EVT_SEL_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_PERF_EVT_CTR(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_PERF_EVT_CTR_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_IORR_BASE(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_IORR_BASE_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_IORR_MASK(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_IORR_MASK_BASE + index);
|
|
|
|
}
|
|
|
|
|
2007-08-30 05:34:52 +02:00
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_SEG_SEL(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_SEG_SEL_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_SEG_BASE(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_SEG_BASE_BASE + index);
|
|
|
|
}
|
|
|
|
|
2007-12-02 08:00:15 +01:00
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_SEG_EFF_BASE(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_SEG_EFF_BASE_BASE + index);
|
|
|
|
}
|
|
|
|
|
2007-08-30 05:34:52 +02:00
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_SEG_LIMIT(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_SEG_LIMIT_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_SEG_ATTR(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_SEG_ATTR_BASE + index);
|
|
|
|
}
|
|
|
|
|
2008-02-27 05:39:53 +01:00
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_APIC_IN_SERVICE(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_APIC_IN_SERVICE_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_APIC_TRIGGER_MODE(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_APIC_TRIGGER_MODE_BASE + index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline MiscRegIndex
|
|
|
|
MISCREG_APIC_INTERRUPT_REQUEST(int index)
|
|
|
|
{
|
|
|
|
return (MiscRegIndex)(MISCREG_APIC_INTERRUPT_REQUEST_BASE + index);
|
|
|
|
}
|
|
|
|
|
2007-07-19 01:12:39 +02:00
|
|
|
/**
|
|
|
|
* A type to describe the condition code bits of the RFLAGS register,
|
|
|
|
* plus two flags, EZF and ECF, which are only visible to microcode.
|
|
|
|
*/
|
2007-07-17 22:29:40 +02:00
|
|
|
BitUnion64(CCFlagBits)
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<11> of;
|
|
|
|
Bitfield<7> sf;
|
|
|
|
Bitfield<6> zf;
|
|
|
|
Bitfield<5> ezf;
|
|
|
|
Bitfield<4> af;
|
|
|
|
Bitfield<3> ecf;
|
|
|
|
Bitfield<2> pf;
|
|
|
|
Bitfield<0> cf;
|
2007-07-17 22:29:40 +02:00
|
|
|
EndBitUnion(CCFlagBits)
|
2007-07-19 01:12:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* RFLAGS
|
|
|
|
*/
|
|
|
|
BitUnion64(RFLAGS)
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<21> id; // ID Flag
|
|
|
|
Bitfield<20> vip; // Virtual Interrupt Pending
|
|
|
|
Bitfield<19> vif; // Virtual Interrupt Flag
|
|
|
|
Bitfield<18> ac; // Alignment Check
|
|
|
|
Bitfield<17> vm; // Virtual-8086 Mode
|
|
|
|
Bitfield<16> rf; // Resume Flag
|
|
|
|
Bitfield<14> nt; // Nested Task
|
|
|
|
Bitfield<13, 12> iopl; // I/O Privilege Level
|
|
|
|
Bitfield<11> of; // Overflow Flag
|
|
|
|
Bitfield<10> df; // Direction Flag
|
|
|
|
Bitfield<9> intf; // Interrupt Flag
|
|
|
|
Bitfield<8> tf; // Trap Flag
|
|
|
|
Bitfield<7> sf; // Sign Flag
|
|
|
|
Bitfield<6> zf; // Zero Flag
|
|
|
|
Bitfield<4> af; // Auxiliary Flag
|
|
|
|
Bitfield<2> pf; // Parity Flag
|
|
|
|
Bitfield<0> cf; // Carry Flag
|
2007-07-19 01:12:39 +02:00
|
|
|
EndBitUnion(RFLAGS)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Control registers
|
|
|
|
*/
|
|
|
|
BitUnion64(CR0)
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<31> pg; // Paging
|
|
|
|
Bitfield<30> cd; // Cache Disable
|
|
|
|
Bitfield<29> nw; // Not Writethrough
|
|
|
|
Bitfield<18> am; // Alignment Mask
|
|
|
|
Bitfield<16> wp; // Write Protect
|
|
|
|
Bitfield<5> ne; // Numeric Error
|
|
|
|
Bitfield<4> et; // Extension Type
|
|
|
|
Bitfield<3> ts; // Task Switched
|
|
|
|
Bitfield<2> em; // Emulation
|
|
|
|
Bitfield<1> mp; // Monitor Coprocessor
|
|
|
|
Bitfield<0> pe; // Protection Enabled
|
2007-07-19 01:12:39 +02:00
|
|
|
EndBitUnion(CR0)
|
|
|
|
|
|
|
|
// Page Fault Virtual Address
|
|
|
|
BitUnion64(CR2)
|
|
|
|
Bitfield<31, 0> legacy;
|
|
|
|
EndBitUnion(CR2)
|
|
|
|
|
|
|
|
BitUnion64(CR3)
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<51, 12> longPdtb; // Long Mode Page-Directory-Table
|
2007-07-19 01:12:39 +02:00
|
|
|
// Base Address
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<31, 12> pdtb; // Non-PAE Addressing Page-Directory-Table
|
2007-07-19 01:12:39 +02:00
|
|
|
// Base Address
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<31, 5> paePdtb; // PAE Addressing Page-Directory-Table
|
2007-07-19 01:12:39 +02:00
|
|
|
// Base Address
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<4> pcd; // Page-Level Cache Disable
|
|
|
|
Bitfield<3> pwt; // Page-Level Writethrough
|
2007-07-19 01:12:39 +02:00
|
|
|
EndBitUnion(CR3)
|
|
|
|
|
|
|
|
BitUnion64(CR4)
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<10> osxmmexcpt; // Operating System Unmasked
|
2007-07-19 01:12:39 +02:00
|
|
|
// Exception Support
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<9> osfxsr; // Operating System FXSave/FSRSTOR Support
|
|
|
|
Bitfield<8> pce; // Performance-Monitoring Counter Enable
|
|
|
|
Bitfield<7> pge; // Page-Global Enable
|
|
|
|
Bitfield<6> mce; // Machine Check Enable
|
|
|
|
Bitfield<5> pae; // Physical-Address Extension
|
|
|
|
Bitfield<4> pse; // Page Size Extensions
|
|
|
|
Bitfield<3> de; // Debugging Extensions
|
|
|
|
Bitfield<2> tsd; // Time Stamp Disable
|
|
|
|
Bitfield<1> pvi; // Protected-Mode Virtual Interrupts
|
|
|
|
Bitfield<0> vme; // Virtual-8086 Mode Extensions
|
2007-07-19 01:12:39 +02:00
|
|
|
EndBitUnion(CR4)
|
|
|
|
|
|
|
|
BitUnion64(CR8)
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<3, 0> tpr; // Task Priority Register
|
|
|
|
EndBitUnion(CR8)
|
|
|
|
|
|
|
|
// MTRR capabilities
|
|
|
|
BitUnion64(MTRRcap)
|
|
|
|
Bitfield<7, 0> vcnt; // Variable-Range Register Count
|
|
|
|
Bitfield<8> fix; // Fixed-Range Registers
|
|
|
|
Bitfield<10> wc; // Write-Combining
|
|
|
|
EndBitUnion(MTRRcap)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SYSENTER configuration registers
|
|
|
|
*/
|
|
|
|
BitUnion64(SysenterCS)
|
|
|
|
Bitfield<15, 0> targetCS;
|
|
|
|
EndBitUnion(SysenterCS)
|
|
|
|
|
|
|
|
BitUnion64(SysenterESP)
|
|
|
|
Bitfield<31, 0> targetESP;
|
|
|
|
EndBitUnion(SysenterESP)
|
|
|
|
|
|
|
|
BitUnion64(SysenterEIP)
|
|
|
|
Bitfield<31, 0> targetEIP;
|
|
|
|
EndBitUnion(SysenterEIP)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Global machine check registers
|
|
|
|
*/
|
|
|
|
BitUnion64(McgCap)
|
|
|
|
Bitfield<7, 0> count; // Number of error reporting register banks
|
|
|
|
Bitfield<8> MCGCP; // MCG_CTL register present.
|
|
|
|
EndBitUnion(McgCap)
|
|
|
|
|
|
|
|
BitUnion64(McgStatus)
|
|
|
|
Bitfield<0> ripv; // Restart-IP valid
|
|
|
|
Bitfield<1> eipv; // Error-IP valid
|
|
|
|
Bitfield<2> mcip; // Machine check in-progress
|
|
|
|
EndBitUnion(McgStatus)
|
|
|
|
|
|
|
|
BitUnion64(DebugCtlMsr)
|
|
|
|
Bitfield<0> lbr; // Last-branch record
|
|
|
|
Bitfield<1> btf; // Branch single step
|
|
|
|
Bitfield<2> pb0; // Performance monitoring pin control 0
|
|
|
|
Bitfield<3> pb1; // Performance monitoring pin control 1
|
|
|
|
Bitfield<4> pb2; // Performance monitoring pin control 2
|
|
|
|
Bitfield<5> pb3; // Performance monitoring pin control 3
|
|
|
|
/*uint64_t pb(int index)
|
|
|
|
{
|
|
|
|
return bits(__data, index + 2);
|
|
|
|
}*/
|
|
|
|
EndBitUnion(DebugCtlMsr)
|
|
|
|
|
|
|
|
BitUnion64(MtrrPhysBase)
|
|
|
|
Bitfield<7, 0> type; // Default memory type
|
|
|
|
Bitfield<51, 12> physbase; // Range physical base address
|
|
|
|
EndBitUnion(MtrrPhysBase)
|
|
|
|
|
|
|
|
BitUnion64(MtrrPhysMask)
|
|
|
|
Bitfield<11> valid; // MTRR pair enable
|
|
|
|
Bitfield<51, 12> physmask; // Range physical mask
|
|
|
|
EndBitUnion(MtrrPhysMask)
|
|
|
|
|
|
|
|
BitUnion64(MtrrFixed)
|
|
|
|
/*uint64_t type(int index)
|
|
|
|
{
|
|
|
|
return bits(__data, index * 8 + 7, index * 8);
|
|
|
|
}*/
|
|
|
|
EndBitUnion(MtrrFixed)
|
|
|
|
|
|
|
|
BitUnion64(Pat)
|
|
|
|
/*uint64_t pa(int index)
|
|
|
|
{
|
|
|
|
return bits(__data, index * 8 + 2, index * 8);
|
|
|
|
}*/
|
|
|
|
EndBitUnion(Pat)
|
|
|
|
|
|
|
|
BitUnion64(MtrrDefType)
|
|
|
|
Bitfield<7, 0> type; // Default type
|
|
|
|
Bitfield<10> fe; // Fixed range enable
|
|
|
|
Bitfield<11> e; // MTRR enable
|
|
|
|
EndBitUnion(MtrrDefType)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Machine check
|
|
|
|
*/
|
|
|
|
BitUnion64(McStatus)
|
|
|
|
Bitfield<15,0> mcaErrorCode;
|
|
|
|
Bitfield<31,16> modelSpecificCode;
|
|
|
|
Bitfield<56,32> otherInfo;
|
|
|
|
Bitfield<57> pcc; // Processor-context corrupt
|
|
|
|
Bitfield<58> addrv; // Error-address register valid
|
|
|
|
Bitfield<59> miscv; // Miscellaneous-error register valid
|
|
|
|
Bitfield<60> en; // Error condition enabled
|
|
|
|
Bitfield<61> uc; // Uncorrected error
|
|
|
|
Bitfield<62> over; // Status register overflow
|
|
|
|
Bitfield<63> val; // Valid
|
|
|
|
EndBitUnion(McStatus)
|
|
|
|
|
|
|
|
BitUnion64(McCtl)
|
|
|
|
/*uint64_t en(int index)
|
|
|
|
{
|
|
|
|
return bits(__data, index);
|
|
|
|
}*/
|
|
|
|
EndBitUnion(McCtl)
|
|
|
|
|
|
|
|
// Extended feature enable register
|
|
|
|
BitUnion64(Efer)
|
|
|
|
Bitfield<0> sce; // System call extensions
|
|
|
|
Bitfield<8> lme; // Long mode enable
|
|
|
|
Bitfield<10> lma; // Long mode active
|
|
|
|
Bitfield<11> nxe; // No-execute enable
|
|
|
|
Bitfield<12> svme; // Secure virtual machine enable
|
|
|
|
Bitfield<14> ffxsr; // Fast fxsave/fxrstor
|
|
|
|
EndBitUnion(Efer)
|
|
|
|
|
|
|
|
BitUnion64(Star)
|
|
|
|
Bitfield<31,0> targetEip;
|
|
|
|
Bitfield<47,32> syscallCsAndSs;
|
|
|
|
Bitfield<63,48> sysretCsAndSs;
|
|
|
|
EndBitUnion(Star)
|
|
|
|
|
|
|
|
BitUnion64(SfMask)
|
|
|
|
Bitfield<31,0> mask;
|
|
|
|
EndBitUnion(SfMask)
|
|
|
|
|
|
|
|
BitUnion64(PerfEvtSel)
|
|
|
|
Bitfield<7,0> eventMask;
|
|
|
|
Bitfield<15,8> unitMask;
|
|
|
|
Bitfield<16> usr; // User mode
|
|
|
|
Bitfield<17> os; // Operating-system mode
|
|
|
|
Bitfield<18> e; // Edge detect
|
|
|
|
Bitfield<19> pc; // Pin control
|
|
|
|
Bitfield<20> intEn; // Interrupt enable
|
|
|
|
Bitfield<22> en; // Counter enable
|
|
|
|
Bitfield<23> inv; // Invert mask
|
|
|
|
Bitfield<31,24> counterMask;
|
|
|
|
EndBitUnion(PerfEvtSel)
|
|
|
|
|
|
|
|
BitUnion32(Syscfg)
|
|
|
|
Bitfield<18> mfde; // MtrrFixDramEn
|
|
|
|
Bitfield<19> mfdm; // MtrrFixDramModEn
|
|
|
|
Bitfield<20> mvdm; // MtrrVarDramEn
|
|
|
|
Bitfield<21> tom2; // MtrrTom2En
|
|
|
|
EndBitUnion(Syscfg)
|
|
|
|
|
|
|
|
BitUnion64(IorrBase)
|
|
|
|
Bitfield<3> wr; // WrMem Enable
|
|
|
|
Bitfield<4> rd; // RdMem Enable
|
|
|
|
Bitfield<51,12> physbase; // Range physical base address
|
|
|
|
EndBitUnion(IorrBase)
|
|
|
|
|
|
|
|
BitUnion64(IorrMask)
|
|
|
|
Bitfield<11> v; // I/O register pair enable (valid)
|
|
|
|
Bitfield<51,12> physmask; // Range physical mask
|
|
|
|
EndBitUnion(IorrMask)
|
|
|
|
|
|
|
|
BitUnion64(Tom)
|
|
|
|
Bitfield<51,23> physAddr; // Top of memory physical address
|
|
|
|
EndBitUnion(Tom)
|
|
|
|
|
|
|
|
BitUnion64(VmCrMsr)
|
|
|
|
Bitfield<0> dpd;
|
|
|
|
Bitfield<1> rInit;
|
|
|
|
Bitfield<2> disA20M;
|
|
|
|
EndBitUnion(VmCrMsr)
|
|
|
|
|
|
|
|
BitUnion64(IgnneMsr)
|
|
|
|
Bitfield<0> ignne;
|
|
|
|
EndBitUnion(IgnneMsr)
|
|
|
|
|
|
|
|
BitUnion64(SmmCtlMsr)
|
|
|
|
Bitfield<0> dismiss;
|
|
|
|
Bitfield<1> enter;
|
|
|
|
Bitfield<2> smiCycle;
|
|
|
|
Bitfield<3> exit;
|
|
|
|
Bitfield<4> rsmCycle;
|
|
|
|
EndBitUnion(SmmCtlMsr)
|
2007-07-19 01:12:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Segment Selector
|
|
|
|
*/
|
|
|
|
BitUnion64(SegSelector)
|
2007-12-02 08:03:39 +01:00
|
|
|
// The following bitfield is not defined in the ISA, but it's useful
|
|
|
|
// when checking selectors in larger data types to make sure they
|
|
|
|
// aren't too large.
|
|
|
|
Bitfield<63, 3> esi; // Extended selector
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<15, 3> si; // Selector Index
|
|
|
|
Bitfield<2> ti; // Table Indicator
|
|
|
|
Bitfield<1, 0> rpl; // Requestor Privilege Level
|
2007-07-19 01:12:39 +02:00
|
|
|
EndBitUnion(SegSelector)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Segment Descriptors
|
|
|
|
*/
|
|
|
|
|
|
|
|
BitUnion64(SegDescriptor)
|
|
|
|
Bitfield<63, 56> baseHigh;
|
|
|
|
Bitfield<39, 16> baseLow;
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<55> g; // Granularity
|
|
|
|
Bitfield<54> d; // Default Operand Size
|
|
|
|
Bitfield<54> b; // Default Operand Size
|
|
|
|
Bitfield<53> l; // Long Attribute Bit
|
|
|
|
Bitfield<52> avl; // Available To Software
|
2007-07-19 01:12:39 +02:00
|
|
|
Bitfield<51, 48> limitHigh;
|
|
|
|
Bitfield<15, 0> limitLow;
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<47> p; // Present
|
|
|
|
Bitfield<46, 45> dpl; // Descriptor Privilege-Level
|
|
|
|
Bitfield<44> s; // System
|
2007-07-19 01:12:39 +02:00
|
|
|
SubBitUnion(type, 43, 40)
|
|
|
|
// Specifies whether this descriptor is for code or data.
|
|
|
|
Bitfield<43> codeOrData;
|
|
|
|
|
|
|
|
// These bit fields are for code segments
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<42> c; // Conforming
|
|
|
|
Bitfield<41> r; // Readable
|
2007-07-19 01:12:39 +02:00
|
|
|
|
|
|
|
// These bit fields are for data segments
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<42> e; // Expand-Down
|
|
|
|
Bitfield<41> w; // Writable
|
2007-07-19 01:12:39 +02:00
|
|
|
|
|
|
|
// This is used for both code and data segments.
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<40> a; // Accessed
|
2007-07-19 01:12:39 +02:00
|
|
|
EndSubBitUnion(type)
|
|
|
|
EndBitUnion(SegDescriptor)
|
|
|
|
|
2007-10-08 03:16:00 +02:00
|
|
|
BitUnion64(SegAttr)
|
|
|
|
Bitfield<0> writable;
|
|
|
|
Bitfield<1> readable;
|
|
|
|
Bitfield<2> expandDown;
|
|
|
|
Bitfield<4, 3> dpl;
|
|
|
|
Bitfield<5> defaultSize;
|
|
|
|
Bitfield<6> longMode;
|
|
|
|
EndBitUnion(SegAttr)
|
|
|
|
|
2007-07-19 01:12:39 +02:00
|
|
|
BitUnion64(GateDescriptor)
|
|
|
|
Bitfield<63, 48> offsetHigh; // Target Code-Segment Offset
|
|
|
|
Bitfield<15, 0> offsetLow; // Target Code-Segment Offset
|
|
|
|
Bitfield<31, 16> selector; // Target Code-Segment Selector
|
2007-10-08 03:16:00 +02:00
|
|
|
Bitfield<47> p; // Present
|
|
|
|
Bitfield<46, 45> dpl; // Descriptor Privilege-Level
|
2007-07-19 01:12:39 +02:00
|
|
|
Bitfield<43, 40> type;
|
|
|
|
Bitfield<36, 32> count; // Parameter Count
|
|
|
|
EndBitUnion(GateDescriptor)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Descriptor-Table Registers
|
|
|
|
*/
|
|
|
|
BitUnion64(GDTR)
|
|
|
|
EndBitUnion(GDTR)
|
|
|
|
|
|
|
|
BitUnion64(IDTR)
|
|
|
|
EndBitUnion(IDTR)
|
|
|
|
|
|
|
|
BitUnion64(LDTR)
|
|
|
|
EndBitUnion(LDTR)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Task Register
|
|
|
|
*/
|
|
|
|
BitUnion64(TR)
|
|
|
|
EndBitUnion(TR)
|
2008-02-27 05:39:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Local APIC Base Register
|
|
|
|
*/
|
|
|
|
BitUnion64(LocalApicBase)
|
|
|
|
Bitfield<51, 12> base;
|
|
|
|
Bitfield<11> enable;
|
|
|
|
Bitfield<8> bsp;
|
|
|
|
EndBitUnion(LocalApicBase)
|
2007-07-17 22:29:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __ARCH_X86_INTREGS_HH__
|