misc.hh revision 9470
13536Sgblack@eecs.umich.edu/*
23536Sgblack@eecs.umich.edu * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
33536Sgblack@eecs.umich.edu * All rights reserved.
43536Sgblack@eecs.umich.edu *
53536Sgblack@eecs.umich.edu * The license below extends only to copyright in the software and shall
63536Sgblack@eecs.umich.edu * not be construed as granting a license to any other intellectual
73536Sgblack@eecs.umich.edu * property including but not limited to intellectual property relating
83536Sgblack@eecs.umich.edu * to a hardware implementation of the functionality of the software
93536Sgblack@eecs.umich.edu * licensed hereunder.  You may use the software subject to the license
103536Sgblack@eecs.umich.edu * terms below provided that you ensure that this notice is replicated
113536Sgblack@eecs.umich.edu * unmodified and in its entirety in all distributions of the software,
123536Sgblack@eecs.umich.edu * modified or unmodified, in source code or in binary form.
133536Sgblack@eecs.umich.edu *
143536Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
153536Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
163536Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
173536Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
183536Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
193536Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
203536Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
213536Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
223536Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
233536Sgblack@eecs.umich.edu * this software without specific prior written permission.
243536Sgblack@eecs.umich.edu *
253536Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
263536Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
273536Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
283536Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
293536Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
303536Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
313536Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
323536Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
335543Ssaidi@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
343536Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
353536Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
363536Sgblack@eecs.umich.edu *
373536Sgblack@eecs.umich.edu * Authors: Gabe Black
383536Sgblack@eecs.umich.edu */
393536Sgblack@eecs.umich.edu
403536Sgblack@eecs.umich.edu#ifndef __ARCH_X86_MISCREGS_HH__
415543Ssaidi@eecs.umich.edu#define __ARCH_X86_MISCREGS_HH__
425543Ssaidi@eecs.umich.edu
433536Sgblack@eecs.umich.edu#include "arch/x86/regs/segment.hh"
443536Sgblack@eecs.umich.edu#include "arch/x86/x86_traits.hh"
453536Sgblack@eecs.umich.edu#include "base/bitunion.hh"
463536Sgblack@eecs.umich.edu
473536Sgblack@eecs.umich.edu//These get defined in some system headers (at least termbits.h). That confuses
483536Sgblack@eecs.umich.edu//things here significantly.
493536Sgblack@eecs.umich.edu#undef CR0
503536Sgblack@eecs.umich.edu#undef CR2
513536Sgblack@eecs.umich.edu#undef CR3
523536Sgblack@eecs.umich.edu
533536Sgblack@eecs.umich.edunamespace X86ISA
545543Ssaidi@eecs.umich.edu{
555543Ssaidi@eecs.umich.edu    enum CondFlagBit {
563536Sgblack@eecs.umich.edu        CFBit = 1 << 0,
573536Sgblack@eecs.umich.edu        PFBit = 1 << 2,
583536Sgblack@eecs.umich.edu        ECFBit = 1 << 3,
593536Sgblack@eecs.umich.edu        AFBit = 1 << 4,
603536Sgblack@eecs.umich.edu        EZFBit = 1 << 5,
613536Sgblack@eecs.umich.edu        ZFBit = 1 << 6,
623536Sgblack@eecs.umich.edu        SFBit = 1 << 7,
633536Sgblack@eecs.umich.edu        DFBit = 1 << 10,
643536Sgblack@eecs.umich.edu        OFBit = 1 << 11
653536Sgblack@eecs.umich.edu    };
663536Sgblack@eecs.umich.edu
673536Sgblack@eecs.umich.edu    const uint32_t cfofMask = CFBit | OFBit;
683536Sgblack@eecs.umich.edu    const uint32_t ccFlagMask = PFBit | AFBit | ZFBit | SFBit;
693536Sgblack@eecs.umich.edu
703536Sgblack@eecs.umich.edu    enum RFLAGBit {
713536Sgblack@eecs.umich.edu        TFBit = 1 << 8,
725543Ssaidi@eecs.umich.edu        IFBit = 1 << 9,
733536Sgblack@eecs.umich.edu        NTBit = 1 << 14,
743536Sgblack@eecs.umich.edu        RFBit = 1 << 16,
753536Sgblack@eecs.umich.edu        VMBit = 1 << 17,
763536Sgblack@eecs.umich.edu        ACBit = 1 << 18,
773536Sgblack@eecs.umich.edu        VIFBit = 1 << 19,
783536Sgblack@eecs.umich.edu        VIPBit = 1 << 20,
793536Sgblack@eecs.umich.edu        IDBit = 1 << 21
803536Sgblack@eecs.umich.edu    };
813536Sgblack@eecs.umich.edu
823536Sgblack@eecs.umich.edu    enum X87StatusBit {
833536Sgblack@eecs.umich.edu        // Exception Flags
843536Sgblack@eecs.umich.edu        IEBit = 1 << 0,
853536Sgblack@eecs.umich.edu        DEBit = 1 << 1,
863536Sgblack@eecs.umich.edu        ZEBit = 1 << 2,
873536Sgblack@eecs.umich.edu        OEBit = 1 << 3,
883536Sgblack@eecs.umich.edu        UEBit = 1 << 4,
893536Sgblack@eecs.umich.edu        PEBit = 1 << 5,
903536Sgblack@eecs.umich.edu
913536Sgblack@eecs.umich.edu        // !Exception Flags
925543Ssaidi@eecs.umich.edu        StackFaultBit = 1 << 6,
935543Ssaidi@eecs.umich.edu        ErrSummaryBit = 1 << 7,
943536Sgblack@eecs.umich.edu        CC0Bit = 1 << 8,
953536Sgblack@eecs.umich.edu        CC1Bit = 1 << 9,
963536Sgblack@eecs.umich.edu        CC2Bit = 1 << 10,
973536Sgblack@eecs.umich.edu        CC3Bit = 1 << 14,
983536Sgblack@eecs.umich.edu        BusyBit = 1 << 15,
993536Sgblack@eecs.umich.edu    };
1003536Sgblack@eecs.umich.edu
1013536Sgblack@eecs.umich.edu    enum MiscRegIndex
1023536Sgblack@eecs.umich.edu    {
1033536Sgblack@eecs.umich.edu        // Control registers
1043536Sgblack@eecs.umich.edu        // Most of these are invalid.
1053536Sgblack@eecs.umich.edu        MISCREG_CR_BASE,
1063536Sgblack@eecs.umich.edu        MISCREG_CR0 = MISCREG_CR_BASE,
1073536Sgblack@eecs.umich.edu        MISCREG_CR1,
1083536Sgblack@eecs.umich.edu        MISCREG_CR2,
1093536Sgblack@eecs.umich.edu        MISCREG_CR3,
1103536Sgblack@eecs.umich.edu        MISCREG_CR4,
1113536Sgblack@eecs.umich.edu        MISCREG_CR5,
1123536Sgblack@eecs.umich.edu        MISCREG_CR6,
1133536Sgblack@eecs.umich.edu        MISCREG_CR7,
1143536Sgblack@eecs.umich.edu        MISCREG_CR8,
1153536Sgblack@eecs.umich.edu        MISCREG_CR9,
1163536Sgblack@eecs.umich.edu        MISCREG_CR10,
1173536Sgblack@eecs.umich.edu        MISCREG_CR11,
1183536Sgblack@eecs.umich.edu        MISCREG_CR12,
1193536Sgblack@eecs.umich.edu        MISCREG_CR13,
1205569Snate@binkert.org        MISCREG_CR14,
1213536Sgblack@eecs.umich.edu        MISCREG_CR15,
1223536Sgblack@eecs.umich.edu
1233536Sgblack@eecs.umich.edu        // Debug registers
1243961Sgblack@eecs.umich.edu        MISCREG_DR_BASE = MISCREG_CR_BASE + NumCRegs,
1253961Sgblack@eecs.umich.edu        MISCREG_DR0 = MISCREG_DR_BASE,
1263961Sgblack@eecs.umich.edu        MISCREG_DR1,
1273961Sgblack@eecs.umich.edu        MISCREG_DR2,
1283961Sgblack@eecs.umich.edu        MISCREG_DR3,
1293550Sgblack@eecs.umich.edu        MISCREG_DR4,
1306327Sgblack@eecs.umich.edu        MISCREG_DR5,
1313550Sgblack@eecs.umich.edu        MISCREG_DR6,
1328229Snate@binkert.org        MISCREG_DR7,
1333536Sgblack@eecs.umich.edu
1343536Sgblack@eecs.umich.edu        // Flags register
1353536Sgblack@eecs.umich.edu        MISCREG_RFLAGS = MISCREG_DR_BASE + NumDRegs,
1363536Sgblack@eecs.umich.edu
1378229Snate@binkert.org        //Register to keep handy values like the CPU mode in.
1383536Sgblack@eecs.umich.edu        MISCREG_M5_REG,
1393536Sgblack@eecs.umich.edu
1403536Sgblack@eecs.umich.edu        /*
1413536Sgblack@eecs.umich.edu         * Model Specific Registers
1423536Sgblack@eecs.umich.edu         */
1433536Sgblack@eecs.umich.edu        // Time stamp counter
1445567Snate@binkert.org        MISCREG_TSC,
1453536Sgblack@eecs.umich.edu
1465569Snate@binkert.org        MISCREG_MTRRCAP,
1475569Snate@binkert.org
1483536Sgblack@eecs.umich.edu        MISCREG_SYSENTER_CS,
1493579Sgblack@eecs.umich.edu        MISCREG_SYSENTER_ESP,
1503536Sgblack@eecs.umich.edu        MISCREG_SYSENTER_EIP,
1513536Sgblack@eecs.umich.edu
1525569Snate@binkert.org        MISCREG_MCG_CAP,
1535569Snate@binkert.org        MISCREG_MCG_STATUS,
1545569Snate@binkert.org        MISCREG_MCG_CTL,
1553536Sgblack@eecs.umich.edu
1563536Sgblack@eecs.umich.edu        MISCREG_DEBUG_CTL_MSR,
1573536Sgblack@eecs.umich.edu
1583961Sgblack@eecs.umich.edu        MISCREG_LAST_BRANCH_FROM_IP,
1593961Sgblack@eecs.umich.edu        MISCREG_LAST_BRANCH_TO_IP,
1603961Sgblack@eecs.umich.edu        MISCREG_LAST_EXCEPTION_FROM_IP,
1613536Sgblack@eecs.umich.edu        MISCREG_LAST_EXCEPTION_TO_IP,
1623536Sgblack@eecs.umich.edu
1635568Snate@binkert.org        MISCREG_MTRR_PHYS_BASE_BASE,
1645568Snate@binkert.org        MISCREG_MTRR_PHYS_BASE_0 = MISCREG_MTRR_PHYS_BASE_BASE,
1653536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_BASE_1,
1663536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_BASE_2,
1675568Snate@binkert.org        MISCREG_MTRR_PHYS_BASE_3,
1685568Snate@binkert.org        MISCREG_MTRR_PHYS_BASE_4,
1693536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_BASE_5,
1703536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_BASE_6,
1713536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_BASE_7,
1723536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_BASE_END,
1733536Sgblack@eecs.umich.edu
1743536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_MASK_BASE = MISCREG_MTRR_PHYS_BASE_END,
1753536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_MASK_0 = MISCREG_MTRR_PHYS_MASK_BASE,
1763536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_MASK_1,
1773536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_MASK_2,
1783536Sgblack@eecs.umich.edu        MISCREG_MTRR_PHYS_MASK_3,
1795569Snate@binkert.org        MISCREG_MTRR_PHYS_MASK_4,
1805569Snate@binkert.org        MISCREG_MTRR_PHYS_MASK_5,
1815569Snate@binkert.org        MISCREG_MTRR_PHYS_MASK_6,
1825569Snate@binkert.org        MISCREG_MTRR_PHYS_MASK_7,
1835569Snate@binkert.org        MISCREG_MTRR_PHYS_MASK_END,
1845569Snate@binkert.org
1855569Snate@binkert.org        MISCREG_MTRR_FIX_64K_00000 = MISCREG_MTRR_PHYS_MASK_END,
1863536Sgblack@eecs.umich.edu        MISCREG_MTRR_FIX_16K_80000,
1875568Snate@binkert.org        MISCREG_MTRR_FIX_16K_A0000,
1883536Sgblack@eecs.umich.edu        MISCREG_MTRR_FIX_4K_C0000,
1893536Sgblack@eecs.umich.edu        MISCREG_MTRR_FIX_4K_C8000,
1905568Snate@binkert.org        MISCREG_MTRR_FIX_4K_D0000,
1915569Snate@binkert.org        MISCREG_MTRR_FIX_4K_D8000,
1925569Snate@binkert.org        MISCREG_MTRR_FIX_4K_E0000,
1933536Sgblack@eecs.umich.edu        MISCREG_MTRR_FIX_4K_E8000,
1943536Sgblack@eecs.umich.edu        MISCREG_MTRR_FIX_4K_F0000,
1953536Sgblack@eecs.umich.edu        MISCREG_MTRR_FIX_4K_F8000,
1963536Sgblack@eecs.umich.edu
1975568Snate@binkert.org        MISCREG_PAT,
1983536Sgblack@eecs.umich.edu
1993536Sgblack@eecs.umich.edu        MISCREG_DEF_TYPE,
2003536Sgblack@eecs.umich.edu
2013536Sgblack@eecs.umich.edu        MISCREG_MC_CTL_BASE,
2023961Sgblack@eecs.umich.edu        MISCREG_MC0_CTL = MISCREG_MC_CTL_BASE,
2033536Sgblack@eecs.umich.edu        MISCREG_MC1_CTL,
2043536Sgblack@eecs.umich.edu        MISCREG_MC2_CTL,
2055569Snate@binkert.org        MISCREG_MC3_CTL,
2065569Snate@binkert.org        MISCREG_MC4_CTL,
2075569Snate@binkert.org        MISCREG_MC5_CTL,
2085569Snate@binkert.org        MISCREG_MC6_CTL,
2093536Sgblack@eecs.umich.edu        MISCREG_MC7_CTL,
2103536Sgblack@eecs.umich.edu        MISCREG_MC_CTL_END,
2113536Sgblack@eecs.umich.edu
2123579Sgblack@eecs.umich.edu        MISCREG_MC_STATUS_BASE = MISCREG_MC_CTL_END,
2133536Sgblack@eecs.umich.edu        MISCREG_MC0_STATUS = MISCREG_MC_STATUS_BASE,
2147720Sgblack@eecs.umich.edu        MISCREG_MC1_STATUS,
2153536Sgblack@eecs.umich.edu        MISCREG_MC2_STATUS,
2163536Sgblack@eecs.umich.edu        MISCREG_MC3_STATUS,
2175568Snate@binkert.org        MISCREG_MC4_STATUS,
2185568Snate@binkert.org        MISCREG_MC5_STATUS,
2195568Snate@binkert.org        MISCREG_MC6_STATUS,
2203536Sgblack@eecs.umich.edu        MISCREG_MC7_STATUS,
2213536Sgblack@eecs.umich.edu        MISCREG_MC_STATUS_END,
2225568Snate@binkert.org
2233536Sgblack@eecs.umich.edu        MISCREG_MC_ADDR_BASE = MISCREG_MC_STATUS_END,
2243536Sgblack@eecs.umich.edu        MISCREG_MC0_ADDR = MISCREG_MC_ADDR_BASE,
2253536Sgblack@eecs.umich.edu        MISCREG_MC1_ADDR,
2263536Sgblack@eecs.umich.edu        MISCREG_MC2_ADDR,
2273536Sgblack@eecs.umich.edu        MISCREG_MC3_ADDR,
2285568Snate@binkert.org        MISCREG_MC4_ADDR,
2293536Sgblack@eecs.umich.edu        MISCREG_MC5_ADDR,
2303536Sgblack@eecs.umich.edu        MISCREG_MC6_ADDR,
2313536Sgblack@eecs.umich.edu        MISCREG_MC7_ADDR,
2323536Sgblack@eecs.umich.edu        MISCREG_MC_ADDR_END,
2333536Sgblack@eecs.umich.edu
2345569Snate@binkert.org        MISCREG_MC_MISC_BASE = MISCREG_MC_ADDR_END,
2355569Snate@binkert.org        MISCREG_MC0_MISC = MISCREG_MC_MISC_BASE,
2365569Snate@binkert.org        MISCREG_MC1_MISC,
2375569Snate@binkert.org        MISCREG_MC2_MISC,
2383536Sgblack@eecs.umich.edu        MISCREG_MC3_MISC,
2393536Sgblack@eecs.umich.edu        MISCREG_MC4_MISC,
2403536Sgblack@eecs.umich.edu        MISCREG_MC5_MISC,
2413536Sgblack@eecs.umich.edu        MISCREG_MC6_MISC,
2425568Snate@binkert.org        MISCREG_MC7_MISC,
2435568Snate@binkert.org        MISCREG_MC_MISC_END,
2445568Snate@binkert.org
2453536Sgblack@eecs.umich.edu        // Extended feature enable register
2463536Sgblack@eecs.umich.edu        MISCREG_EFER = MISCREG_MC_MISC_END,
2475568Snate@binkert.org
2483536Sgblack@eecs.umich.edu        MISCREG_STAR,
2493536Sgblack@eecs.umich.edu        MISCREG_LSTAR,
2503536Sgblack@eecs.umich.edu        MISCREG_CSTAR,
2513536Sgblack@eecs.umich.edu
2523536Sgblack@eecs.umich.edu        MISCREG_SF_MASK,
2535568Snate@binkert.org
2543536Sgblack@eecs.umich.edu        MISCREG_KERNEL_GS_BASE,
2553536Sgblack@eecs.umich.edu
2563536Sgblack@eecs.umich.edu        MISCREG_TSC_AUX,
2577720Sgblack@eecs.umich.edu
2583536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_SEL_BASE,
2593536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_SEL0 = MISCREG_PERF_EVT_SEL_BASE,
2603536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_SEL1,
2613536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_SEL2,
2623536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_SEL3,
2633536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_SEL_END,
2643550Sgblack@eecs.umich.edu
2653536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_CTR_BASE = MISCREG_PERF_EVT_SEL_END,
2663550Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_CTR0 = MISCREG_PERF_EVT_CTR_BASE,
2673536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_CTR1,
2683536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_CTR2,
2693550Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_CTR3,
2703536Sgblack@eecs.umich.edu        MISCREG_PERF_EVT_CTR_END,
2713536Sgblack@eecs.umich.edu
2723536Sgblack@eecs.umich.edu        MISCREG_SYSCFG = MISCREG_PERF_EVT_CTR_END,
2733536Sgblack@eecs.umich.edu
2743536Sgblack@eecs.umich.edu        MISCREG_IORR_BASE_BASE,
2753536Sgblack@eecs.umich.edu        MISCREG_IORR_BASE0 = MISCREG_IORR_BASE_BASE,
2767720Sgblack@eecs.umich.edu        MISCREG_IORR_BASE1,
2777720Sgblack@eecs.umich.edu        MISCREG_IORR_BASE_END,
2783536Sgblack@eecs.umich.edu
2793536Sgblack@eecs.umich.edu        MISCREG_IORR_MASK_BASE = MISCREG_IORR_BASE_END,
2803536Sgblack@eecs.umich.edu        MISCREG_IORR_MASK0 = MISCREG_IORR_MASK_BASE,
2813536Sgblack@eecs.umich.edu        MISCREG_IORR_MASK1,
2827720Sgblack@eecs.umich.edu        MISCREG_IORR_MASK_END,
2837720Sgblack@eecs.umich.edu
2843536Sgblack@eecs.umich.edu        MISCREG_TOP_MEM = MISCREG_IORR_MASK_END,
2853536Sgblack@eecs.umich.edu        MISCREG_TOP_MEM2,
2863536Sgblack@eecs.umich.edu
2877720Sgblack@eecs.umich.edu        MISCREG_VM_CR,
2883536Sgblack@eecs.umich.edu        MISCREG_IGNNE,
2893536Sgblack@eecs.umich.edu        MISCREG_SMM_CTL,
2903536Sgblack@eecs.umich.edu        MISCREG_VM_HSAVE_PA,
2913536Sgblack@eecs.umich.edu
2923550Sgblack@eecs.umich.edu        /*
2933536Sgblack@eecs.umich.edu         * Segment registers
2947720Sgblack@eecs.umich.edu         */
2953536Sgblack@eecs.umich.edu        // Segment selectors
2963536Sgblack@eecs.umich.edu        MISCREG_SEG_SEL_BASE,
2977720Sgblack@eecs.umich.edu        MISCREG_ES = MISCREG_SEG_SEL_BASE,
2983536Sgblack@eecs.umich.edu        MISCREG_CS,
2993536Sgblack@eecs.umich.edu        MISCREG_SS,
3003536Sgblack@eecs.umich.edu        MISCREG_DS,
3013536Sgblack@eecs.umich.edu        MISCREG_FS,
3023536Sgblack@eecs.umich.edu        MISCREG_GS,
3033536Sgblack@eecs.umich.edu        MISCREG_HS,
3043536Sgblack@eecs.umich.edu        MISCREG_TSL,
3053536Sgblack@eecs.umich.edu        MISCREG_TSG,
3063536Sgblack@eecs.umich.edu        MISCREG_LS,
3073536Sgblack@eecs.umich.edu        MISCREG_MS,
3083536Sgblack@eecs.umich.edu        MISCREG_TR,
3093536Sgblack@eecs.umich.edu        MISCREG_IDTR,
3103536Sgblack@eecs.umich.edu
3113536Sgblack@eecs.umich.edu        // Hidden segment base field
3123536Sgblack@eecs.umich.edu        MISCREG_SEG_BASE_BASE = MISCREG_SEG_SEL_BASE + NUM_SEGMENTREGS,
3133536Sgblack@eecs.umich.edu        MISCREG_ES_BASE = MISCREG_SEG_BASE_BASE,
314        MISCREG_CS_BASE,
315        MISCREG_SS_BASE,
316        MISCREG_DS_BASE,
317        MISCREG_FS_BASE,
318        MISCREG_GS_BASE,
319        MISCREG_HS_BASE,
320        MISCREG_TSL_BASE,
321        MISCREG_TSG_BASE,
322        MISCREG_LS_BASE,
323        MISCREG_MS_BASE,
324        MISCREG_TR_BASE,
325        MISCREG_IDTR_BASE,
326
327        // The effective segment base, ie what is actually added to an
328        // address. In 64 bit mode this can be different from the above,
329        // namely 0.
330        MISCREG_SEG_EFF_BASE_BASE = MISCREG_SEG_BASE_BASE + NUM_SEGMENTREGS,
331        MISCREG_ES_EFF_BASE = MISCREG_SEG_EFF_BASE_BASE,
332        MISCREG_CS_EFF_BASE,
333        MISCREG_SS_EFF_BASE,
334        MISCREG_DS_EFF_BASE,
335        MISCREG_FS_EFF_BASE,
336        MISCREG_GS_EFF_BASE,
337        MISCREG_HS_EFF_BASE,
338        MISCREG_TSL_EFF_BASE,
339        MISCREG_TSG_EFF_BASE,
340        MISCREG_LS_EFF_BASE,
341        MISCREG_MS_EFF_BASE,
342        MISCREG_TR_EFF_BASE,
343        MISCREG_IDTR_EFF_BASE,
344
345        // Hidden segment limit field
346        MISCREG_SEG_LIMIT_BASE = MISCREG_SEG_EFF_BASE_BASE + NUM_SEGMENTREGS,
347        MISCREG_ES_LIMIT = MISCREG_SEG_LIMIT_BASE,
348        MISCREG_CS_LIMIT,
349        MISCREG_SS_LIMIT,
350        MISCREG_DS_LIMIT,
351        MISCREG_FS_LIMIT,
352        MISCREG_GS_LIMIT,
353        MISCREG_HS_LIMIT,
354        MISCREG_TSL_LIMIT,
355        MISCREG_TSG_LIMIT,
356        MISCREG_LS_LIMIT,
357        MISCREG_MS_LIMIT,
358        MISCREG_TR_LIMIT,
359        MISCREG_IDTR_LIMIT,
360
361        // Hidden segment limit attributes
362        MISCREG_SEG_ATTR_BASE = MISCREG_SEG_LIMIT_BASE + NUM_SEGMENTREGS,
363        MISCREG_ES_ATTR = MISCREG_SEG_ATTR_BASE,
364        MISCREG_CS_ATTR,
365        MISCREG_SS_ATTR,
366        MISCREG_DS_ATTR,
367        MISCREG_FS_ATTR,
368        MISCREG_GS_ATTR,
369        MISCREG_HS_ATTR,
370        MISCREG_TSL_ATTR,
371        MISCREG_TSG_ATTR,
372        MISCREG_LS_ATTR,
373        MISCREG_MS_ATTR,
374        MISCREG_TR_ATTR,
375        MISCREG_IDTR_ATTR,
376
377        // Floating point control registers
378        MISCREG_X87_TOP =
379            MISCREG_SEG_ATTR_BASE + NUM_SEGMENTREGS,
380
381        MISCREG_MXCSR,
382        MISCREG_FCW,
383        MISCREG_FSW,
384        MISCREG_FTW,
385        MISCREG_FTAG,
386        MISCREG_FISEG,
387        MISCREG_FIOFF,
388        MISCREG_FOSEG,
389        MISCREG_FOOFF,
390        MISCREG_FOP,
391
392        //XXX Add "Model-Specific Registers"
393
394        MISCREG_APIC_BASE,
395
396        // "Fake" MSRs for internally implemented devices
397        MISCREG_PCI_CONFIG_ADDRESS,
398
399        NUM_MISCREGS
400    };
401
402    static inline MiscRegIndex
403    MISCREG_CR(int index)
404    {
405        assert(index >= 0 && index < NumCRegs);
406        return (MiscRegIndex)(MISCREG_CR_BASE + index);
407    }
408
409    static inline MiscRegIndex
410    MISCREG_DR(int index)
411    {
412        assert(index >= 0 && index < NumDRegs);
413        return (MiscRegIndex)(MISCREG_DR_BASE + index);
414    }
415
416    static inline MiscRegIndex
417    MISCREG_MTRR_PHYS_BASE(int index)
418    {
419        assert(index >= 0 && index < (MISCREG_MTRR_PHYS_BASE_END -
420                                      MISCREG_MTRR_PHYS_BASE_BASE));
421        return (MiscRegIndex)(MISCREG_MTRR_PHYS_BASE_BASE + index);
422    }
423
424    static inline MiscRegIndex
425    MISCREG_MTRR_PHYS_MASK(int index)
426    {
427        assert(index >= 0 && index < (MISCREG_MTRR_PHYS_MASK_END -
428                                      MISCREG_MTRR_PHYS_MASK_BASE));
429        return (MiscRegIndex)(MISCREG_MTRR_PHYS_MASK_BASE + index);
430    }
431
432    static inline MiscRegIndex
433    MISCREG_MC_CTL(int index)
434    {
435        assert(index >= 0 && index < (MISCREG_MC_CTL_END -
436                                      MISCREG_MC_CTL_BASE));
437        return (MiscRegIndex)(MISCREG_MC_CTL_BASE + index);
438    }
439
440    static inline MiscRegIndex
441    MISCREG_MC_STATUS(int index)
442    {
443        assert(index >= 0 && index < (MISCREG_MC_STATUS_END -
444                                      MISCREG_MC_STATUS_BASE));
445        return (MiscRegIndex)(MISCREG_MC_STATUS_BASE + index);
446    }
447
448    static inline MiscRegIndex
449    MISCREG_MC_ADDR(int index)
450    {
451        assert(index >= 0 && index < (MISCREG_MC_ADDR_END -
452                                      MISCREG_MC_ADDR_BASE));
453        return (MiscRegIndex)(MISCREG_MC_ADDR_BASE + index);
454    }
455
456    static inline MiscRegIndex
457    MISCREG_MC_MISC(int index)
458    {
459        assert(index >= 0 && index < (MISCREG_MC_MISC_END -
460                                      MISCREG_MC_MISC_BASE));
461        return (MiscRegIndex)(MISCREG_MC_MISC_BASE + index);
462    }
463
464    static inline MiscRegIndex
465    MISCREG_PERF_EVT_SEL(int index)
466    {
467        assert(index >= 0 && index < (MISCREG_PERF_EVT_SEL_END -
468                                      MISCREG_PERF_EVT_SEL_BASE));
469        return (MiscRegIndex)(MISCREG_PERF_EVT_SEL_BASE + index);
470    }
471
472    static inline MiscRegIndex
473    MISCREG_PERF_EVT_CTR(int index)
474    {
475        assert(index >= 0 && index < (MISCREG_PERF_EVT_CTR_END -
476                                      MISCREG_PERF_EVT_CTR_BASE));
477        return (MiscRegIndex)(MISCREG_PERF_EVT_CTR_BASE + index);
478    }
479
480    static inline MiscRegIndex
481    MISCREG_IORR_BASE(int index)
482    {
483        assert(index >= 0 && index < (MISCREG_IORR_BASE_END -
484                                      MISCREG_IORR_BASE_BASE));
485        return (MiscRegIndex)(MISCREG_IORR_BASE_BASE + index);
486    }
487
488    static inline MiscRegIndex
489    MISCREG_IORR_MASK(int index)
490    {
491        assert(index >= 0 && index < (MISCREG_IORR_MASK_END -
492                                      MISCREG_IORR_MASK_BASE));
493        return (MiscRegIndex)(MISCREG_IORR_MASK_BASE + index);
494    }
495
496    static inline MiscRegIndex
497    MISCREG_SEG_SEL(int index)
498    {
499        assert(index >= 0 && index < NUM_SEGMENTREGS);
500        return (MiscRegIndex)(MISCREG_SEG_SEL_BASE + index);
501    }
502
503    static inline MiscRegIndex
504    MISCREG_SEG_BASE(int index)
505    {
506        assert(index >= 0 && index < NUM_SEGMENTREGS);
507        return (MiscRegIndex)(MISCREG_SEG_BASE_BASE + index);
508    }
509
510    static inline MiscRegIndex
511    MISCREG_SEG_EFF_BASE(int index)
512    {
513        assert(index >= 0 && index < NUM_SEGMENTREGS);
514        return (MiscRegIndex)(MISCREG_SEG_EFF_BASE_BASE + index);
515    }
516
517    static inline MiscRegIndex
518    MISCREG_SEG_LIMIT(int index)
519    {
520        assert(index >= 0 && index < NUM_SEGMENTREGS);
521        return (MiscRegIndex)(MISCREG_SEG_LIMIT_BASE + index);
522    }
523
524    static inline MiscRegIndex
525    MISCREG_SEG_ATTR(int index)
526    {
527        assert(index >= 0 && index < NUM_SEGMENTREGS);
528        return (MiscRegIndex)(MISCREG_SEG_ATTR_BASE + index);
529    }
530
531    /**
532     * A type to describe the condition code bits of the RFLAGS register,
533     * plus two flags, EZF and ECF, which are only visible to microcode.
534     */
535    BitUnion64(CCFlagBits)
536        Bitfield<11> of;
537        Bitfield<7> sf;
538        Bitfield<6> zf;
539        Bitfield<5> ezf;
540        Bitfield<4> af;
541        Bitfield<3> ecf;
542        Bitfield<2> pf;
543        Bitfield<0> cf;
544    EndBitUnion(CCFlagBits)
545
546    /**
547     * RFLAGS
548     */
549    BitUnion64(RFLAGS)
550        Bitfield<21> id; // ID Flag
551        Bitfield<20> vip; // Virtual Interrupt Pending
552        Bitfield<19> vif; // Virtual Interrupt Flag
553        Bitfield<18> ac; // Alignment Check
554        Bitfield<17> vm; // Virtual-8086 Mode
555        Bitfield<16> rf; // Resume Flag
556        Bitfield<14> nt; // Nested Task
557        Bitfield<13, 12> iopl; // I/O Privilege Level
558        Bitfield<11> of; // Overflow Flag
559        Bitfield<10> df; // Direction Flag
560        Bitfield<9> intf; // Interrupt Flag
561        Bitfield<8> tf; // Trap Flag
562        Bitfield<7> sf; // Sign Flag
563        Bitfield<6> zf; // Zero Flag
564        Bitfield<4> af; // Auxiliary Flag
565        Bitfield<2> pf; // Parity Flag
566        Bitfield<0> cf; // Carry Flag
567    EndBitUnion(RFLAGS)
568
569    BitUnion64(HandyM5Reg)
570        Bitfield<0> mode;
571        Bitfield<3, 1> submode;
572        Bitfield<5, 4> cpl;
573        Bitfield<6> paging;
574        Bitfield<7> prot;
575        Bitfield<9, 8> defOp;
576        Bitfield<11, 10> altOp;
577        Bitfield<13, 12> defAddr;
578        Bitfield<15, 14> altAddr;
579        Bitfield<17, 16> stack;
580    EndBitUnion(HandyM5Reg)
581
582    /**
583     * Control registers
584     */
585    BitUnion64(CR0)
586        Bitfield<31> pg; // Paging
587        Bitfield<30> cd; // Cache Disable
588        Bitfield<29> nw; // Not Writethrough
589        Bitfield<18> am; // Alignment Mask
590        Bitfield<16> wp; // Write Protect
591        Bitfield<5> ne; // Numeric Error
592        Bitfield<4> et; // Extension Type
593        Bitfield<3> ts; // Task Switched
594        Bitfield<2> em; // Emulation
595        Bitfield<1> mp; // Monitor Coprocessor
596        Bitfield<0> pe; // Protection Enabled
597    EndBitUnion(CR0)
598
599    // Page Fault Virtual Address
600    BitUnion64(CR2)
601        Bitfield<31, 0> legacy;
602    EndBitUnion(CR2)
603
604    BitUnion64(CR3)
605        Bitfield<51, 12> longPdtb; // Long Mode Page-Directory-Table
606                                   // Base Address
607        Bitfield<31, 12> pdtb; // Non-PAE Addressing Page-Directory-Table
608                               // Base Address
609        Bitfield<31, 5> paePdtb; // PAE Addressing Page-Directory-Table
610                                 // Base Address
611        Bitfield<4> pcd; // Page-Level Cache Disable
612        Bitfield<3> pwt; // Page-Level Writethrough
613    EndBitUnion(CR3)
614
615    BitUnion64(CR4)
616        Bitfield<10> osxmmexcpt; // Operating System Unmasked
617                                 // Exception Support
618        Bitfield<9> osfxsr; // Operating System FXSave/FSRSTOR Support
619        Bitfield<8> pce; // Performance-Monitoring Counter Enable
620        Bitfield<7> pge; // Page-Global Enable
621        Bitfield<6> mce; // Machine Check Enable
622        Bitfield<5> pae; // Physical-Address Extension
623        Bitfield<4> pse; // Page Size Extensions
624        Bitfield<3> de; // Debugging Extensions
625        Bitfield<2> tsd; // Time Stamp Disable
626        Bitfield<1> pvi; // Protected-Mode Virtual Interrupts
627        Bitfield<0> vme; // Virtual-8086 Mode Extensions
628    EndBitUnion(CR4)
629
630    BitUnion64(CR8)
631        Bitfield<3, 0> tpr; // Task Priority Register
632    EndBitUnion(CR8)
633
634    BitUnion64(DR6)
635        Bitfield<0> b0;
636        Bitfield<1> b1;
637        Bitfield<2> b2;
638        Bitfield<3> b3;
639        Bitfield<13> bd;
640        Bitfield<14> bs;
641        Bitfield<15> bt;
642    EndBitUnion(DR6)
643
644    BitUnion64(DR7)
645        Bitfield<0> l0;
646        Bitfield<1> g0;
647        Bitfield<2> l1;
648        Bitfield<3> g1;
649        Bitfield<4> l2;
650        Bitfield<5> g2;
651        Bitfield<6> l3;
652        Bitfield<7> g3;
653        Bitfield<8> le;
654        Bitfield<9> ge;
655        Bitfield<13> gd;
656        Bitfield<17, 16> rw0;
657        Bitfield<19, 18> len0;
658        Bitfield<21, 20> rw1;
659        Bitfield<23, 22> len1;
660        Bitfield<25, 24> rw2;
661        Bitfield<27, 26> len2;
662        Bitfield<29, 28> rw3;
663        Bitfield<31, 30> len3;
664    EndBitUnion(DR7)
665
666    // MTRR capabilities
667    BitUnion64(MTRRcap)
668        Bitfield<7, 0> vcnt; // Variable-Range Register Count
669        Bitfield<8> fix; // Fixed-Range Registers
670        Bitfield<10> wc; // Write-Combining
671    EndBitUnion(MTRRcap)
672
673    /**
674     * SYSENTER configuration registers
675     */
676    BitUnion64(SysenterCS)
677        Bitfield<15, 0> targetCS;
678    EndBitUnion(SysenterCS)
679
680    BitUnion64(SysenterESP)
681        Bitfield<31, 0> targetESP;
682    EndBitUnion(SysenterESP)
683
684    BitUnion64(SysenterEIP)
685        Bitfield<31, 0> targetEIP;
686    EndBitUnion(SysenterEIP)
687
688    /**
689     * Global machine check registers
690     */
691    BitUnion64(McgCap)
692        Bitfield<7, 0> count; // Number of error reporting register banks
693        Bitfield<8> MCGCP; // MCG_CTL register present.
694    EndBitUnion(McgCap)
695
696    BitUnion64(McgStatus)
697        Bitfield<0> ripv; // Restart-IP valid
698        Bitfield<1> eipv; // Error-IP valid
699        Bitfield<2> mcip; // Machine check in-progress
700    EndBitUnion(McgStatus)
701
702    BitUnion64(DebugCtlMsr)
703        Bitfield<0> lbr; // Last-branch record
704        Bitfield<1> btf; // Branch single step
705        Bitfield<2> pb0; // Performance monitoring pin control 0
706        Bitfield<3> pb1; // Performance monitoring pin control 1
707        Bitfield<4> pb2; // Performance monitoring pin control 2
708        Bitfield<5> pb3; // Performance monitoring pin control 3
709        /*uint64_t pb(int index)
710        {
711            return bits(__data, index + 2);
712        }*/
713    EndBitUnion(DebugCtlMsr)
714
715    BitUnion64(MtrrPhysBase)
716        Bitfield<7, 0> type; // Default memory type
717        Bitfield<51, 12> physbase; // Range physical base address
718    EndBitUnion(MtrrPhysBase)
719
720    BitUnion64(MtrrPhysMask)
721        Bitfield<11> valid; // MTRR pair enable
722        Bitfield<51, 12> physmask; // Range physical mask
723    EndBitUnion(MtrrPhysMask)
724
725    BitUnion64(MtrrFixed)
726        /*uint64_t type(int index)
727        {
728            return bits(__data, index * 8 + 7, index * 8);
729        }*/
730    EndBitUnion(MtrrFixed)
731
732    BitUnion64(Pat)
733        /*uint64_t pa(int index)
734        {
735            return bits(__data, index * 8 + 2, index * 8);
736        }*/
737    EndBitUnion(Pat)
738
739    BitUnion64(MtrrDefType)
740        Bitfield<7, 0> type; // Default type
741        Bitfield<10> fe; // Fixed range enable
742        Bitfield<11> e; // MTRR enable
743    EndBitUnion(MtrrDefType)
744
745    /**
746     * Machine check
747     */
748    BitUnion64(McStatus)
749        Bitfield<15,0> mcaErrorCode;
750        Bitfield<31,16> modelSpecificCode;
751        Bitfield<56,32> otherInfo;
752        Bitfield<57> pcc; // Processor-context corrupt
753        Bitfield<58> addrv; // Error-address register valid
754        Bitfield<59> miscv; // Miscellaneous-error register valid
755        Bitfield<60> en; // Error condition enabled
756        Bitfield<61> uc; // Uncorrected error
757        Bitfield<62> over; // Status register overflow
758        Bitfield<63> val; // Valid
759    EndBitUnion(McStatus)
760
761    BitUnion64(McCtl)
762        /*uint64_t en(int index)
763        {
764            return bits(__data, index);
765        }*/
766    EndBitUnion(McCtl)
767
768    // Extended feature enable register
769    BitUnion64(Efer)
770        Bitfield<0> sce; // System call extensions
771        Bitfield<8> lme; // Long mode enable
772        Bitfield<10> lma; // Long mode active
773        Bitfield<11> nxe; // No-execute enable
774        Bitfield<12> svme; // Secure virtual machine enable
775        Bitfield<14> ffxsr; // Fast fxsave/fxrstor
776    EndBitUnion(Efer)
777
778    BitUnion64(Star)
779        Bitfield<31,0> targetEip;
780        Bitfield<47,32> syscallCsAndSs;
781        Bitfield<63,48> sysretCsAndSs;
782    EndBitUnion(Star)
783
784    BitUnion64(SfMask)
785        Bitfield<31,0> mask;
786    EndBitUnion(SfMask)
787
788    BitUnion64(PerfEvtSel)
789        Bitfield<7,0> eventMask;
790        Bitfield<15,8> unitMask;
791        Bitfield<16> usr; // User mode
792        Bitfield<17> os; // Operating-system mode
793        Bitfield<18> e; // Edge detect
794        Bitfield<19> pc; // Pin control
795        Bitfield<20> intEn; // Interrupt enable
796        Bitfield<22> en; // Counter enable
797        Bitfield<23> inv; // Invert mask
798        Bitfield<31,24> counterMask;
799    EndBitUnion(PerfEvtSel)
800
801    BitUnion32(Syscfg)
802        Bitfield<18> mfde; // MtrrFixDramEn
803        Bitfield<19> mfdm; // MtrrFixDramModEn
804        Bitfield<20> mvdm; // MtrrVarDramEn
805        Bitfield<21> tom2; // MtrrTom2En
806    EndBitUnion(Syscfg)
807
808    BitUnion64(IorrBase)
809        Bitfield<3> wr; // WrMem Enable
810        Bitfield<4> rd; // RdMem Enable
811        Bitfield<51,12> physbase; // Range physical base address
812    EndBitUnion(IorrBase)
813
814    BitUnion64(IorrMask)
815        Bitfield<11> v; // I/O register pair enable (valid)
816        Bitfield<51,12> physmask; // Range physical mask
817    EndBitUnion(IorrMask)
818
819    BitUnion64(Tom)
820        Bitfield<51,23> physAddr; // Top of memory physical address
821    EndBitUnion(Tom)
822
823    BitUnion64(VmCrMsr)
824        Bitfield<0> dpd;
825        Bitfield<1> rInit;
826        Bitfield<2> disA20M;
827    EndBitUnion(VmCrMsr)
828
829    BitUnion64(IgnneMsr)
830        Bitfield<0> ignne;
831    EndBitUnion(IgnneMsr)
832
833    BitUnion64(SmmCtlMsr)
834        Bitfield<0> dismiss;
835        Bitfield<1> enter;
836        Bitfield<2> smiCycle;
837        Bitfield<3> exit;
838        Bitfield<4> rsmCycle;
839    EndBitUnion(SmmCtlMsr)
840
841    /**
842     * Segment Selector
843     */
844    BitUnion64(SegSelector)
845        // The following bitfield is not defined in the ISA, but it's useful
846        // when checking selectors in larger data types to make sure they
847        // aren't too large.
848        Bitfield<63, 3> esi; // Extended selector
849        Bitfield<15, 3> si; // Selector Index
850        Bitfield<2> ti; // Table Indicator
851        Bitfield<1, 0> rpl; // Requestor Privilege Level
852    EndBitUnion(SegSelector)
853
854    /**
855     * Segment Descriptors
856     */
857
858    BitUnion64(SegDescriptor)
859        Bitfield<63, 56> baseHigh;
860        Bitfield<39, 16> baseLow;
861        Bitfield<55> g; // Granularity
862        Bitfield<54> d; // Default Operand Size
863        Bitfield<54> b; // Default Operand Size
864        Bitfield<53> l; // Long Attribute Bit
865        Bitfield<52> avl; // Available To Software
866        Bitfield<51, 48> limitHigh;
867        Bitfield<15, 0> limitLow;
868        Bitfield<47> p; // Present
869        Bitfield<46, 45> dpl; // Descriptor Privilege-Level
870        Bitfield<44> s; // System
871        SubBitUnion(type, 43, 40)
872            // Specifies whether this descriptor is for code or data.
873            Bitfield<43> codeOrData;
874
875            // These bit fields are for code segments
876            Bitfield<42> c; // Conforming
877            Bitfield<41> r; // Readable
878
879            // These bit fields are for data segments
880            Bitfield<42> e; // Expand-Down
881            Bitfield<41> w; // Writable
882
883            // This is used for both code and data segments.
884            Bitfield<40> a; // Accessed
885        EndSubBitUnion(type)
886    EndBitUnion(SegDescriptor)
887
888    BitUnion64(SegAttr)
889        Bitfield<1, 0> dpl;
890        Bitfield<2> unusable;
891        Bitfield<3> defaultSize;
892        Bitfield<4> longMode;
893        Bitfield<5> avl;
894        Bitfield<6> granularity;
895        Bitfield<7> present;
896        Bitfield<11, 8> type;
897        Bitfield<12> writable;
898        Bitfield<13> readable;
899        Bitfield<14> expandDown;
900        Bitfield<15> system;
901    EndBitUnion(SegAttr)
902
903    BitUnion64(GateDescriptor)
904        Bitfield<63, 48> offsetHigh; // Target Code-Segment Offset
905        Bitfield<15, 0> offsetLow; // Target Code-Segment Offset
906        Bitfield<31, 16> selector; // Target Code-Segment Selector
907        Bitfield<47> p; // Present
908        Bitfield<46, 45> dpl; // Descriptor Privilege-Level
909        Bitfield<43, 40> type;
910        Bitfield<36, 32> count; // Parameter Count
911    EndBitUnion(GateDescriptor)
912
913    /**
914     * Descriptor-Table Registers
915     */
916    BitUnion64(GDTR)
917    EndBitUnion(GDTR)
918
919    BitUnion64(IDTR)
920    EndBitUnion(IDTR)
921
922    BitUnion64(LDTR)
923    EndBitUnion(LDTR)
924
925    /**
926     * Task Register
927     */
928    BitUnion64(TR)
929    EndBitUnion(TR)
930
931
932    /**
933     * Local APIC Base Register
934     */
935    BitUnion64(LocalApicBase)
936        Bitfield<51, 12> base;
937        Bitfield<11> enable;
938        Bitfield<8> bsp;
939    EndBitUnion(LocalApicBase)
940}
941
942#endif // __ARCH_X86_INTREGS_HH__
943