x86: Stop using/defining some ISA specific register types.
authorGabe Black <gabeblack@google.com>
Wed, 21 Nov 2018 00:58:19 +0000 (16:58 -0800)
committerGabe Black <gabeblack@google.com>
Thu, 31 Jan 2019 11:04:13 +0000 (11:04 +0000)
These have been replaced with the generic RegVal type.

Change-Id: I75c1134212067dea43aa0903d813633e06f3d6c6
Reviewed-on: https://gem5-review.googlesource.com/c/14476
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

16 files changed:
src/arch/x86/decoder.hh
src/arch/x86/insts/micromediaop.hh
src/arch/x86/isa.cc
src/arch/x86/isa.hh
src/arch/x86/isa/microops/fpop.isa
src/arch/x86/isa/microops/mediaop.isa
src/arch/x86/isa/microops/regop.isa
src/arch/x86/linux/process.cc
src/arch/x86/linux/process.hh
src/arch/x86/mmapped_ipr.hh
src/arch/x86/process.cc
src/arch/x86/process.hh
src/arch/x86/pseudo_inst.cc
src/arch/x86/registers.hh
src/arch/x86/system.cc
src/arch/x86/tlb.cc

index c0b30b5e8ddd4a46902589305f20b7166821e2ba..412b7c73f6f20919ad1cb469c73e6e81ba3d3bbe 100644 (file)
@@ -222,7 +222,7 @@ class Decoder
   protected:
     /// Caching for decoded instruction objects.
 
-    typedef MiscReg CacheKey;
+    typedef RegVal CacheKey;
 
     typedef DecodeCache::AddrMap<Decoder::InstBytes> DecodePages;
     DecodePages *decodePages;
index 1fe871752e192fd2b15cd44d4df82ce62a7fe661..6bbfc510b2ef92327d777d275a65953a61c12565 100644 (file)
@@ -72,7 +72,7 @@ namespace X86ISA
         int
         numItems(int size) const
         {
-            return scalarOp() ? 1 : (sizeof(FloatReg) / size);
+            return scalarOp() ? 1 : (sizeof(uint64_t) / size);
         }
 
         bool
index a866b950f0221bc755d37043703397a98a176dd5..d96a85893c9b52ae7348412c6f39180633f00266 100644 (file)
@@ -107,7 +107,7 @@ ISA::clear()
 {
     // Blank everything. 0 might not be an appropriate value for some things,
     // but it is for most.
-    memset(regVal, 0, NumMiscRegs * sizeof(MiscReg));
+    memset(regVal, 0, NumMiscRegs * sizeof(RegVal));
     regVal[MISCREG_DR6] = (mask(8) << 4) | (mask(16) << 16);
     regVal[MISCREG_DR7] = 1 << 10;
 }
@@ -124,7 +124,7 @@ ISA::params() const
     return dynamic_cast<const Params *>(_params);
 }
 
-MiscReg
+RegVal
 ISA::readMiscRegNoEffect(int miscReg) const
 {
     // Make sure we're not dealing with an illegal control register.
@@ -135,7 +135,7 @@ ISA::readMiscRegNoEffect(int miscReg) const
     return regVal[miscReg];
 }
 
-MiscReg
+RegVal
 ISA::readMiscReg(int miscReg, ThreadContext * tc)
 {
     if (miscReg == MISCREG_TSC) {
@@ -143,8 +143,8 @@ ISA::readMiscReg(int miscReg, ThreadContext * tc)
     }
 
     if (miscReg == MISCREG_FSW) {
-        MiscReg fsw = regVal[MISCREG_FSW];
-        MiscReg top = regVal[MISCREG_X87_TOP];
+        RegVal fsw = regVal[MISCREG_FSW];
+        RegVal top = regVal[MISCREG_X87_TOP];
         return insertBits(fsw, 13, 11, top);
     }
 
@@ -152,7 +152,7 @@ ISA::readMiscReg(int miscReg, ThreadContext * tc)
 }
 
 void
