diff options
author | Gabe Black <gabeblack@google.com> | 2018-10-13 01:25:30 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-01-22 21:12:16 +0000 |
commit | 774770a6410abb129e2a19de1ca50d7c0c311fef (patch) | |
tree | 579e460775987782f64103e784527b2ae342eb14 /src/arch/arm/isa.cc | |
parent | 2b80f588ab44c571c0355cd1b343fdd82f6f7b96 (diff) | |
download | gem5-774770a6410abb129e2a19de1ca50d7c0c311fef.tar.xz |
arm: Get rid of some register type definitions.
These are IntReg, FloatReg, FloatRegBits, and MiscReg. These have been
supplanted by the global types RegVal and FloatRegVal.
Change-Id: Ief1cd85d0eff7156282ddb1ce168a2a5677f7435
Reviewed-on: https://gem5-review.googlesource.com/c/13625
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Diffstat (limited to 'src/arch/arm/isa.cc')
-rw-r--r-- | src/arch/arm/isa.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/arch/arm/isa.cc b/src/arch/arm/isa.cc index 3d98aeacf..ba7c09509 100644 --- a/src/arch/arm/isa.cc +++ b/src/arch/arm/isa.cc @@ -391,7 +391,7 @@ ISA::startup(ThreadContext *tc) } -MiscReg +RegVal ISA::readMiscRegNoEffect(int misc_reg) const { assert(misc_reg < NumMiscRegs); @@ -415,7 +415,7 @@ ISA::readMiscRegNoEffect(int misc_reg) const } -MiscReg +RegVal ISA::readMiscReg(int misc_reg, ThreadContext *tc) { CPSR cpsr = 0; @@ -470,7 +470,7 @@ ISA::readMiscReg(int misc_reg, ThreadContext *tc) if (!nsacr.cp11) cpacrMask.cp11 = 0; } } - MiscReg val = readMiscRegNoEffect(MISCREG_CPACR); + RegVal val = readMiscRegNoEffect(MISCREG_CPACR); val &= cpacrMask; DPRINTF(MiscRegs, "Reading misc reg %s: %#x\n", miscRegName[misc_reg], val); @@ -647,7 +647,7 @@ ISA::readMiscReg(int misc_reg, ThreadContext *tc) return 0x04; // DC ZVA clear 64-byte chunks case MISCREG_HCPTR: { - MiscReg val = readMiscRegNoEffect(misc_reg); + RegVal val = readMiscRegNoEffect(misc_reg); // The trap bit associated with CP14 is defined as RAZ val &= ~(1 << 14); // If a CP bit in NSACR is 0 then the corresponding bit in @@ -656,7 +656,7 @@ ISA::readMiscReg(int misc_reg, ThreadContext *tc) inSecureState(readMiscRegNoEffect(MISCREG_SCR), readMiscRegNoEffect(MISCREG_CPSR)); if (!secure_lookup) { - MiscReg mask = readMiscRegNoEffect(MISCREG_NSACR); + RegVal mask = readMiscRegNoEffect(MISCREG_NSACR); val |= (mask ^ 0x7FFF) & 0xBFFF; } // Set the bits for unimplemented coprocessors to RAO/WI @@ -710,7 +710,7 @@ ISA::readMiscReg(int misc_reg, ThreadContext *tc) } void -ISA::setMiscRegNoEffect(int misc_reg, const MiscReg &val) +ISA::setMiscRegNoEffect(int misc_reg, const RegVal &val) { assert(misc_reg < NumMiscRegs); @@ -732,10 +732,10 @@ ISA::setMiscRegNoEffect(int misc_reg, const MiscReg &val) } void -ISA::setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc) +ISA::setMiscReg(int misc_reg, const RegVal &val, ThreadContext *tc) { - MiscReg newVal = val; + RegVal newVal = val; bool secure_lookup; SCR scr; @@ -801,7 +801,7 @@ ISA::setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc) } } - MiscReg old_val = readMiscRegNoEffect(MISCREG_CPACR); + RegVal old_val = readMiscRegNoEffect(MISCREG_CPACR); newVal &= cpacrMask; newVal |= old_val & ~cpacrMask; DPRINTF(MiscRegs, "Writing misc reg %s: %#x\n", @@ -994,7 +994,7 @@ ISA::setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc) SCTLR sctlr = miscRegs[sctlr_idx]; SCTLR new_sctlr = newVal; new_sctlr.nmfi = ((bool)sctlr.nmfi) && !haveVirtualization; - miscRegs[sctlr_idx] = (MiscReg)new_sctlr; + miscRegs[sctlr_idx] = (RegVal)new_sctlr; getITBPtr(tc)->invalidateMiscReg(); getDTBPtr(tc)->invalidateMiscReg(); } @@ -1563,8 +1563,9 @@ ISA::setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc) inSecureState(readMiscRegNoEffect(MISCREG_SCR), readMiscRegNoEffect(MISCREG_CPSR)); if (!secure_lookup) { - MiscReg oldValue = readMiscRegNoEffect(MISCREG_HCPTR); - MiscReg mask = (readMiscRegNoEffect(MISCREG_NSACR) ^ 0x7FFF) & 0xBFFF; + RegVal oldValue = readMiscRegNoEffect(MISCREG_HCPTR); + RegVal mask = + (readMiscRegNoEffect(MISCREG_NSACR) ^ 0x7FFF) & 0xBFFF; newVal = (newVal & ~mask) | (oldValue & mask); } break; @@ -1669,7 +1670,7 @@ ISA::setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc) TTBCR ttbcr = readMiscRegNoEffect(MISCREG_TTBCR); HCR hcr = readMiscRegNoEffect(MISCREG_HCR); - MiscReg newVal; + RegVal newVal; if (fault == NoFault) { Addr paddr = req->getPaddr(); if (haveLPAE && (ttbcr.eae || tranType & TLB::HypMode || @@ -1923,7 +1924,7 @@ ISA::setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc) fault = getDTBPtr(tc)->translateFunctional(req, tc, mode, tranType); - MiscReg newVal; + RegVal newVal; if (fault == NoFault) { Addr paddr = req->getPaddr(); uint64_t attr = getDTBPtr(tc)->getAttr(); |