gem5 v24.0.0.0
Loading...
Searching...
No Matches
misc.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions are
16 * met: redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer;
18 * redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution;
21 * neither the name of the copyright holders nor the names of its
22 * contributors may be used to endorse or promote products derived from
23 * this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef __ARCH_X86_MISCREGS_HH__
39#define __ARCH_X86_MISCREGS_HH__
40
43#include "base/bitunion.hh"
44#include "base/logging.hh"
45#include "cpu/reg_class.hh"
46#include "debug/MiscRegs.hh"
47
48//These get defined in some system headers (at least termbits.h). That confuses
49//things here significantly.
50#undef CR0
51#undef CR2
52#undef CR3
53
54namespace gem5
55{
56namespace X86ISA
57{
58
60{
61 CFBit = 1 << 0,
62 PFBit = 1 << 2,
63 ECFBit = 1 << 3,
64 AFBit = 1 << 4,
65 EZFBit = 1 << 5,
66 ZFBit = 1 << 6,
67 SFBit = 1 << 7,
68 DFBit = 1 << 10,
69 OFBit = 1 << 11
70};
71
72constexpr uint32_t CfofMask = CFBit | OFBit;
73constexpr uint32_t CcFlagMask = PFBit | AFBit | ZFBit | SFBit;
74
76{
77 TFBit = 1 << 8,
78 IFBit = 1 << 9,
79 NTBit = 1 << 14,
80 RFBit = 1 << 16,
81 VMBit = 1 << 17,
82 ACBit = 1 << 18,
83 VIFBit = 1 << 19,
84 VIPBit = 1 << 20,
85 IDBit = 1 << 21
86};
87
89{
90 // Exception Flags
91 IEBit = 1 << 0,
92 DEBit = 1 << 1,
93 ZEBit = 1 << 2,
94 OEBit = 1 << 3,
95 UEBit = 1 << 4,
96 PEBit = 1 << 5,
97
98 // !Exception Flags
99 StackFaultBit = 1 << 6,
101 CC0Bit = 1 << 8,
102 CC1Bit = 1 << 9,
103 CC2Bit = 1 << 10,
104 CC3Bit = 1 << 14,
105 BusyBit = 1 << 15,
106};
107
108namespace misc_reg
109{
110
111enum : RegIndex
112{
113 // Control registers
114 // Most of these are invalid. See isValid() below.
132
133 // Debug registers
143
144 // Flags register
146
147 //Register to keep handy values like the CPU mode in.
149
150 /*
151 * Model Specific Registers
152 */
153 // Time stamp counter
155
157
161
165
167
172
183
194
206
208
210
221
232
243
254
255 // Extended feature enable register
257
261
263
265
267
274
281
283
288
293
296
301
302 /*
303 * Segment registers
304 */
305 // Segment selectors
320
321 // Hidden segment base field
336
337 // The effective segment base, ie what is actually added to an
338 // address. In 64 bit mode this can be different from the above,
339 // namely 0.
354
355 // Hidden segment limit field
370
371 // Hidden segment limit attributes
386
387 // Floating point control registers
389
400
401 //XXX Add "Model-Specific Registers"
402
404
405 // "Fake" MSRs for internally implemented devices
407
410
411 NumRegs
413
414static inline bool
416{
417 return (index >= Cr0 && index < NumRegs &&
418 index != Cr1 &&
419 !(index > Cr4 && index < Cr8) &&
420 !(index > Cr8 && index <= Cr15));
421}
422
423static inline RegIndex
425{
426 assert(index >= 0 && index < NumCRegs);
427 return CrBase + index;
428}
429
430static inline RegIndex
432{
433 assert(index >= 0 && index < NumXCRegs);
434 return XcrBase + index;
435}
436
437static inline RegIndex
439{
440 assert(index >= 0 && index < NumDRegs);
441 return DrBase + index;
442}
443
444static inline RegIndex
446{
447 assert(index >= 0 && index < (MtrrPhysBaseEnd - MtrrPhysBaseBase));
448 return MtrrPhysBaseBase + index;
449}
450
451static inline RegIndex
453{
454 assert(index >= 0 && index < (MtrrPhysMaskEnd - MtrrPhysMaskBase));
455 return MtrrPhysMaskBase + index;
456}
457
458static inline RegIndex
460{
461 assert(index >= 0 && index < (McCtlEnd - McCtlBase));
462 return McCtlBase + index;
463}
464
465static inline RegIndex
467{
468 assert(index >= 0 && index < (McStatusEnd - McStatusBase));
469 return McStatusBase + index;
470}
471
472static inline RegIndex
474{
475 assert(index >= 0 && index < (McAddrEnd - McAddrBase));
476 return McAddrBase + index;
477}
478
479static inline RegIndex
481{
482 assert(index >= 0 && index < (McMiscEnd - McMiscBase));
483 return McMiscBase + index;
484}
485
486static inline RegIndex
488{
489 assert(index >= 0 && index < (PerfEvtSelEnd - PerfEvtSelBase));
490 return PerfEvtSelBase + index;
491}
492
493static inline RegIndex
495{
496 assert(index >= 0 && index < (PerfEvtCtrEnd - PerfEvtCtrBase));
497 return PerfEvtCtrBase + index;
498}
499
500static inline RegIndex
502{
503 assert(index >= 0 && index < (IorrBaseEnd - IorrBaseBase));
504 return IorrBaseBase + index;
505}
506
507static inline RegIndex
509{
510 assert(index >= 0 && index < (IorrMaskEnd - IorrMaskBase));
511 return IorrMaskBase + index;
512}
513
514static inline RegIndex
516{
517 assert(index >= 0 && index < segment_idx::NumIdxs);
518 return SegSelBase + index;
519}
520
521static inline RegIndex
523{
524 assert(index >= 0 && index < segment_idx::NumIdxs);
525 return SegBaseBase + index;
526}
527
528static inline RegIndex
530{
531 assert(index >= 0 && index < segment_idx::NumIdxs);
532 return SegEffBaseBase + index;
533}
534
535static inline RegIndex
537{
538 assert(index >= 0 && index < segment_idx::NumIdxs);
539 return SegLimitBase + index;
540}
541
542static inline RegIndex
544{
545 assert(index >= 0 && index < segment_idx::NumIdxs);
546 return SegAttrBase + index;
547}
548
549} // namespace misc_reg
550
552 misc_reg::NumRegs, debug::MiscRegs);
553
558BitUnion64(CCFlagBits)
559 Bitfield<11> of;
560 Bitfield<7> sf;
561 Bitfield<6> zf;
562 Bitfield<5> ezf;
563 Bitfield<4> af;
564 Bitfield<3> ecf;
565 Bitfield<2> pf;
566 Bitfield<0> cf;
567EndBitUnion(CCFlagBits)
568
569
572BitUnion64(RFLAGS)
573 Bitfield<21> id; // ID Flag
574 Bitfield<20> vip; // Virtual Interrupt Pending
575 Bitfield<19> vif; // Virtual Interrupt Flag
576 Bitfield<18> ac; // Alignment Check
577 Bitfield<17> vm; // Virtual-8086 Mode
578 Bitfield<16> rf; // Resume Flag
579 Bitfield<14> nt; // Nested Task
580 Bitfield<13, 12> iopl; // I/O Privilege Level
581 Bitfield<11> of; // Overflow Flag
582 Bitfield<10> df; // Direction Flag
583 Bitfield<9> intf; // Interrupt Flag
584 Bitfield<8> tf; // Trap Flag
585 Bitfield<7> sf; // Sign Flag
586 Bitfield<6> zf; // Zero Flag
587 Bitfield<4> af; // Auxiliary Flag
588 Bitfield<2> pf; // Parity Flag
589 Bitfield<0> cf; // Carry Flag
591
592BitUnion64(HandyM5Reg)
593 Bitfield<0> mode;
594 Bitfield<3, 1> submode;
595 Bitfield<5, 4> cpl;
596 Bitfield<6> paging;
597 Bitfield<7> prot;
598 Bitfield<9, 8> defOp;
599 Bitfield<11, 10> altOp;
600 Bitfield<13, 12> defAddr;
601 Bitfield<15, 14> altAddr;
602 Bitfield<17, 16> stack;
603EndBitUnion(HandyM5Reg)
604
605
608BitUnion64(CR0)
609 Bitfield<31> pg; // Paging
610 Bitfield<30> cd; // Cache Disable
611 Bitfield<29> nw; // Not Writethrough
612 Bitfield<18> am; // Alignment Mask
613 Bitfield<16> wp; // Write Protect
614 Bitfield<5> ne; // Numeric Error
615 Bitfield<4> et; // Extension Type
616 Bitfield<3> ts; // Task Switched
617 Bitfield<2> em; // Emulation
618 Bitfield<1> mp; // Monitor Coprocessor
619 Bitfield<0> pe; // Protection Enabled
621
622// Page Fault Virtual Address
623BitUnion64(CR2)
624 Bitfield<31, 0> legacy;
626
627BitUnion64(CR3)
628 Bitfield<51, 12> longPdtb; // Long Mode Page-Directory-Table
629 // Base Address
630 Bitfield<31, 12> pdtb; // Non-PAE Addressing Page-Directory-Table
631 // Base Address
632 Bitfield<31, 5> paePdtb; // PAE Addressing Page-Directory-Table
633 // Base Address
634 Bitfield<11, 0> pcid; // Process-Context Identifier
635 Bitfield<4> pcd; // Page-Level Cache Disable
636 Bitfield<3> pwt; // Page-Level Writethrough
638
639BitUnion64(CR4)
640 Bitfield<18> osxsave; // Enable XSAVE and Proc Extended States
641 Bitfield<17> pcide; // PCID Enable
642 Bitfield<16> fsgsbase; // Enable RDFSBASE, RDGSBASE, WRFSBASE,
643 // WRGSBASE instructions
644 Bitfield<10> osxmmexcpt; // Operating System Unmasked
645 // Exception Support
646 Bitfield<9> osfxsr; // Operating System FXSave/FSRSTOR Support
647 Bitfield<8> pce; // Performance-Monitoring Counter Enable
648 Bitfield<7> pge; // Page-Global Enable
649 Bitfield<6> mce; // Machine Check Enable
650 Bitfield<5> pae; // Physical-Address Extension
651 Bitfield<4> pse; // Page Size Extensions
652 Bitfield<3> de; // Debugging Extensions
653 Bitfield<2> tsd; // Time Stamp Disable
654 Bitfield<1> pvi; // Protected-Mode Virtual Interrupts
655 Bitfield<0> vme; // Virtual-8086 Mode Extensions
657
658BitUnion64(CR8)
659 Bitfield<3, 0> tpr; // Task Priority Register
661
662BitUnion64(XCR0)
663 Bitfield<0> x87; // x87 FPU/MMX support (must be 1)
664 Bitfield<1> sse; // XSAVE support for MXCSR and XMM registers
665 Bitfield<2> avx; // AVX enabled and XSAVE support for upper halves of YMM
666 // registers
667 Bitfield<3> bndreg; // MPX enabled and XSAVE support for BND0-BND3
668 // registers
669 Bitfield<4> bndsrc; // MPX enabled and XSAVE support for BNDCFGU and
670 // BNDSTATUS registers
671 Bitfield<5> opmask; // AVX-512 enabled and XSAVE support for opmask
672 // registers k0-k7
673 Bitfield<6> zmm_hi256; // AVX-512 enabled and XSAVE support for upper
674 // halves of lower ZMM registers
675 Bitfield<7> hi16_zmm; // AVX-512 enabled and XSAVE support for upper ZMM
676 // registers
677 Bitfield<9> pkru; // XSAVE support for PKRU register
679
680BitUnion64(DR6)
681 Bitfield<0> b0;
682 Bitfield<1> b1;
683 Bitfield<2> b2;
684 Bitfield<3> b3;
685 Bitfield<13> bd;
686 Bitfield<14> bs;
687 Bitfield<15> bt;
689
690BitUnion64(DR7)
691 Bitfield<0> l0;
692 Bitfield<1> g0;
693 Bitfield<2> l1;
694 Bitfield<3> g1;
695 Bitfield<4> l2;
696 Bitfield<5> g2;
697 Bitfield<6> l3;
698 Bitfield<7> g3;
699 Bitfield<8> le;
700 Bitfield<9> ge;
701 Bitfield<13> gd;
702 Bitfield<17, 16> rw0;
703 Bitfield<19, 18> len0;
704 Bitfield<21, 20> rw1;
705 Bitfield<23, 22> len1;
706 Bitfield<25, 24> rw2;
707 Bitfield<27, 26> len2;
708 Bitfield<29, 28> rw3;
709 Bitfield<31, 30> len3;
711
712// MTRR capabilities
713BitUnion64(MTRRcap)
714 Bitfield<7, 0> vcnt; // Variable-Range Register Count
715 Bitfield<8> fix; // Fixed-Range Registers
716 Bitfield<10> wc; // Write-Combining
718
722BitUnion64(SysenterCS)
723 Bitfield<15, 0> targetCS;
724EndBitUnion(SysenterCS)
725
726BitUnion64(SysenterESP)
727 Bitfield<31, 0> targetESP;
728EndBitUnion(SysenterESP)
729
730BitUnion64(SysenterEIP)
731 Bitfield<31, 0> targetEIP;
732EndBitUnion(SysenterEIP)
733
737BitUnion64(McgCap)
738 Bitfield<7, 0> count; // Number of error reporting register banks
739 Bitfield<8> MCGCP; // MCG_CTL register present.
741
742BitUnion64(McgStatus)
743 Bitfield<0> ripv; // Restart-IP valid
744 Bitfield<1> eipv; // Error-IP valid
745 Bitfield<2> mcip; // Machine check in-progress
746EndBitUnion(McgStatus)
747
748BitUnion64(DebugCtlMsr)
749 Bitfield<0> lbr; // Last-branch record
750 Bitfield<1> btf; // Branch single step
751 Bitfield<2> pb0; // Performance monitoring pin control 0
752 Bitfield<3> pb1; // Performance monitoring pin control 1
753 Bitfield<4> pb2; // Performance monitoring pin control 2
754 Bitfield<5> pb3; // Performance monitoring pin control 3
755 /*uint64_t pb(int index)
756 {
757 return bits(__data, index + 2);
758 }*/
759EndBitUnion(DebugCtlMsr)
760
761BitUnion64(MtrrPhysBase)
762 Bitfield<7, 0> type; // Default memory type
763 Bitfield<51, 12> physbase; // Range physical base address
764EndBitUnion(MtrrPhysBase)
765
766BitUnion64(MtrrPhysMask)
767 Bitfield<11> valid; // MTRR pair enable
768 Bitfield<51, 12> physmask; // Range physical mask
769EndBitUnion(MtrrPhysMask)
770
771BitUnion64(MtrrFixed)
772 /*uint64_t type(int index)
773 {
774 return bits(__data, index * 8 + 7, index * 8);
775 }*/
776EndBitUnion(MtrrFixed)
777
778BitUnion64(Pat)
779 /*uint64_t pa(int index)
780 {
781 return bits(__data, index * 8 + 2, index * 8);
782 }*/
783EndBitUnion(Pat)
784
785BitUnion64(MtrrDefType)
786 Bitfield<7, 0> type; // Default type
787 Bitfield<10> fe; // Fixed range enable
788 Bitfield<11> e; // MTRR enable
789EndBitUnion(MtrrDefType)
790
794BitUnion64(McStatus)
795 Bitfield<15,0> mcaErrorCode;
796 Bitfield<31,16> modelSpecificCode;
797 Bitfield<56,32> otherInfo;
798 Bitfield<57> pcc; // Processor-context corrupt
799 Bitfield<58> addrv; // Error-address register valid
800 Bitfield<59> miscv; // Miscellaneous-error register valid
801 Bitfield<60> en; // Error condition enabled
802 Bitfield<61> uc; // Uncorrected error
803 Bitfield<62> over; // Status register overflow
804 Bitfield<63> val; // Valid
805EndBitUnion(McStatus)
806
807BitUnion64(McCtl)
808 /*uint64_t en(int index)
809 {
810 return bits(__data, index);
811 }*/
812EndBitUnion(McCtl)
813
814// Extended feature enable register
815BitUnion64(Efer)
816 Bitfield<0> sce; // System call extensions
817 Bitfield<8> lme; // Long mode enable
818 Bitfield<10> lma; // Long mode active
819 Bitfield<11> nxe; // No-execute enable
820 Bitfield<12> svme; // Secure virtual machine enable
821 Bitfield<14> ffxsr; // Fast fxsave/fxrstor
823
824BitUnion64(Star)
825 Bitfield<31,0> targetEip;
826 Bitfield<47,32> syscallCsAndSs;
827 Bitfield<63,48> sysretCsAndSs;
829
830BitUnion64(SfMask)
831 Bitfield<31,0> mask;
833
834BitUnion64(PerfEvtSel)
835 Bitfield<7,0> eventMask;
836 Bitfield<15,8> unitMask;
837 Bitfield<16> usr; // User mode
838 Bitfield<17> os; // Operating-system mode
839 Bitfield<18> e; // Edge detect
840 Bitfield<19> pc; // Pin control
841 Bitfield<20> intEn; // Interrupt enable
842 Bitfield<22> en; // Counter enable
843 Bitfield<23> inv; // Invert mask
844 Bitfield<31,24> counterMask;
845EndBitUnion(PerfEvtSel)
846
847BitUnion32(Syscfg)
848 Bitfield<18> mfde; // MtrrFixDramEn
849 Bitfield<19> mfdm; // MtrrFixDramModEn
850 Bitfield<20> mvdm; // MtrrVarDramEn
851 Bitfield<21> tom2; // MtrrTom2En
853
854BitUnion64(IorrBase)
855 Bitfield<3> wr; // WrMem Enable
856 Bitfield<4> rd; // RdMem Enable
857 Bitfield<51,12> physbase; // Range physical base address
858EndBitUnion(IorrBase)
859
860BitUnion64(IorrMask)
861 Bitfield<11> v; // I/O register pair enable (valid)
862 Bitfield<51,12> physmask; // Range physical mask
863EndBitUnion(IorrMask)
864
865BitUnion64(Tom)
866 Bitfield<51,23> physAddr; // Top of memory physical address
868
869BitUnion64(VmCrMsr)
870 Bitfield<0> dpd;
871 Bitfield<1> rInit;
872 Bitfield<2> disA20M;
874
875BitUnion64(IgnneMsr)
876 Bitfield<0> ignne;
877EndBitUnion(IgnneMsr)
878
879BitUnion64(SmmCtlMsr)
880 Bitfield<0> dismiss;
881 Bitfield<1> enter;
882 Bitfield<2> smiCycle;
883 Bitfield<3> exit;
884 Bitfield<4> rsmCycle;
885EndBitUnion(SmmCtlMsr)
886
890BitUnion64(SegSelector)
891 // The following bitfield is not defined in the ISA, but it's useful
892 // when checking selectors in larger data types to make sure they
893 // aren't too large.
894 Bitfield<63, 3> esi; // Extended selector
895 Bitfield<15, 3> si; // Selector Index
896 Bitfield<2> ti; // Table Indicator
897 Bitfield<1, 0> rpl; // Requestor Privilege Level
898EndBitUnion(SegSelector)
899
904class SegDescriptorBase
905{
906 public:
907 uint32_t
908 getter(const uint64_t &storage) const
909 {
910 return (bits(storage, 63, 56) << 24) | bits(storage, 39, 16);
911 }
912
913 void
914 setter(uint64_t &storage, uint32_t base)
915 {
916 replaceBits(storage, 63, 56, bits(base, 31, 24));
917 replaceBits(storage, 39, 16, bits(base, 23, 0));
918 }
919};
920
922{
923 public:
924 uint32_t
925 getter(const uint64_t &storage) const
926 {
927 uint32_t limit = (bits(storage, 51, 48) << 16) |
928 bits(storage, 15, 0);
929 if (bits(storage, 55))
930 limit = (limit << 12) | mask(12);
931 return limit;
932 }
933
934 void
935 setter(uint64_t &storage, uint32_t limit)
936 {
937 bool g = (bits(limit, 31, 24) != 0);
938 panic_if(g && bits(limit, 11, 0) != mask(12),
939 "Inlimitid segment limit %#x", limit);
940 if (g)
941 limit = limit >> 12;
942 replaceBits(storage, 51, 48, bits(limit, 23, 16));
943 replaceBits(storage, 15, 0, bits(limit, 15, 0));
944 replaceBits(storage, 55, g ? 1 : 0);
945 }
946};
947
948BitUnion64(SegDescriptor)
949 Bitfield<63, 56> baseHigh;
950 Bitfield<39, 16> baseLow;
951 BitfieldType<SegDescriptorBase> base;
952 Bitfield<55> g; // Granularity
953 Bitfield<54> d; // Default Operand Size
954 Bitfield<54> b; // Default Operand Size
955 Bitfield<53> l; // Long Attribute Bit
956 Bitfield<52> avl; // Available To Software
957 Bitfield<51, 48> limitHigh;
958 Bitfield<15, 0> limitLow;
960 Bitfield<47> p; // Present
961 Bitfield<46, 45> dpl; // Descriptor Privilege-Level
962 Bitfield<44> s; // System
964 // Specifies whether this descriptor is for code or data.
965 Bitfield<43> codeOrData;
966
967 // These bit fields are for code segments
968 Bitfield<42> c; // Conforming
969 Bitfield<41> r; // Readable
970
971 // These bit fields are for data segments
972 Bitfield<42> e; // Expand-Down
973 Bitfield<41> w; // Writable
974
975 // This is used for both code and data segments.
976 Bitfield<40> a; // Accessed
978EndBitUnion(SegDescriptor)
979
984BitUnion64(TSSlow)
985 Bitfield<63, 56> baseHigh;
986 Bitfield<39, 16> baseLow;
987 BitfieldType<SegDescriptorBase> base;
988 Bitfield<55> g; // Granularity
989 Bitfield<52> avl; // Available To Software
990 Bitfield<51, 48> limitHigh;
991 Bitfield<15, 0> limitLow;
993 Bitfield<47> p; // Present
994 Bitfield<46, 45> dpl; // Descriptor Privilege-Level
995 SubBitUnion(type, 43, 40)
996 // Specifies whether this descriptor is for code or data.
997 Bitfield<43> codeOrData;
998
999 // These bit fields are for code segments
1000 Bitfield<42> c; // Conforming
1001 Bitfield<41> r; // Readable
1002
1003 // These bit fields are for data segments
1004 Bitfield<42> e; // Expand-Down
1005 Bitfield<41> w; // Writable
1006
1007 // This is used for both code and data segments.
1008 Bitfield<40> a; // Accessed
1010EndBitUnion(TSSlow)
1011
1016BitUnion64(TSShigh)
1017 Bitfield<31, 0> base;
1019
1020BitUnion64(SegAttr)
1021 Bitfield<1, 0> dpl;
1022 Bitfield<2> unusable;
1023 Bitfield<3> defaultSize;
1024 Bitfield<4> longMode;
1025 Bitfield<5> avl;
1026 Bitfield<6> granularity;
1027 Bitfield<7> present;
1028 Bitfield<11, 8> type;
1029 Bitfield<12> writable;
1030 Bitfield<13> readable;
1031 Bitfield<14> expandDown;
1032 Bitfield<15> system;
1034
1035BitUnion64(GateDescriptor)
1036 Bitfield<63, 48> offsetHigh; // Target Code-Segment Offset
1037 Bitfield<15, 0> offsetLow; // Target Code-Segment Offset
1038 Bitfield<31, 16> selector; // Target Code-Segment Selector
1039 Bitfield<47> p; // Present
1040 Bitfield<46, 45> dpl; // Descriptor Privilege-Level
1041 Bitfield<43, 40> type;
1042 Bitfield<36, 32> count; // Parameter Count
1043EndBitUnion(GateDescriptor)
1044
1048BitUnion64(GateDescriptorLow)
1049 Bitfield<63, 48> offsetHigh; // Target Code-Segment Offset
1050 Bitfield<47> p; // Present
1051 Bitfield<46, 45> dpl; // Descriptor Privilege-Level
1052 Bitfield<43, 40> type;
1053 Bitfield<35, 32> IST; // IST pointer to TSS, new stack for exceptions
1054 Bitfield<31, 16> selector; // Target Code-Segment Selector
1055 Bitfield<15, 0> offsetLow; // Target Code-Segment Offset
1056EndBitUnion(GateDescriptorLow)
1057
1058BitUnion64(GateDescriptorHigh)
1059 Bitfield<31, 0> offset; // Target Code-Segment Offset
1060EndBitUnion(GateDescriptorHigh)
1061
1065BitUnion64(GDTR)
1066EndBitUnion(GDTR)
1067
1068BitUnion64(IDTR)
1069EndBitUnion(IDTR)
1070
1071BitUnion64(LDTR)
1072EndBitUnion(LDTR)
1073
1077BitUnion64(TR)
1078EndBitUnion(TR)
1079
1080
1084BitUnion64(LocalApicBase)
1085 Bitfield<51, 12> base;
1086 Bitfield<11> enable;
1087 Bitfield<8> bsp;
1088EndBitUnion(LocalApicBase)
1089
1090} // namespace X86ISA
1091} // namespace gem5
1092
1093#endif // __ARCH_X86_INTREGS_HH__
#define BitUnion32(name)
Definition bitunion.hh:495
void setter(uint64_t &storage, uint32_t limit)
Definition misc.hh:935
uint32_t getter(const uint64_t &storage) const
Definition misc.hh:925
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition bitfield.hh:79
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Definition bitfield.hh:216
#define BitUnion64(name)
Use this to define conveniently sized values overlayed with bitfields.
Definition bitunion.hh:494
#define EndBitUnion(name)
This closes off the class and union started by the above macro.
Definition bitunion.hh:428
#define SubBitUnion(name, first, last)
Regular bitfields These define macros for read/write regular bitfield based subbitfields.
Definition bitunion.hh:470
#define EndSubBitUnion(name)
This closes off the union created above and gives it a name.
Definition bitunion.hh:455
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition logging.hh:214
Bitfield< 33 > id
constexpr RegClass miscRegClass
Definition misc.hh:2937
Bitfield< 3 > wr
Bitfield< 4 > dr
Definition misc.hh:123
Bitfield< 3, 0 > b0
Definition qarma.hh:66
static bool isValid(int index)
Definition misc.hh:415
static RegIndex mcStatus(int index)
Definition misc.hh:466
static RegIndex cr(int index)
Definition misc.hh:424
static RegIndex mtrrPhysBase(int index)
Definition misc.hh:445
static RegIndex iorrMask(int index)
Definition misc.hh:508
static RegIndex mcMisc(int index)
Definition misc.hh:480
static RegIndex perfEvtCtr(int index)
Definition misc.hh:494
static RegIndex segSel(int index)
Definition misc.hh:515
static RegIndex segAttr(int index)
Definition misc.hh:543
static RegIndex perfEvtSel(int index)
Definition misc.hh:487
static RegIndex xcr(int index)
Definition misc.hh:431
static RegIndex segBase(int index)
Definition misc.hh:522
static RegIndex segLimit(int index)
Definition misc.hh:536
static RegIndex mcCtl(int index)
Definition misc.hh:459
static RegIndex iorrBase(int index)
Definition misc.hh:501
static RegIndex mtrrPhysMask(int index)
Definition misc.hh:452
static RegIndex segEffBase(int index)
Definition misc.hh:529
static RegIndex mcAddr(int index)
Definition misc.hh:473
Bitfield< 19 > pc
Definition misc.hh:840
Bitfield< 1 > w
Definition pagetable.hh:150
Bitfield< 8 > g
Definition pagetable.hh:143
Bitfield< 21, 20 > rw1
Definition misc.hh:704
Bitfield< 46, 45 > dpl
Definition misc.hh:961
Bitfield< 35, 32 > IST
Definition misc.hh:1053
Bitfield< 10 > osxmmexcpt
Definition misc.hh:644
Bitfield< 15, 14 > altAddr
Definition misc.hh:601
Bitfield< 5 > pae
Definition misc.hh:650
Bitfield< 0 > vme
Definition misc.hh:655
Bitfield< 3 > ecf
Definition misc.hh:564
Bitfield< 2 > b2
Definition misc.hh:683
Bitfield< 29, 28 > rw3
Definition misc.hh:708
Bitfield< 8 > lme
Definition misc.hh:817
Bitfield< 23, 22 > len1
Definition misc.hh:705
Bitfield< 17, 16 > rw0
Definition misc.hh:702
Bitfield< 15 > system
Definition misc.hh:1032
Bitfield< 18 > am
Definition misc.hh:612
Bitfield< 7 > g3
Definition misc.hh:698
Bitfield< 11, 10 > altOp
Definition misc.hh:599
Bitfield< 1 > rInit
Definition misc.hh:871
Bitfield< 60 > en
Definition misc.hh:801
Bitfield< 11 > enable
Definition misc.hh:1086
Bitfield< 0 > pe
Definition misc.hh:619
Bitfield< 3 > pb1
Definition misc.hh:752
Bitfield< 10 > lma
Definition misc.hh:818
Bitfield< 3, 1 > submode
Definition misc.hh:594
const int NumXCRegs
Definition x86_traits.hh:58
Bitfield< 4 > longMode
Definition misc.hh:1024
Bitfield< 17 > vm
Definition misc.hh:577
Bitfield< 31, 16 > modelSpecificCode
Definition misc.hh:796
Bitfield< 9, 8 > defOp
Definition misc.hh:598
Bitfield< 13 > gd
Definition misc.hh:701
Bitfield< 51, 48 > limitHigh
Definition misc.hh:957
Bitfield< 7 > hi16_zmm
Definition misc.hh:675
Bitfield< 17, 16 > stack
Definition misc.hh:602
Bitfield< 31, 24 > counterMask
Definition misc.hh:844
Bitfield< 6 > mce
Definition misc.hh:649
Bitfield< 4 > pb2
Definition misc.hh:753
Bitfield< 8 > bsp
Definition misc.hh:1087
Bitfield< 11 > of
Definition misc.hh:581
Bitfield< 6 > zmm_hi256
Definition misc.hh:673
Bitfield< 12 > svme
Definition misc.hh:820
Bitfield< 51, 12 > base
Definition pagetable.hh:141
Bitfield< 4 > pse
Definition misc.hh:651
Bitfield< 17 > os
Definition misc.hh:838
const int NumCRegs
Definition x86_traits.hh:56
Bitfield< 1 > enter
Definition misc.hh:881
Bitfield< 14 > expandDown
Definition misc.hh:1031
Bitfield< 63, 48 > sysretCsAndSs
Definition misc.hh:827
Bitfield< 19, 18 > len0
Definition misc.hh:703
Bitfield< 1 > mp
Definition misc.hh:618
Bitfield< 58 > addrv
Definition misc.hh:799
Bitfield< 39, 16 > baseLow
Definition misc.hh:950
Bitfield< 63 > val
Definition misc.hh:804
Bitfield< 3 > b3
Definition misc.hh:684
Bitfield< 56, 32 > otherInfo
Definition misc.hh:797
Bitfield< 7 > sf
Definition misc.hh:560
Bitfield< 2 > unusable
Definition misc.hh:1022
Bitfield< 19 > mfdm
Definition misc.hh:849
Bitfield< 54 > b
Definition misc.hh:954
Bitfield< 59 > miscv
Definition misc.hh:800
Bitfield< 1 > btf
Definition misc.hh:750
Bitfield< 5, 4 > cpl
Definition misc.hh:595
Bitfield< 2 > l1
Definition misc.hh:693
Bitfield< 6 > d
Definition pagetable.hh:145
Bitfield< 2 > pb0
Definition misc.hh:751
Bitfield< 27, 26 > len2
Definition misc.hh:707
Bitfield< 2 > ti
Definition misc.hh:896
Bitfield< 10 > wc
Definition misc.hh:716
Bitfield< 1 > g0
Definition misc.hh:692
Bitfield< 3 > exit
Definition misc.hh:883
BitfieldType< SegDescriptorLimit > limit
Definition misc.hh:959
Bitfield< 61 > uc
Definition misc.hh:802
Bitfield< 7 > present
Definition misc.hh:1027
Bitfield< 31, 16 > selector
Definition misc.hh:1038
Bitfield< 31, 30 > len3
Definition misc.hh:709
Bitfield< 5 > opmask
Definition misc.hh:671
Bitfield< 4 > bndsrc
Definition misc.hh:669
@ StackFaultBit
Definition misc.hh:99
@ ErrSummaryBit
Definition misc.hh:100
Bitfield< 9 > osfxsr
Definition misc.hh:646
Bitfield< 42 > c
Definition misc.hh:968
Bitfield< 9 > pkru
Definition misc.hh:677
constexpr uint32_t CcFlagMask
Definition misc.hh:73
Bitfield< 57 > pcc
Definition misc.hh:798
Bitfield< 62 > over
Definition misc.hh:803
Bitfield< 3 > bndreg
Definition misc.hh:667
Bitfield< 1 > eipv
Definition misc.hh:744
Bitfield< 7 > pge
Definition misc.hh:648
Bitfield< 18 > ac
Definition misc.hh:576
Bitfield< 23 > inv
Definition misc.hh:843
Bitfield< 3 > defaultSize
Definition misc.hh:1023
Bitfield< 15, 0 > limitLow
Definition misc.hh:958
Bitfield< 3 > ts
Definition misc.hh:616
Bitfield< 31, 5 > paePdtb
Definition misc.hh:632
Bitfield< 13 > bd
Definition misc.hh:685
Bitfield< 19 > vif
Definition misc.hh:575
Bitfield< 10 > fe
Definition misc.hh:787
Bitfield< 2 > em
Definition misc.hh:617
Bitfield< 1 > pvi
Definition misc.hh:654
Bitfield< 13, 12 > defAddr
Definition misc.hh:600
Bitfield< 13, 12 > iopl
Definition misc.hh:580
Bitfield< 15, 3 > si
Definition misc.hh:895
Bitfield< 20 > intEn
Definition misc.hh:841
Bitfield< 8 > fix
Definition misc.hh:715
Bitfield< 21 > tom2
Definition misc.hh:851
Bitfield< 9 > ge
Definition misc.hh:700
Bitfield< 0 > cf
Definition misc.hh:566
Bitfield< 3 > g1
Definition misc.hh:694
Bitfield< 5 > ezf
Definition misc.hh:562
Bitfield< 2 > smiCycle
Definition misc.hh:882
Bitfield< 20 > mvdm
Definition misc.hh:850
Bitfield< 4 > l2
Definition misc.hh:695
Bitfield< 2 > tsd
Definition misc.hh:653
Bitfield< 14 > ffxsr
Definition misc.hh:821
Bitfield< 8 > pce
Definition misc.hh:647
Bitfield< 11 > nxe
Definition misc.hh:819
Bitfield< 4 > pcd
Definition pagetable.hh:147
Bitfield< 2 > avx
Definition misc.hh:665
Bitfield< 1, 0 > rpl
Definition misc.hh:897
Bitfield< 14 > nt
Definition misc.hh:579
Bitfield< 8 > MCGCP
Definition misc.hh:739
Bitfield< 4 > rsmCycle
Definition misc.hh:884
Bitfield< 3 > mode
Definition types.hh:192
Bitfield< 0 > p
Definition pagetable.hh:151
Bitfield< 13 > readable
Definition misc.hh:1030
Bitfield< 31, 12 > pdtb
Definition misc.hh:630
Bitfield< 51, 12 > physmask
Definition misc.hh:768
Bitfield< 6 > paging
Definition misc.hh:596
Bitfield< 5 > ne
Definition misc.hh:614
Bitfield< 25, 24 > rw2
Definition misc.hh:706
Bitfield< 17 > pcide
Definition misc.hh:641
Bitfield< 4 > rd
Definition misc.hh:856
Bitfield< 5, 3 > index
Definition types.hh:98
Bitfield< 8 > tf
Definition misc.hh:584
Bitfield< 15 > bt
Definition misc.hh:687
Bitfield< 41 > r
Definition misc.hh:969
Bitfield< 29 > nw
Definition misc.hh:611
Bitfield< 8 > le
Definition misc.hh:699
Bitfield< 7 > prot
Definition misc.hh:597
Bitfield< 16 > usr
Definition misc.hh:837
constexpr uint32_t CfofMask
Definition misc.hh:72
Bitfield< 1 > b1
Definition misc.hh:682
Bitfield< 9 > intf
Definition misc.hh:583
Bitfield< 51, 12 > physbase
Definition misc.hh:763
Bitfield< 11 > e
Definition misc.hh:788
Bitfield< 11, 0 > pcid
Definition misc.hh:634
Bitfield< 5 > pb3
Definition misc.hh:754
Bitfield< 2 > mcip
Definition misc.hh:745
const int NumDRegs
Definition x86_traits.hh:57
Bitfield< 6 > granularity
Definition misc.hh:1026
Bitfield< 2 > pf
Definition misc.hh:565
Bitfield< 16 > wp
Definition misc.hh:613
Bitfield< 4 > af
Definition misc.hh:563
Bitfield< 6, 3 > v
Definition types.hh:125
Bitfield< 6 > zf
Definition misc.hh:561
Bitfield< 15, 0 > offsetLow
Definition misc.hh:1037
Bitfield< 44 > s
Definition misc.hh:962
Bitfield< 4 > et
Definition misc.hh:615
Bitfield< 16 > rf
Definition misc.hh:578
Bitfield< 20 > vip
Definition misc.hh:574
Bitfield< 1 > sse
Definition misc.hh:664
Bitfield< 2 > disA20M
Definition misc.hh:872
Bitfield< 53 > l
Definition misc.hh:955
Bitfield< 6 > l3
Definition misc.hh:697
Bitfield< 10 > df
Definition misc.hh:582
Bitfield< 12 > writable
Definition misc.hh:1029
Bitfield< 15, 8 > unitMask
Definition misc.hh:836
Bitfield< 5 > g2
Definition misc.hh:696
Bitfield< 30 > cd
Definition misc.hh:610
Bitfield< 5 > a
Definition pagetable.hh:146
Bitfield< 3 > de
Definition misc.hh:652
Bitfield< 14 > bs
Definition misc.hh:686
Bitfield< 47, 32 > syscallCsAndSs
Definition misc.hh:826
Bitfield< 16 > fsgsbase
Definition misc.hh:642
Bitfield< 3 > pwt
Definition pagetable.hh:148
Bitfield< 11, 9 > avl
Definition pagetable.hh:142
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint16_t RegIndex
Definition types.hh:176
constexpr char MiscRegClassName[]
Definition reg_class.hh:82
Bitfield< 15 > lbr
Definition x86_cpu.cc:133
@ MiscRegClass
Control (misc) register.
Definition reg_class.hh:70

Generated on Tue Jun 18 2024 16:24:04 for gem5 by doxygen 1.11.0