gem5  v20.0.0.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
41 #include "arch/x86/regs/segment.hh"
42 #include "arch/x86/x86_traits.hh"
43 #include "base/bitunion.hh"
44 #include "base/logging.hh"
45 
46 //These get defined in some system headers (at least termbits.h). That confuses
47 //things here significantly.
48 #undef CR0
49 #undef CR2
50 #undef CR3
51 
52 namespace X86ISA
53 {
54  enum CondFlagBit {
55  CFBit = 1 << 0,
56  PFBit = 1 << 2,
57  ECFBit = 1 << 3,
58  AFBit = 1 << 4,
59  EZFBit = 1 << 5,
60  ZFBit = 1 << 6,
61  SFBit = 1 << 7,
62  DFBit = 1 << 10,
63  OFBit = 1 << 11
64  };
65 
66  const uint32_t cfofMask = CFBit | OFBit;
67  const uint32_t ccFlagMask = PFBit | AFBit | ZFBit | SFBit;
68 
69  enum RFLAGBit {
70  TFBit = 1 << 8,
71  IFBit = 1 << 9,
72  NTBit = 1 << 14,
73  RFBit = 1 << 16,
74  VMBit = 1 << 17,
75  ACBit = 1 << 18,
76  VIFBit = 1 << 19,
77  VIPBit = 1 << 20,
78  IDBit = 1 << 21
79  };
80 
81  enum X87StatusBit {
82  // Exception Flags
83  IEBit = 1 << 0,
84  DEBit = 1 << 1,
85  ZEBit = 1 << 2,
86  OEBit = 1 << 3,
87  UEBit = 1 << 4,
88  PEBit = 1 << 5,
89 
90  // !Exception Flags
91  StackFaultBit = 1 << 6,
92  ErrSummaryBit = 1 << 7,
93  CC0Bit = 1 << 8,
94  CC1Bit = 1 << 9,
95  CC2Bit = 1 << 10,
96  CC3Bit = 1 << 14,
97  BusyBit = 1 << 15,
98  };
99 
101  {
102  // Control registers
103  // Most of these are invalid. See isValidMiscReg() below.
121 
122  // Debug registers
132 
133  // Flags register
135 
136  //Register to keep handy values like the CPU mode in.
138 
139  /*
140  * Model Specific Registers
141  */
142  // Time stamp counter
144 
146 
150 
154 
156 
161 
172 
183 
195 
197 
199 
210 
221 
232 
243 
244  // Extended feature enable register
246 
250 
252 
254 
256 
263 
270 
272 
277 
282 
285 
290 
291  /*
292  * Segment registers
293  */
294  // Segment selectors
309 
310  // Hidden segment base field
325 
326  // The effective segment base, ie what is actually added to an
327  // address. In 64 bit mode this can be different from the above,
328  // namely 0.
343 
344  // Hidden segment limit field
359 
360  // Hidden segment limit attributes
375 
376  // Floating point control registers
379 
390 
391  //XXX Add "Model-Specific Registers"
392 
394 
395  // "Fake" MSRs for internally implemented devices
397 
399  };
400 
401  static inline bool
403  {
404  return (index >= MISCREG_CR0 && index < NUM_MISCREGS &&
405  index != MISCREG_CR1 &&
406  !(index > MISCREG_CR4 && index < MISCREG_CR8) &&
407  !(index > MISCREG_CR8 && index <= MISCREG_CR15));
408  }
409 
410  static inline MiscRegIndex
412  {
413  assert(index >= 0 && index < NumCRegs);
414  return (MiscRegIndex)(MISCREG_CR_BASE + index);
415  }
416 
417  static inline MiscRegIndex
419  {
420  assert(index >= 0 && index < NumDRegs);
421  return (MiscRegIndex)(MISCREG_DR_BASE + index);
422  }
423 
424  static inline MiscRegIndex
426  {
427  assert(index >= 0 && index < (MISCREG_MTRR_PHYS_BASE_END -
430  }
431 
432  static inline MiscRegIndex
434  {
435  assert(index >= 0 && index < (MISCREG_MTRR_PHYS_MASK_END -
438  }
439 
440  static inline MiscRegIndex
442  {
443  assert(index >= 0 && index < (MISCREG_MC_CTL_END -
446  }
447 
448  static inline MiscRegIndex
450  {
451  assert(index >= 0 && index < (MISCREG_MC_STATUS_END -
454  }
455 
456  static inline MiscRegIndex
458  {
459  assert(index >= 0 && index < (MISCREG_MC_ADDR_END -
462  }
463 
464  static inline MiscRegIndex
466  {
467  assert(index >= 0 && index < (MISCREG_MC_MISC_END -
470  }
471 
472  static inline MiscRegIndex
474  {
475  assert(index >= 0 && index < (MISCREG_PERF_EVT_SEL_END -
478  }
479 
480  static inline MiscRegIndex
482  {
483  assert(index >= 0 && index < (MISCREG_PERF_EVT_CTR_END -
486  }
487 
488  static inline MiscRegIndex
490  {
491  assert(index >= 0 && index < (MISCREG_IORR_BASE_END -
494  }
495 
496  static inline MiscRegIndex
498  {
499  assert(index >= 0 && index < (MISCREG_IORR_MASK_END -
502  }
503 
504  static inline MiscRegIndex
506  {
507  assert(index >= 0 && index < NUM_SEGMENTREGS);
509  }
510 
511  static inline MiscRegIndex
513  {
514  assert(index >= 0 && index < NUM_SEGMENTREGS);
516  }
517 
518  static inline MiscRegIndex
520  {
521  assert(index >= 0 && index < NUM_SEGMENTREGS);
523  }
524 
525  static inline MiscRegIndex
527  {
528  assert(index >= 0 && index < NUM_SEGMENTREGS);
530  }
531 
532  static inline MiscRegIndex
534  {
535  assert(index >= 0 && index < NUM_SEGMENTREGS);
537  }
538 
543  BitUnion64(CCFlagBits)
544  Bitfield<11> of;
545  Bitfield<7> sf;
546  Bitfield<6> zf;
547  Bitfield<5> ezf;
548  Bitfield<4> af;
549  Bitfield<3> ecf;
550  Bitfield<2> pf;
551  Bitfield<0> cf;
552  EndBitUnion(CCFlagBits)
553 
554 
557  BitUnion64(RFLAGS)
558  Bitfield<21> id; // ID Flag
559  Bitfield<20> vip; // Virtual Interrupt Pending
560  Bitfield<19> vif; // Virtual Interrupt Flag
561  Bitfield<18> ac; // Alignment Check
562  Bitfield<17> vm; // Virtual-8086 Mode
563  Bitfield<16> rf; // Resume Flag
564  Bitfield<14> nt; // Nested Task
565  Bitfield<13, 12> iopl; // I/O Privilege Level
566  Bitfield<11> of; // Overflow Flag
567  Bitfield<10> df; // Direction Flag
568  Bitfield<9> intf; // Interrupt Flag
569  Bitfield<8> tf; // Trap Flag
570  Bitfield<7> sf; // Sign Flag
571  Bitfield<6> zf; // Zero Flag
572  Bitfield<4> af; // Auxiliary Flag
573  Bitfield<2> pf; // Parity Flag
574  Bitfield<0> cf; // Carry Flag
575  EndBitUnion(RFLAGS)
576 
577  BitUnion64(HandyM5Reg)
578  Bitfield<0> mode;
579  Bitfield<3, 1> submode;
580  Bitfield<5, 4> cpl;
581  Bitfield<6> paging;
582  Bitfield<7> prot;
583  Bitfield<9, 8> defOp;
584  Bitfield<11, 10> altOp;
585  Bitfield<13, 12> defAddr;
586  Bitfield<15, 14> altAddr;
587  Bitfield<17, 16> stack;
588  EndBitUnion(HandyM5Reg)
589 
590 
593  BitUnion64(CR0)
594  Bitfield<31> pg; // Paging
595  Bitfield<30> cd; // Cache Disable
596  Bitfield<29> nw; // Not Writethrough
597  Bitfield<18> am; // Alignment Mask
598  Bitfield<16> wp; // Write Protect
599  Bitfield<5> ne; // Numeric Error
600  Bitfield<4> et; // Extension Type
601  Bitfield<3> ts; // Task Switched
602  Bitfield<2> em; // Emulation
603  Bitfield<1> mp; // Monitor Coprocessor
604  Bitfield<0> pe; // Protection Enabled
605  EndBitUnion(CR0)
606 
607  // Page Fault Virtual Address
608  BitUnion64(CR2)
609  Bitfield<31, 0> legacy;
610  EndBitUnion(CR2)
611 
612  BitUnion64(CR3)
613  Bitfield<51, 12> longPdtb; // Long Mode Page-Directory-Table
614  // Base Address
615  Bitfield<31, 12> pdtb; // Non-PAE Addressing Page-Directory-Table
616  // Base Address
617  Bitfield<31, 5> paePdtb; // PAE Addressing Page-Directory-Table
618  // Base Address
619  Bitfield<4> pcd; // Page-Level Cache Disable
620  Bitfield<3> pwt; // Page-Level Writethrough
621  EndBitUnion(CR3)
622 
623  BitUnion64(CR4)
624  Bitfield<18> osxsave; // Enable XSAVE and Proc Extended States
625  Bitfield<16> fsgsbase; // Enable RDFSBASE, RDGSBASE, WRFSBASE,
626  // WRGSBASE instructions
627  Bitfield<10> osxmmexcpt; // Operating System Unmasked
628  // Exception Support
629  Bitfield<9> osfxsr; // Operating System FXSave/FSRSTOR Support
630  Bitfield<8> pce; // Performance-Monitoring Counter Enable
631  Bitfield<7> pge; // Page-Global Enable
632  Bitfield<6> mce; // Machine Check Enable
633  Bitfield<5> pae; // Physical-Address Extension
634  Bitfield<4> pse; // Page Size Extensions
635  Bitfield<3> de; // Debugging Extensions
636  Bitfield<2> tsd; // Time Stamp Disable
637  Bitfield<1> pvi; // Protected-Mode Virtual Interrupts
638  Bitfield<0> vme; // Virtual-8086 Mode Extensions
639  EndBitUnion(CR4)
640 
641  BitUnion64(CR8)
642  Bitfield<3, 0> tpr; // Task Priority Register
643  EndBitUnion(CR8)
644 
645  BitUnion64(DR6)
646  Bitfield<0> b0;
647  Bitfield<1> b1;
648  Bitfield<2> b2;
649  Bitfield<3> b3;
650  Bitfield<13> bd;
651  Bitfield<14> bs;
652  Bitfield<15> bt;
653  EndBitUnion(DR6)
654 
655  BitUnion64(DR7)
656  Bitfield<0> l0;
657  Bitfield<1> g0;
658  Bitfield<2> l1;
659  Bitfield<3> g1;
660  Bitfield<4> l2;
661  Bitfield<5> g2;
662  Bitfield<6> l3;
663  Bitfield<7> g3;
664  Bitfield<8> le;
665  Bitfield<9> ge;
666  Bitfield<13> gd;
667  Bitfield<17, 16> rw0;
668  Bitfield<19, 18> len0;
669  Bitfield<21, 20> rw1;
670  Bitfield<23, 22> len1;
671  Bitfield<25, 24> rw2;
672  Bitfield<27, 26> len2;
673  Bitfield<29, 28> rw3;
674  Bitfield<31, 30> len3;
675  EndBitUnion(DR7)
676 
677  // MTRR capabilities
678  BitUnion64(MTRRcap)
679  Bitfield<7, 0> vcnt; // Variable-Range Register Count
680  Bitfield<8> fix; // Fixed-Range Registers
681  Bitfield<10> wc; // Write-Combining
682  EndBitUnion(MTRRcap)
683 
687  BitUnion64(SysenterCS)
688  Bitfield<15, 0> targetCS;
689  EndBitUnion(SysenterCS)
690 
691  BitUnion64(SysenterESP)
692  Bitfield<31, 0> targetESP;
693  EndBitUnion(SysenterESP)
694 
695  BitUnion64(SysenterEIP)
696  Bitfield<31, 0> targetEIP;
697  EndBitUnion(SysenterEIP)
698 
702  BitUnion64(McgCap)
703  Bitfield<7, 0> count; // Number of error reporting register banks
704  Bitfield<8> MCGCP; // MCG_CTL register present.
705  EndBitUnion(McgCap)
706 
707  BitUnion64(McgStatus)
708  Bitfield<0> ripv; // Restart-IP valid
709  Bitfield<1> eipv; // Error-IP valid
710  Bitfield<2> mcip; // Machine check in-progress
711  EndBitUnion(McgStatus)
712 
713  BitUnion64(DebugCtlMsr)
714  Bitfield<0> lbr; // Last-branch record
715  Bitfield<1> btf; // Branch single step
716  Bitfield<2> pb0; // Performance monitoring pin control 0
717  Bitfield<3> pb1; // Performance monitoring pin control 1
718  Bitfield<4> pb2; // Performance monitoring pin control 2
719  Bitfield<5> pb3; // Performance monitoring pin control 3
720  /*uint64_t pb(int index)
721  {
722  return bits(__data, index + 2);
723  }*/
724  EndBitUnion(DebugCtlMsr)
725 
726  BitUnion64(MtrrPhysBase)
727  Bitfield<7, 0> type; // Default memory type
728  Bitfield<51, 12> physbase; // Range physical base address
729  EndBitUnion(MtrrPhysBase)
730 
731  BitUnion64(MtrrPhysMask)
732  Bitfield<11> valid; // MTRR pair enable
733  Bitfield<51, 12> physmask; // Range physical mask
734  EndBitUnion(MtrrPhysMask)
735 
736  BitUnion64(MtrrFixed)
737  /*uint64_t type(int index)
738  {
739  return bits(__data, index * 8 + 7, index * 8);
740  }*/
741  EndBitUnion(MtrrFixed)
742 
743  BitUnion64(Pat)
744  /*uint64_t pa(int index)
745  {
746  return bits(__data, index * 8 + 2, index * 8);
747  }*/
748  EndBitUnion(Pat)
749 
750  BitUnion64(MtrrDefType)
751  Bitfield<7, 0> type; // Default type
752  Bitfield<10> fe; // Fixed range enable
753  Bitfield<11> e; // MTRR enable
754  EndBitUnion(MtrrDefType)
755 
759  BitUnion64(McStatus)
760  Bitfield<15,0> mcaErrorCode;
761  Bitfield<31,16> modelSpecificCode;
762  Bitfield<56,32> otherInfo;
763  Bitfield<57> pcc; // Processor-context corrupt
764  Bitfield<58> addrv; // Error-address register valid
765  Bitfield<59> miscv; // Miscellaneous-error register valid
766  Bitfield<60> en; // Error condition enabled
767  Bitfield<61> uc; // Uncorrected error
768  Bitfield<62> over; // Status register overflow
769  Bitfield<63> val; // Valid
770  EndBitUnion(McStatus)
771 
772  BitUnion64(McCtl)
773  /*uint64_t en(int index)
774  {
775  return bits(__data, index);
776  }*/
777  EndBitUnion(McCtl)
778 
779  // Extended feature enable register
780  BitUnion64(Efer)
781  Bitfield<0> sce; // System call extensions
782  Bitfield<8> lme; // Long mode enable
783  Bitfield<10> lma; // Long mode active
784  Bitfield<11> nxe; // No-execute enable
785  Bitfield<12> svme; // Secure virtual machine enable
786  Bitfield<14> ffxsr; // Fast fxsave/fxrstor
787  EndBitUnion(Efer)
788 
789  BitUnion64(Star)
790  Bitfield<31,0> targetEip;
791  Bitfield<47,32> syscallCsAndSs;
792  Bitfield<63,48> sysretCsAndSs;
793  EndBitUnion(Star)
794 
795  BitUnion64(SfMask)
796  Bitfield<31,0> mask;
797  EndBitUnion(SfMask)
798 
799  BitUnion64(PerfEvtSel)
800  Bitfield<7,0> eventMask;
801  Bitfield<15,8> unitMask;
802  Bitfield<16> usr; // User mode
803  Bitfield<17> os; // Operating-system mode
804  Bitfield<18> e; // Edge detect
805  Bitfield<19> pc; // Pin control
806  Bitfield<20> intEn; // Interrupt enable
807  Bitfield<22> en; // Counter enable
808  Bitfield<23> inv; // Invert mask
809  Bitfield<31,24> counterMask;
810  EndBitUnion(PerfEvtSel)
811 
812  BitUnion32(Syscfg)
813  Bitfield<18> mfde; // MtrrFixDramEn
814  Bitfield<19> mfdm; // MtrrFixDramModEn
815  Bitfield<20> mvdm; // MtrrVarDramEn
816  Bitfield<21> tom2; // MtrrTom2En
817  EndBitUnion(Syscfg)
818 
819  BitUnion64(IorrBase)
820  Bitfield<3> wr; // WrMem Enable
821  Bitfield<4> rd; // RdMem Enable
822  Bitfield<51,12> physbase; // Range physical base address
823  EndBitUnion(IorrBase)
824 
825  BitUnion64(IorrMask)
826  Bitfield<11> v; // I/O register pair enable (valid)
827  Bitfield<51,12> physmask; // Range physical mask
828  EndBitUnion(IorrMask)
829 
830  BitUnion64(Tom)
831  Bitfield<51,23> physAddr; // Top of memory physical address
832  EndBitUnion(Tom)
833 
834  BitUnion64(VmCrMsr)
835  Bitfield<0> dpd;
836  Bitfield<1> rInit;
837  Bitfield<2> disA20M;
838  EndBitUnion(VmCrMsr)
839 
840  BitUnion64(IgnneMsr)
841  Bitfield<0> ignne;
842  EndBitUnion(IgnneMsr)
843 
844  BitUnion64(SmmCtlMsr)
845  Bitfield<0> dismiss;
846  Bitfield<1> enter;
847  Bitfield<2> smiCycle;
848  Bitfield<3> exit;
849  Bitfield<4> rsmCycle;
850  EndBitUnion(SmmCtlMsr)
851 
855  BitUnion64(SegSelector)
856  // The following bitfield is not defined in the ISA, but it's useful
857  // when checking selectors in larger data types to make sure they
858  // aren't too large.
859  Bitfield<63, 3> esi; // Extended selector
860  Bitfield<15, 3> si; // Selector Index
861  Bitfield<2> ti; // Table Indicator
862  Bitfield<1, 0> rpl; // Requestor Privilege Level
863  EndBitUnion(SegSelector)
864 
869  class SegDescriptorBase
870  {
871  public:
872  uint32_t
873  getter(const uint64_t &storage) const
874  {
875  return (bits(storage, 63, 56) << 24) | bits(storage, 39, 16);
876  }
877 
878  void
879  setter(uint64_t &storage, uint32_t base)
880  {
881  replaceBits(storage, 63, 56, bits(base, 31, 24));
882  replaceBits(storage, 39, 16, bits(base, 23, 0));
883  }
884  };
885 
887  {
888  public:
889  uint32_t
890  getter(const uint64_t &storage) const
891  {
892  uint32_t limit = (bits(storage, 51, 48) << 16) |
893  bits(storage, 15, 0);
894  if (bits(storage, 55))
895  limit = (limit << 12) | mask(12);
896  return limit;
897  }
898 
899  void
900  setter(uint64_t &storage, uint32_t limit)
901  {
902  bool g = (bits(limit, 31, 24) != 0);
903  panic_if(g && bits(limit, 11, 0) != mask(12),
904  "Inlimitid segment limit %#x", limit);
905  if (g)
906  limit = limit >> 12;
907  replaceBits(storage, 51, 48, bits(limit, 23, 16));
908  replaceBits(storage, 15, 0, bits(limit, 15, 0));
909  replaceBits(storage, 55, g ? 1 : 0);
910  }
911  };
912 
913  BitUnion64(SegDescriptor)
914  Bitfield<63, 56> baseHigh;
915  Bitfield<39, 16> baseLow;
916  BitfieldType<SegDescriptorBase> base;
917  Bitfield<55> g; // Granularity
918  Bitfield<54> d; // Default Operand Size
919  Bitfield<54> b; // Default Operand Size
920  Bitfield<53> l; // Long Attribute Bit
921  Bitfield<52> avl; // Available To Software
922  Bitfield<51, 48> limitHigh;
923  Bitfield<15, 0> limitLow;
925  Bitfield<47> p; // Present
926  Bitfield<46, 45> dpl; // Descriptor Privilege-Level
927  Bitfield<44> s; // System
928  SubBitUnion(type, 43, 40)
929  // Specifies whether this descriptor is for code or data.
930  Bitfield<43> codeOrData;
931 
932  // These bit fields are for code segments
933  Bitfield<42> c; // Conforming
934  Bitfield<41> r; // Readable
935 
936  // These bit fields are for data segments
937  Bitfield<42> e; // Expand-Down
938  Bitfield<41> w; // Writable
939 
940  // This is used for both code and data segments.
941  Bitfield<40> a; // Accessed
942  EndSubBitUnion(type)
943  EndBitUnion(SegDescriptor)
944 
949  BitUnion64(TSSlow)
950  Bitfield<63, 56> baseHigh;
951  Bitfield<39, 16> baseLow;
952  BitfieldType<SegDescriptorBase> base;
953  Bitfield<55> g; // Granularity
954  Bitfield<52> avl; // Available To Software
955  Bitfield<51, 48> limitHigh;
956  Bitfield<15, 0> limitLow;
958  Bitfield<47> p; // Present
959  Bitfield<46, 45> dpl; // Descriptor Privilege-Level
960  SubBitUnion(type, 43, 40)
961  // Specifies whether this descriptor is for code or data.
962  Bitfield<43> codeOrData;
963 
964  // These bit fields are for code segments
965  Bitfield<42> c; // Conforming
966  Bitfield<41> r; // Readable
967 
968  // These bit fields are for data segments
969  Bitfield<42> e; // Expand-Down
970  Bitfield<41> w; // Writable
971 
972  // This is used for both code and data segments.
973  Bitfield<40> a; // Accessed
974  EndSubBitUnion(type)
975  EndBitUnion(TSSlow)
976 
981  BitUnion64(TSShigh)
982  Bitfield<31, 0> base;
983  EndBitUnion(TSShigh)
984 
985  BitUnion64(SegAttr)
986  Bitfield<1, 0> dpl;
987  Bitfield<2> unusable;
988  Bitfield<3> defaultSize;
989  Bitfield<4> longMode;
990  Bitfield<5> avl;
991  Bitfield<6> granularity;
992  Bitfield<7> present;
993  Bitfield<11, 8> type;
994  Bitfield<12> writable;
995  Bitfield<13> readable;
996  Bitfield<14> expandDown;
997  Bitfield<15> system;
998  EndBitUnion(SegAttr)
999 
1000  BitUnion64(GateDescriptor)
1001  Bitfield<63, 48> offsetHigh; // Target Code-Segment Offset
1002  Bitfield<15, 0> offsetLow; // Target Code-Segment Offset
1003  Bitfield<31, 16> selector; // Target Code-Segment Selector
1004  Bitfield<47> p; // Present
1005  Bitfield<46, 45> dpl; // Descriptor Privilege-Level
1006  Bitfield<43, 40> type;
1007  Bitfield<36, 32> count; // Parameter Count
1008  EndBitUnion(GateDescriptor)
1009 
1013  BitUnion64(GateDescriptorLow)
1014  Bitfield<63, 48> offsetHigh; // Target Code-Segment Offset
1015  Bitfield<47> p; // Present
1016  Bitfield<46, 45> dpl; // Descriptor Privilege-Level
1017  Bitfield<43, 40> type;
1018  Bitfield<35, 32> IST; // IST pointer to TSS -- new stack for exception handling
1019  Bitfield<31, 16> selector; // Target Code-Segment Selector
1020  Bitfield<15, 0> offsetLow; // Target Code-Segment Offset
1021  EndBitUnion(GateDescriptorLow)
1022 
1023  BitUnion64(GateDescriptorHigh)
1024  Bitfield<31, 0> offset; // Target Code-Segment Offset
1025  EndBitUnion(GateDescriptorHigh)
1026 
1030  BitUnion64(GDTR)
1031  EndBitUnion(GDTR)
1032 
1033  BitUnion64(IDTR)
1034  EndBitUnion(IDTR)
1035 
1036  BitUnion64(LDTR)
1037  EndBitUnion(LDTR)
1038 
1042  BitUnion64(TR)
1043  EndBitUnion(TR)
1044 
1045 
1049  BitUnion64(LocalApicBase)
1050  Bitfield<51, 12> base;
1051  Bitfield<11> enable;
1052  Bitfield<8> bsp;
1053  EndBitUnion(LocalApicBase)
1054 }
1055 
1056 #endif // __ARCH_X86_INTREGS_HH__
count
Definition: misc.hh:703
Bitfield< 14 > bs
Definition: misc.hh:651
targetCS
Definition: misc.hh:688
targetEip
Definition: misc.hh:790
Bitfield< 51, 48 > limitHigh
Definition: misc.hh:922
Bitfield< 19 > mfdm
Definition: misc.hh:814
Bitfield< 27, 26 > len2
Definition: misc.hh:672
Bitfield< 61 > uc
Definition: misc.hh:767
offset
Definition: misc.hh:1024
Bitfield< 51, 12 > physmask
Definition: misc.hh:733
Bitfield< 19 > vif
Definition: misc.hh:560
Bitfield< 29, 28 > rw3
Definition: misc.hh:673
static MiscRegIndex MISCREG_PERF_EVT_CTR(int index)
Definition: misc.hh:481
Bitfield< 35, 32 > IST
Definition: misc.hh:1018
vcnt
Definition: misc.hh:679
Bitfield< 5, 3 > index
Definition: types.hh:93
Bitfield< 57 > pcc
Definition: misc.hh:763
Bitfield< 17 > vm
Definition: misc.hh:562
Bitfield< 5 > ne
Definition: misc.hh:599
Bitfield< 5 > g2
Definition: misc.hh:661
Bitfield< 9 > ge
Definition: misc.hh:665
RFLAGBit
Definition: misc.hh:69
Bitfield< 13, 12 > defAddr
Definition: misc.hh:585
Bitfield< 8 > le
Definition: misc.hh:664
Bitfield< 20 > mvdm
Definition: misc.hh:815
Bitfield< 1 > rInit
Definition: misc.hh:836
Bitfield< 15, 8 > unitMask
Definition: misc.hh:801
Bitfield< 4 > pb2
Definition: misc.hh:718
Bitfield< 12 > writable
Definition: misc.hh:994
Bitfield< 63, 48 > sysretCsAndSs
Definition: misc.hh:792
Bitfield< 14 > nt
Definition: misc.hh:564
X87StatusBit
Definition: misc.hh:81
Bitfield< 6 > d
Definition: pagetable.hh:145
EndBitUnion(TriggerIntMessage) namespace DeliveryMode
Definition: intmessage.hh:49
Bitfield< 3 > exit
Definition: misc.hh:848
Bitfield< 31, 12 > pdtb
Definition: misc.hh:615
Bitfield< 11 > nxe
Definition: misc.hh:784
Bitfield< 3 > ecf
Definition: misc.hh:549
Bitfield< 15, 14 > altAddr
Definition: misc.hh:586
Bitfield< 13 > gd
Definition: misc.hh:666
Bitfield< 47, 32 > syscallCsAndSs
Definition: misc.hh:791
physAddr
Definition: misc.hh:831
Bitfield< 46, 45 > dpl
Definition: misc.hh:926
Bitfield< 13 > bd
Definition: misc.hh:650
Bitfield< 11 > e
Definition: misc.hh:753
Bitfield< 9 > osfxsr
Definition: misc.hh:629
Bitfield< 3, 1 > submode
Definition: misc.hh:579
Bitfield< 2 > em
Definition: misc.hh:602
Bitfield< 6 > granularity
Definition: misc.hh:991
Bitfield< 1 > enter
Definition: misc.hh:846
Bitfield< 7 > present
Definition: misc.hh:992
uint32_t getter(const uint64_t &storage) const
Definition: misc.hh:890
Bitfield< 4 > l2
Definition: misc.hh:660
Bitfield< 3 > defaultSize
Definition: misc.hh:988
Bitfield< 23 > inv
Definition: misc.hh:808
Bitfield< 14 > expandDown
Definition: misc.hh:996
Bitfield< 39, 16 > baseLow
Definition: misc.hh:915
Bitfield< 19 > pc
Definition: misc.hh:805
Bitfield< 53 > l
Definition: misc.hh:920
Bitfield< 4, 0 > mode
Bitfield< 7 > prot
Definition: misc.hh:582
Bitfield< 1 > b1
Definition: misc.hh:647
static bool isValidMiscReg(int index)
Definition: misc.hh:402
Bitfield< 10 > wc
Definition: misc.hh:681
Bitfield< 5 > pb3
Definition: misc.hh:719
Bitfield< 42 > c
Definition: misc.hh:933
Bitfield< 15, 0 > offsetLow
Definition: misc.hh:1002
Bitfield< 17 > os
Definition: misc.hh:803
Bitfield< 15 > bt
Definition: misc.hh:652
Bitfield< 8 > MCGCP
Definition: misc.hh:704
Bitfield< 4 > longMode
Definition: misc.hh:989
Bitfield< 58 > addrv
Definition: misc.hh:764
Bitfield< 33 > id
MiscRegIndex
Definition: misc.hh:100
Bitfield< 18 > am
Definition: misc.hh:597
Bitfield< 1 > btf
Definition: misc.hh:715
Bitfield< 63 > val
Definition: misc.hh:769
Bitfield< 6, 3 > v
Definition: types.hh:120
Bitfield< 7 > sf
Definition: misc.hh:545
Bitfield< 20 > vip
Definition: misc.hh:559
Bitfield< 10 > osxmmexcpt
Definition: misc.hh:627
Bitfield< 0 > cf
Definition: misc.hh:551
Bitfield< 6 > paging
Definition: misc.hh:581
targetEIP
Definition: misc.hh:696
Bitfield< 20 > intEn
Definition: misc.hh:806
Bitfield< 7 > g3
Definition: misc.hh:663
Bitfield< 41 > r
Definition: misc.hh:934
Bitfield< 6 > mce
Definition: misc.hh:632
Bitfield< 11 > enable
Definition: misc.hh:1051
BitUnion32(TriggerIntMessage) Bitfield< 7
Bitfield< 13, 12 > iopl
Definition: misc.hh:565
const int NumDRegs
Definition: x86_traits.hh:62
Bitfield< 51, 12 > physbase
Definition: misc.hh:728
Bitfield< 16 > rf
Definition: misc.hh:563
Bitfield< 29 > nw
Definition: misc.hh:596
static MiscRegIndex MISCREG_SEG_ATTR(int index)
Definition: misc.hh:533
const int NumCRegs
Definition: x86_traits.hh:61
static MiscRegIndex MISCREG_CR(int index)
Definition: misc.hh:411
Bitfield< 18 > ac
Definition: misc.hh:561
Bitfield< 4 > rd
Definition: misc.hh:821
Bitfield< 25, 24 > rw2
Definition: misc.hh:671
Bitfield< 3 > pwt
Definition: pagetable.hh:148
static MiscRegIndex MISCREG_SEG_LIMIT(int index)
Definition: misc.hh:526
Bitfield< 31, 30 > len3
Definition: misc.hh:674
void setter(uint64_t &storage, uint32_t limit)
Definition: misc.hh:900
Bitfield< 3 > ts
Definition: misc.hh:601
Bitfield< 14 > ffxsr
Definition: misc.hh:786
Bitfield< 6 > zf
Definition: misc.hh:546
Bitfield< 10 > lma
Definition: misc.hh:783
mask
Definition: misc.hh:796
Bitfield< 1 > w
Definition: pagetable.hh:150
void replaceBits(T &val, int first, int last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Definition: bitfield.hh:156
baseHigh
Definition: misc.hh:914
Bitfield< 3, 0 > b0
Definition: qarma.hh:63
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
Bitfield< 0 > pe
Definition: misc.hh:604
Bitfield< 1 > mp
Definition: misc.hh:603
Bitfield< 8 > pce
Definition: misc.hh:630
Bitfield< 31, 5 > paePdtb
Definition: misc.hh:617
BitUnion64(VAddr) Bitfield< 20
Bitfield< 62 > over
Definition: misc.hh:768
Bitfield< 9 > intf
Definition: misc.hh:568
Bitfield< 0 > vme
Definition: misc.hh:638
Bitfield< 3 > b3
Definition: misc.hh:649
Bitfield< 12 > svme
Definition: misc.hh:785
Bitfield< 31, 16 > selector
Definition: misc.hh:1003
Bitfield< 59 > miscv
Definition: misc.hh:765
static MiscRegIndex MISCREG_MTRR_PHYS_BASE(int index)
Definition: misc.hh:425
Bitfield< 16 > usr
Definition: misc.hh:802
Bitfield< 11 > of
Definition: misc.hh:566
EndSubBitUnion(type) EndBitUnion(SegDescriptor) BitUnion64(TSSlow) Bitfield< 63
TSS Descriptor (long mode - 128 bits) the lower 64 bits.
static MiscRegIndex MISCREG_SEG_SEL(int index)
Definition: misc.hh:505
Bitfield< 31, 24 > counterMask
Definition: misc.hh:809
Bitfield< 8 > bsp
Definition: misc.hh:1052
Bitfield< 2 > disA20M
Definition: misc.hh:837
Bitfield< 60 > en
Definition: misc.hh:766
Bitfield< 5 > a
Definition: pagetable.hh:146
Bitfield< 2 > pb0
Definition: misc.hh:716
Bitfield< 1, 0 > rpl
Definition: misc.hh:862
Bitfield< 15 > system
Definition: misc.hh:997
Bitfield< 5, 4 > cpl
Definition: misc.hh:580
Bitfield< 54 > b
Definition: misc.hh:919
offsetHigh
Definition: misc.hh:1001
longPdtb
Definition: misc.hh:613
Bitfield< 16 > fsgsbase
Definition: misc.hh:625
Bitfield< 17, 16 > stack
Definition: misc.hh:587
Bitfield< 11, 9 > avl
Definition: pagetable.hh:142
Bitfield< 1 > pvi
Definition: misc.hh:637
Bitfield< 15, 0 > limitLow
Definition: misc.hh:923
Bitfield< 4 > af
Definition: misc.hh:548
Bitfield< 2 > ti
Definition: misc.hh:861
BitfieldType< SegDescriptorLimit > limit
Definition: misc.hh:924
CondFlagBit
Definition: misc.hh:54
type
Definition: misc.hh:727
Bitfield< 3 > pb1
Definition: misc.hh:717
Bitfield< 4 > et
Definition: misc.hh:600
Bitfield< 21, 20 > rw1
Definition: misc.hh:669
Bitfield< 2 > l1
Definition: misc.hh:658
Bitfield< 6 > l3
Definition: misc.hh:662
static MiscRegIndex MISCREG_SEG_BASE(int index)
Definition: misc.hh:512
Bitfield< 1 > g0
Definition: misc.hh:657
Bitfield< 17, 16 > rw0
Definition: misc.hh:667
Bitfield< 3 > de
Definition: misc.hh:635
Bitfield< 4 > pse
Definition: misc.hh:634
This is exposed globally, independent of the ISA.
Definition: acpi.hh:55
Bitfield< 15, 3 > si
Definition: misc.hh:860
Bitfield< 44 > s
Definition: misc.hh:927
Bitfield< 9, 8 > defOp
Definition: misc.hh:583
Bitfield< 31, 16 > modelSpecificCode
Definition: misc.hh:761
static MiscRegIndex MISCREG_MTRR_PHYS_MASK(int index)
Definition: misc.hh:433
static MiscRegIndex MISCREG_PERF_EVT_SEL(int index)
Definition: misc.hh:473
SubBitUnion(type, 43, 40) Bitfield< 43 > codeOrData
static MiscRegIndex MISCREG_MC_ADDR(int index)
Definition: misc.hh:457
static MiscRegIndex MISCREG_MC_CTL(int index)
Definition: misc.hh:441
Bitfield< 2 > b2
Definition: misc.hh:648
Bitfield< 2 > tsd
Definition: misc.hh:636
Bitfield< 4 > pcd
Definition: pagetable.hh:147
Bitfield< 5 > pae
Definition: misc.hh:633
mcaErrorCode
Definition: misc.hh:760
Bitfield< 19, 18 > len0
Definition: misc.hh:668
Bitfield< 13 > readable
Definition: misc.hh:995
static MiscRegIndex MISCREG_SEG_EFF_BASE(int index)
Definition: misc.hh:519
Bitfield< 56, 32 > otherInfo
Definition: misc.hh:762
static MiscRegIndex MISCREG_IORR_BASE(int index)
Definition: misc.hh:489
static MiscRegIndex MISCREG_IORR_MASK(int index)
Definition: misc.hh:497
Bitfield< 3 > wr
Bitfield< 0 > p
Definition: pagetable.hh:151
Bitfield< 8 > fix
Definition: misc.hh:680
Bitfield< 2 > mcip
Definition: misc.hh:710
const uint32_t ccFlagMask
Definition: misc.hh:67
Bitfield< 8 > tf
Definition: misc.hh:569
static MiscRegIndex MISCREG_MC_MISC(int index)
Definition: misc.hh:465
Bitfield< 2 > pf
Definition: misc.hh:550
static MiscRegIndex MISCREG_MC_STATUS(int index)
Definition: misc.hh:449
Bitfield< 8 > lme
Definition: misc.hh:782
T bits(T val, int first, int last)
Extract the bitfield from position &#39;first&#39; to &#39;last&#39; (inclusive) from &#39;val&#39; and right justify it...
Definition: bitfield.hh:71
esi
Definition: misc.hh:859
Bitfield< 23, 22 > len1
Definition: misc.hh:670
Bitfield< 8 > g
Definition: pagetable.hh:143
static MiscRegIndex MISCREG_DR(int index)
Definition: misc.hh:418
const uint32_t cfofMask
Definition: misc.hh:66
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:181
Bitfield< 11, 10 > altOp
Definition: misc.hh:584
legacy
Definition: misc.hh:609
Bitfield< 2 > unusable
Definition: misc.hh:987
Bitfield< 3 > g1
Definition: misc.hh:659
Bitfield< 2 > smiCycle
Definition: misc.hh:847
Bitfield< 5 > ezf
Definition: misc.hh:547
Bitfield< 7 > pge
Definition: misc.hh:631
targetESP
Definition: misc.hh:692
tpr
Definition: misc.hh:642
Bitfield< 16 > wp
Definition: misc.hh:598
Bitfield< 4 > rsmCycle
Definition: misc.hh:849
Bitfield< 10 > df
Definition: misc.hh:567
Bitfield< 30 > cd
Definition: misc.hh:595
Bitfield< 10 > fe
Definition: misc.hh:752
Bitfield< 21 > tom2
Definition: misc.hh:816
eventMask
Definition: misc.hh:800
Bitfield< 1 > eipv
Definition: misc.hh:709

Generated on Mon Jun 8 2020 15:34:39 for gem5 by doxygen 1.8.13