-ISA::setMiscRegNoEffect(int miscReg, MiscReg val)
+ISA::setMiscRegNoEffect(int miscReg, RegVal val)
 {
     // Make sure we're not dealing with an illegal control register.
     // Instructions should filter out these indexes, and nothing else should
@@ -194,9 +194,9 @@ ISA::setMiscRegNoEffect(int miscReg, MiscReg val)
 }
 
 void
-ISA::setMiscReg(int miscReg, MiscReg val, ThreadContext * tc)
+ISA::setMiscReg(int miscReg, RegVal val, ThreadContext * tc)
 {
-    MiscReg newVal = val;
+    RegVal newVal = val;
     switch(miscReg)
     {
       case MISCREG_CR0:
index 7ad4646432fc5981135f7a3930f2500f5b0f001e..a835a794a5b21ae94cfb72b2751d997e8f6dc456 100644 (file)
@@ -51,7 +51,7 @@ namespace X86ISA
     class ISA : public SimObject
     {
       protected:
-        MiscReg regVal[NUM_MISCREGS];
+        RegVal regVal[NUM_MISCREGS];
         void updateHandyM5Reg(Efer efer, CR0 cr0,
                 SegAttr csAttr, SegAttr ssAttr, RFLAGS rflags,
                 ThreadContext *tc);
@@ -64,11 +64,11 @@ namespace X86ISA
         ISA(Params *p);
         const Params *params() const;
 
-        MiscReg readMiscRegNoEffect(int miscReg) const;
-        MiscReg readMiscReg(int miscReg, ThreadContext *tc);
+        RegVal readMiscRegNoEffect(int miscReg) const;
+        RegVal readMiscReg(int miscReg, ThreadContext *tc);
 
-        void setMiscRegNoEffect(int miscReg, MiscReg val);
-        void setMiscReg(int miscReg, MiscReg val, ThreadContext *tc);
+        void setMiscRegNoEffect(int miscReg, RegVal val);
+        void setMiscReg(int miscReg, RegVal val, ThreadContext *tc);
 
         RegId
         flattenRegId(const RegId& regId) const
index 52193f2c0b91ccf82aeb52bdff079dd52f52657a..97ed40629aae28927d02624a562869679aa1eac3 100644 (file)
@@ -380,7 +380,7 @@ let {{
 
     class PremFp(FpBinaryOp):
         code = '''
-            MiscReg new_fsw = FSW;
+            RegVal new_fsw = FSW;
             int src1_exp;
             int src2_exp;
             std::frexp(FpSrcReg1, &src1_exp);
index b8ceb02ace4cdbb65fe944cc16f3fb5dd8be7961..4bbe093a4b2884c3088836cf5a02006eb85df86c 100644 (file)
@@ -245,7 +245,7 @@ let {{
                     src2, size, destSize, srcSize, ext)
         op_class = 'SimdMiscOp'
         code = '''
-            int items = sizeof(FloatReg) / srcSize;
+            int items = sizeof(double) / srcSize;
             int offset = imm8;
             if (bits(src1, 0) && (ext & 0x1))
                 offset -= items;
@@ -267,7 +267,7 @@ let {{
                     src2, size, destSize, srcSize, ext)
         op_class = 'SimdMiscOp'
         code = '''
-            int items = sizeof(FloatReg) / destSize;
+            int items = sizeof(double) / destSize;
             int offset = imm8;
             if (bits(dest, 0) && (ext & 0x1))
                 offset -= items;
@@ -289,7 +289,7 @@ let {{
                     "InstRegIndex(0)", size, destSize, srcSize, ext)
         op_class = 'SimdMiscOp'
         code = '''
-            int items = sizeof(FloatReg) / srcSize;
+            int items = sizeof(double) / srcSize;
             uint64_t result = 0;
             int offset = (ext & 0x1) ? items : 0;
             for (int i = 0; i < items; i++) {
@@ -325,7 +325,7 @@ let {{
             assert(srcSize == destSize);
             int size = srcSize;
             int sizeBits = size * 8;
-            int items = sizeof(FloatReg) / size;
+            int items = sizeof(double) / size;
             int options;
             int optionBits;
             if (size == 8) {
@@ -342,7 +342,7 @@ let {{
             for (int i = 0; i < items; i++) {
                 uint64_t resBits;
                 uint8_t lsel = sel & mask(optionBits);
-                if (lsel * size >= sizeof(FloatReg)) {
+                if (lsel * size >= sizeof(double)) {
                     lsel -= options / 2;
                     resBits = bits(FpSrcReg2_uqw,
                             (lsel + 1) * sizeBits - 1,
@@ -367,7 +367,7 @@ let {{
         code = '''
             assert(srcSize == destSize);
             int size = destSize;
-            int items = (sizeof(FloatReg) / size) / 2;
+            int items = (sizeof(double) / size) / 2;
             int offset = ext ? items : 0;
             uint64_t result = 0;
             for (int i = 0; i < items; i++) {
@@ -393,7 +393,7 @@ let {{
         op_class = 'SimdMiscOp'
         code = '''
             assert(srcSize == destSize * 2);
-            int items = (sizeof(FloatReg) / destSize);
+            int items = (sizeof(double) / destSize);
             int destBits = destSize * 8;
             int srcBits = srcSize * 8;
             uint64_t result = 0;
@@ -1091,7 +1091,7 @@ let {{
         op_class = 'SimdAddOp'
         code = '''
             int srcBits = srcSize * 8;
-            int items = sizeof(FloatReg) / srcSize;
+            int items = sizeof(double) / srcSize;
 
             uint64_t sum = 0;
             for (int i = 0; i < items; i++) {
index 08a4ddd415b3ab8b86c973f7bd96f81c6ad9db18..6f2901b25eabbe591f906f2ec6183d83e99358a7 100644 (file)
@@ -51,7 +51,7 @@ def template MicroRegOpExecute {{
             %(op_decl)s;
             %(op_rd)s;
 
-            IntReg result M5_VAR_USED;
+            RegVal result M5_VAR_USED;
 
             if(%(cond_check)s)
             {
@@ -81,7 +81,7 @@ def template MicroRegOpImmExecute {{
             %(op_decl)s;
             %(op_rd)s;
 
-            IntReg result M5_VAR_USED;
+            RegVal result M5_VAR_USED;
 
             if(%(cond_check)s)
             {
@@ -1220,8 +1220,8 @@ let {{
 
     class Wrflags(WrRegOp):
         code = '''
-            MiscReg newFlags = psrc1 ^ op2;
-            MiscReg userFlagMask = 0xDD5;
+            RegVal newFlags = psrc1 ^ op2;
+            RegVal userFlagMask = 0xDD5;
 
             // Get only the user flags
             ccFlagBits = newFlags & ccFlagMask;
@@ -1268,8 +1268,8 @@ let {{
 
     class Rflag(RegOp):
         code = '''
-            MiscReg flagMask = 0x3F7FDD5;
-            MiscReg flags = (nccFlagBits | ccFlagBits | cfofBits | dfBit |
+            RegVal flagMask = 0x3F7FDD5;
+            RegVal flags = (nccFlagBits | ccFlagBits | cfofBits | dfBit |
                              ecfBit | ezfBit) & flagMask;
 
             int flag = bits(flags, imm8);
@@ -1278,8 +1278,8 @@ let {{
             '''
 
         big_code = '''
-            MiscReg flagMask = 0x3F7FDD5;
-            MiscReg flags = (nccFlagBits | ccFlagBits | cfofBits | dfBit |
+            RegVal flagMask = 0x3F7FDD5;
+            RegVal flags = (nccFlagBits | ccFlagBits | cfofBits | dfBit |
                              ecfBit | ezfBit) & flagMask;
 
             int flag = bits(flags, imm8);
@@ -1294,7 +1294,7 @@ let {{
 
     class Sext(RegOp):
         code = '''
-            IntReg val = psrc1;
+            RegVal val = psrc1;
             // Mask the bit position so that it wraps.
             int bitPos = op2 & (dataSize * 8 - 1);
             int sign_bit = bits(val, bitPos, bitPos);
@@ -1304,7 +1304,7 @@ let {{
             '''
 
         big_code = '''
-            IntReg val = psrc1;
+            RegVal val = psrc1;
             // Mask the bit position so that it wraps.
             int bitPos = op2 & (dataSize * 8 - 1);
             int sign_bit = bits(val, bitPos, bitPos);
@@ -1390,10 +1390,7 @@ let {{
             if (dest == 1 || (dest > 4 && dest < 8) || (dest > 8)) {
                 fault = std::make_shared<InvalidOpcode>();
             } else {
-                // There are *s in the line below so it doesn't confuse the
-                // parser. They may be unnecessary.
-                //Mis*cReg old*Val = pick(Cont*rolDest, 0, dat*aSize);
-                MiscReg newVal = psrc1;
+                RegVal newVal = psrc1;
 
                 // Check for any modifications that would cause a fault.
                 switch(dest) {
index 6a9aea85b1ce92eba49a3ec670f19403ab1f884c..9e8997afc07db1316c55697b6787bee589ec50d5 100644 (file)
@@ -549,7 +549,7 @@ X86_64LinuxProcess::X86_64LinuxProcess(ProcessParams * params,
 {}
 
 void X86_64LinuxProcess::clone(ThreadContext *old_tc, ThreadContext *new_tc,
-                               Process *process, TheISA::IntReg flags)
+                               Process *process, RegVal flags)
 {
     X86_64Process::clone(old_tc, new_tc, (X86_64Process*)process, flags);
 }
@@ -891,7 +891,7 @@ I386LinuxProcess::I386LinuxProcess(ProcessParams * params, ObjectFile *objFile)
 {}
 
 void I386LinuxProcess::clone(ThreadContext *old_tc, ThreadContext *new_tc,
-                             Process *process, TheISA::IntReg flags)
+                             Process *process, RegVal flags)
 {
     I386Process::clone(old_tc, new_tc, (I386Process*)process, flags);
 }
index bafa9cc6cb6d05f5d4c70e69ebdda81a807c5378..d4c9b0cf66bb24079c08d989697a6b4eba02ecd0 100644 (file)
@@ -55,7 +55,7 @@ class X86_64LinuxProcess : public X86_64Process
     /// Constructor.
     X86_64LinuxProcess(ProcessParams * params, ObjectFile *objFile);
     void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process,
-               TheISA::IntReg flags);
+               RegVal flags);
 };
 
 class I386LinuxProcess : public I386Process
@@ -64,7 +64,7 @@ class I386LinuxProcess : public I386Process
     /// Constructor.
     I386LinuxProcess(ProcessParams * params, ObjectFile *objFile);
     void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *process,
-               TheISA::IntReg flags);
+               RegVal flags);
 };
 
 } // namespace X86ISA
index bd24d33da852c3985731a0ef5421bcd8415ec546..93c16d33d30e179669b4a502a44ea0c137409203 100644 (file)
@@ -62,10 +62,10 @@ namespace X86ISA
         } else {
             Addr offset = pkt->getAddr() & mask(3);
             MiscRegIndex index = (MiscRegIndex)(
-                pkt->getAddr() / sizeof(MiscReg));
-            MiscReg data = htog(xc->readMiscReg(index));
+                pkt->getAddr() / sizeof(RegVal));
+            RegVal data = htog(xc->readMiscReg(index));
             // Make sure we don't trot off the end of data.
-            assert(offset + pkt->getSize() <= sizeof(MiscReg));
+            assert(offset + pkt->getSize() <= sizeof(RegVal));
             pkt->setData(((uint8_t *)&data) + offset);
             return Cycles(1);
         }
@@ -79,11 +79,10 @@ namespace X86ISA
         } else {
             Addr offset = pkt->getAddr() & mask(3);
             MiscRegIndex index = (MiscRegIndex)(
-                pkt->getAddr() / sizeof(MiscReg));
-            MiscReg data;
-            data = htog(xc->readMiscRegNoEffect(index));
+                pkt->getAddr() / sizeof(RegVal));
+            RegVal data = htog(xc->readMiscRegNoEffect(index));
             // Make sure we don't trot off the end of data.
-            assert(offset + pkt->getSize() <= sizeof(MiscReg));
+            assert(offset + pkt->getSize() <= sizeof(RegVal));
             pkt->writeData(((uint8_t *)&data) + offset);
             xc->setMiscReg(index, gtoh(data));
             return Cycles(1);
index 273e2c0f95052af56930b701bd908779cbbdcd98..04bc0ddc81403032ee6847d699834d9f72f8bfcc 100644 (file)
@@ -119,7 +119,7 @@ X86Process::X86Process(ProcessParams *params, ObjectFile *objFile,
 }
 
 void X86Process::clone(ThreadContext *old_tc, ThreadContext *new_tc,
-                       Process *p, TheISA::IntReg flags)
+                       Process *p, RegVal flags)
 {
     Process::clone(old_tc, new_tc, p, flags);
     X86Process *process = (X86Process*)p;
@@ -444,11 +444,11 @@ X86_64Process::initState()
             tc->setMiscReg(MISCREG_IDTR_LIMIT, 0xffff);
 
             /* enabling syscall and sysret */
-            MiscReg star = ((MiscReg)sret << 48) | ((MiscReg)scall << 32);
+            RegVal star = ((RegVal)sret << 48) | ((RegVal)scall << 32);
             tc->setMiscReg(MISCREG_STAR, star);
-            MiscReg lstar = (MiscReg)syscallCodeVirtAddr;
+            RegVal lstar = (RegVal)syscallCodeVirtAddr;
             tc->setMiscReg(MISCREG_LSTAR, lstar);
-            MiscReg sfmask = (1 << 8) | (1 << 10); // TF | DF
+            RegVal sfmask = (1 << 8) | (1 << 10); // TF | DF
             tc->setMiscReg(MISCREG_SF_MASK, sfmask);
         }
 
@@ -1070,7 +1070,7 @@ X86Process::setSyscallReturn(ThreadContext *tc, SyscallReturn retval)
     tc->setIntReg(INTREG_RAX, retval.encodedValue());
 }
 
-X86ISA::IntReg
+RegVal
 X86_64Process::getSyscallArg(ThreadContext *tc, int &i)
 {
     assert(i < NumArgumentRegs);
@@ -1078,7 +1078,7 @@ X86_64Process::getSyscallArg(ThreadContext *tc, int &i)
 }
 
 void
-X86_64Process::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
+X86_64Process::setSyscallArg(ThreadContext *tc, int i, RegVal val)
 {
     assert(i < NumArgumentRegs);
     return tc->setIntReg(ArgumentReg[i], val);
@@ -1086,20 +1086,20 @@ X86_64Process::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
 
 void
 X86_64Process::clone(ThreadContext *old_tc, ThreadContext *new_tc,
-                     Process *p, TheISA::IntReg flags)
+                     Process *p, RegVal flags)
 {
     X86Process::clone(old_tc, new_tc, p, flags);
     ((X86_64Process*)p)->vsyscallPage = vsyscallPage;
 }
 
-X86ISA::IntReg
+RegVal
 I386Process::getSyscallArg(ThreadContext *tc, int &i)
 {
     assert(i < NumArgumentRegs32);
     return tc->readIntReg(ArgumentReg32[i++]);
 }
 
-X86ISA::IntReg
+RegVal
 I386Process::getSyscallArg(ThreadContext *tc, int &i, int width)
 {
     assert(width == 32 || width == 64);
@@ -1111,7 +1111,7 @@ I386Process::getSyscallArg(ThreadContext *tc, int &i, int width)
 }
 
 void
-I386Process::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
+I386Process::setSyscallArg(ThreadContext *tc, int i, RegVal val)
 {
     assert(i < NumArgumentRegs);
     return tc->setIntReg(ArgumentReg[i], val);
@@ -1119,7 +1119,7 @@ I386Process::setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val)
 
 void
 I386Process::clone(ThreadContext *old_tc, ThreadContext *new_tc,
-                   Process *p, TheISA::IntReg flags)
+                   Process *p, RegVal flags)
 {
     X86Process::clone(old_tc, new_tc, p, flags);
     ((I386Process*)p)->vsyscallPage = vsyscallPage;
index 31706cfdd5c7461a422815ab5dee321f00e67889..9c2ec6506a00133bfcd4a62fb600e27f59cfd7c1 100644 (file)
@@ -92,7 +92,7 @@ namespace X86ISA
         void setSyscallReturn(ThreadContext *tc,
                               SyscallReturn return_value) override;
         void clone(ThreadContext *old_tc, ThreadContext *new_tc,
-                   Process *process, TheISA::IntReg flags) override;
+                   Process *process, RegVal flags) override;
 
         X86Process &
         operator=(const X86Process &in)
@@ -142,13 +142,12 @@ namespace X86ISA
         void argsInit(int pageSize);
         void initState() override;
 
-        X86ISA::IntReg getSyscallArg(ThreadContext *tc, int &i) override;
+        RegVal getSyscallArg(ThreadContext *tc, int &i) override;
         /// Explicitly import the otherwise hidden getSyscallArg
         using Process::getSyscallArg;
-        void setSyscallArg(ThreadContext *tc, int i,
-                           X86ISA::IntReg val) override;
+        void setSyscallArg(ThreadContext *tc, int i, RegVal val) override;
         void clone(ThreadContext *old_tc, ThreadContext *new_tc,
-                   Process *process, TheISA::IntReg flags) override;
+                   Process *process, RegVal flags) override;
     };
 
     class I386Process : public X86Process
@@ -187,14 +186,11 @@ namespace X86ISA
 
         void syscall(int64_t callnum, ThreadContext *tc,
                      Fault *fault) override;
-        X86ISA::IntReg getSyscallArg(ThreadContext *tc,
-                                     int &i) override;
-        X86ISA::IntReg getSyscallArg(ThreadContext *tc, int &i,
-                                     int width) override;
-        void setSyscallArg(ThreadContext *tc, int i,
-                           X86ISA::IntReg val) override;
+        RegVal getSyscallArg(ThreadContext *tc, int &i) override;
+        RegVal getSyscallArg(ThreadContext *tc, int &i, int width) override;
+        void setSyscallArg(ThreadContext *tc, int i, RegVal val) override;
         void clone(ThreadContext *old_tc, ThreadContext *new_tc,
-                   Process *process, TheISA::IntReg flags) override;
+                   Process *process, RegVal flags) override;
     };
 
 }
index c0ec1105926904b972c49796d4ee7d96eb701302..90000b808050485559d99c285b94c2c3bfc22ec2 100644 (file)
@@ -52,7 +52,7 @@ m5Syscall(ThreadContext *tc)
     Fault fault;
     tc->syscall(tc->readIntReg(INTREG_RAX), &fault);
 
-    MiscReg rflags = tc->readMiscReg(MISCREG_RFLAGS);
+    RegVal rflags = tc->readMiscReg(MISCREG_RFLAGS);
     rflags &= ~(1 << 16);
     tc->setMiscReg(MISCREG_RFLAGS, rflags);
 }
index 8b1d594265d692068c41d96c09f6a1c8030f693a..ea75ec9074439bd8cd38b65830188f1c3a43df9a 100644 (file)
@@ -96,9 +96,7 @@ const int FramePointerReg = INTREG_RBP;
 // value
 const int SyscallPseudoReturnReg = INTREG_RDX;
 
-typedef RegVal IntReg;
 typedef uint64_t CCReg;
-typedef RegVal MiscReg;
 
 // Not applicable to x86
 using VecElem = ::DummyVecElem;
@@ -115,10 +113,6 @@ using VecPredRegContainer = ::DummyVecPredRegContainer;
 constexpr size_t VecPredRegSizeBits = ::DummyVecPredRegSizeBits;
 constexpr bool VecPredRegHasPackedRepr = ::DummyVecPredRegHasPackedRepr;
 
-//These floating point types are correct for mmx, but not
-//technically for x87 (80 bits) or at all for xmm (128 bits)
-typedef RegVal FloatReg;
-
 } // namespace X86ISA
 
 #endif // __ARCH_X86_REGFILE_HH__
index 0f85fdb389effc030f7bf42c830c41b74169ae5f..3f44ece3a2948aba81c1e9df9b0e4675a6ef64d1 100644 (file)
@@ -100,7 +100,7 @@ X86ISA::installSegDesc(ThreadContext *tc, SegmentRegIndex seg,
     tc->setMiscReg(MISCREG_SEG_BASE(seg), desc.base);
     tc->setMiscReg(MISCREG_SEG_EFF_BASE(seg), honorBase ? desc.base : 0);
     tc->setMiscReg(MISCREG_SEG_LIMIT(seg), desc.limit);
-    tc->setMiscReg(MISCREG_SEG_ATTR(seg), (MiscReg)attr);
+    tc->setMiscReg(MISCREG_SEG_ATTR(seg), (RegVal)attr);
 }
 
 void
@@ -175,7 +175,7 @@ X86System::initState()
     SegSelector cs = 0;
     cs.si = numGDTEntries - 1;
 
-    tc->setMiscReg(MISCREG_CS, (MiscReg)cs);
+    tc->setMiscReg(MISCREG_CS, (RegVal)cs);
 
     // 32 bit data segment
     SegDescriptor dsDesc = initDesc;
@@ -188,11 +188,11 @@ X86System::initState()
     SegSelector ds = 0;
     ds.si = numGDTEntries - 1;
 
-    tc->setMiscReg(MISCREG_DS, (MiscReg)ds);
-    tc->setMiscReg(MISCREG_ES, (MiscReg)ds);
-    tc->setMiscReg(MISCREG_FS, (MiscReg)ds);
-    tc->setMiscReg(MISCREG_GS, (MiscReg)ds);
-    tc->setMiscReg(MISCREG_SS, (MiscReg)ds);
+    tc->setMiscReg(MISCREG_DS, (RegVal)ds);
+    tc->setMiscReg(MISCREG_ES, (RegVal)ds);
+    tc->setMiscReg(MISCREG_FS, (RegVal)ds);
+    tc->setMiscReg(MISCREG_GS, (RegVal)ds);
+    tc->setMiscReg(MISCREG_SS, (RegVal)ds);
 
     tc->setMiscReg(MISCREG_TSL, 0);
     tc->setMiscReg(MISCREG_TSG_BASE, GDTBase);
@@ -208,7 +208,7 @@ X86System::initState()
     SegSelector tss = 0;
     tss.si = numGDTEntries - 1;
 
-    tc->setMiscReg(MISCREG_TR, (MiscReg)tss);
+    tc->setMiscReg(MISCREG_TR, (RegVal)tss);
     installSegDesc(tc, SYS_SEGMENT_REG_TR, tssDesc, true);
 
     /*
index 8e83208f442b5836cb6ee9292c3dca7d23a2454d..589b2b7eb7834751a1204e4716484d50cb5a30a6 100644 (file)
@@ -185,10 +185,10 @@ TLB::translateInt(const RequestPtr &req, ThreadContext *tc)
         if (!msrAddrToIndex(regNum, vaddr))
             return std::make_shared<GeneralProtection>(0);
 
-        //The index is multiplied by the size of a MiscReg so that
+        //The index is multiplied by the size of a RegVal so that
         //any memory dependence calculations will not see these as
         //overlapping.
-        req->setPaddr((Addr)regNum * sizeof(MiscReg));
+        req->setPaddr((Addr)regNum * sizeof(RegVal));
         return NoFault;
     } else if (prefix == IntAddrPrefixIO) {
         // TODO If CPL > IOPL or in virtual mode, check the I/O permission
@@ -200,7 +200,7 @@ TLB::translateInt(const RequestPtr &req, ThreadContext *tc)
         assert(!(IOPort & ~0xFFFF));
         if (IOPort == 0xCF8 && req->getSize() == 4) {
             req->setFlags(Request::MMAPPED_IPR);
-            req->setPaddr(MISCREG_PCI_CONFIG_ADDRESS * sizeof(MiscReg));
+            req->setPaddr(MISCREG_PCI_CONFIG_ADDRESS * sizeof(RegVal));
         } else if ((IOPort & ~mask(2)) == 0xCFC) {
             req->setFlags(Request::UNCACHEABLE | Request::STRICT_ORDER);
             Addr configAddress =