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

Generated on Fri Feb 28 2020 16:26:57 for gem5 by doxygen 1.8.13