}
-MiscReg
+RegVal
ISA::readMiscRegNoEffect(int misc_reg) const
{
assert(misc_reg < NumMiscRegs);
}
-MiscReg
+RegVal
ISA::readMiscReg(int misc_reg, ThreadContext *tc)
{
CPSR cpsr = 0;
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);
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
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
}
void
-ISA::setMiscRegNoEffect(int misc_reg, const MiscReg &val)
+ISA::setMiscRegNoEffect(int misc_reg, const RegVal &val)
{
assert(misc_reg < NumMiscRegs);
}
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;
}
}
- 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",
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();
}
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;
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 ||
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();
void initializeMiscRegMetadata();
- MiscReg miscRegs[NumMiscRegs];
+ RegVal miscRegs[NumMiscRegs];
const IntRegIndex *intRegMap;
void
void initID64(const ArmISAParams *p);
public:
- MiscReg readMiscRegNoEffect(int misc_reg) const;
- MiscReg readMiscReg(int misc_reg, ThreadContext *tc);
- void setMiscRegNoEffect(int misc_reg, const MiscReg &val);
- void setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc);
+ RegVal readMiscRegNoEffect(int misc_reg) const;
+ RegVal readMiscReg(int misc_reg, ThreadContext *tc);
+ void setMiscRegNoEffect(int misc_reg, const RegVal &val);
+ void setMiscReg(int misc_reg, const RegVal &val, ThreadContext *tc);
RegId
flattenRegId(const RegId& regId) const
}
void
-DummyISADevice::setMiscReg(int misc_reg, MiscReg val)
+DummyISADevice::setMiscReg(int misc_reg, RegVal val)
{
warn("Ignoring write of 0x%lx to miscreg %s\n",
val,
miscRegName[misc_reg]);
}
-MiscReg
+RegVal
DummyISADevice::readMiscReg(int misc_reg)
{
warn("Returning zero for read from miscreg %s\n", miscRegName[misc_reg]);
* @param misc_reg Register number (see miscregs.hh)
* @param val Value to store
*/
- virtual void setMiscReg(int misc_reg, MiscReg val) = 0;
+ virtual void setMiscReg(int misc_reg, RegVal val) = 0;
/**
* Read a system register belonging to this device.
* @param misc_reg Register number (see miscregs.hh)
* @return Register value.
*/
- virtual MiscReg readMiscReg(int misc_reg) = 0;
+ virtual RegVal readMiscReg(int misc_reg) = 0;
protected:
ISA *isa;
: BaseISADevice() {}
~DummyISADevice() {}
- void setMiscReg(int misc_reg, MiscReg val) override;
- MiscReg readMiscReg(int misc_reg) override;
+ void setMiscReg(int misc_reg, RegVal val) override;
+ RegVal readMiscReg(int misc_reg) override;
};
}
namespace ArmISA {
-const MiscReg PMU::reg_pmcr_wr_mask = 0x39;
+const RegVal PMU::reg_pmcr_wr_mask = 0x39;
PMU::PMU(const ArmPMUParams *p)
: SimObject(p), BaseISADevice(),
}
void
-PMU::setMiscReg(int misc_reg, MiscReg val)
+PMU::setMiscReg(int misc_reg, RegVal val)
{
DPRINTF(PMUVerbose, "setMiscReg(%s, 0x%x)\n",
miscRegName[unflattenMiscReg(misc_reg)], val);
miscRegName[misc_reg]);
}
-MiscReg
+RegVal
PMU::readMiscReg(int misc_reg)
{
- MiscReg val(readMiscRegInt(misc_reg));
+ RegVal val(readMiscRegInt(misc_reg));
DPRINTF(PMUVerbose, "readMiscReg(%s): 0x%x\n",
miscRegName[unflattenMiscReg(misc_reg)], val);
return val;
}
-MiscReg
+RegVal
PMU::readMiscRegInt(int misc_reg)
{
misc_reg = unflattenMiscReg(misc_reg);
}
void
-PMU::setOverflowStatus(MiscReg new_val)
+PMU::setOverflowStatus(RegVal new_val)
{
const bool int_old = reg_pmovsr != 0;
const bool int_new = new_val != 0;
* @param misc_reg Register number (see miscregs.hh)
* @param val Value to store
*/
- void setMiscReg(int misc_reg, MiscReg val) override;
+ void setMiscReg(int misc_reg, RegVal val) override;
/**
* Read a register within the PMU.
*
* @param misc_reg Register number (see miscregs.hh)
* @return Register value.
*/
- MiscReg readMiscReg(int misc_reg) override;
+ RegVal readMiscReg(int misc_reg) override;
protected: // PMU register types and constants
BitUnion32(PMCR_t)
typedef unsigned int EventTypeId;
protected: /* High-level register and interrupt handling */
- MiscReg readMiscRegInt(int misc_reg);
+ RegVal readMiscRegInt(int misc_reg);
/**
* PMCR write handling
*
* @param new_val New value of the Overflow Status Register
*/
- void setOverflowStatus(MiscReg new_val);
+ void setOverflowStatus(RegVal new_val);
protected: /* Probe handling and counter state */
struct CounterState;
protected: /* State that needs to be serialized */
/** Performance Monitor Count Enable Register */
- MiscReg reg_pmcnten;
+ RegVal reg_pmcnten;
/** Performance Monitor Control Register */
PMCR_t reg_pmcr;
PMSELR_t reg_pmselr;
/** Performance Monitor Interrupt Enable Register */
- MiscReg reg_pminten;
+ RegVal reg_pminten;
/** Performance Monitor Overflow Status Register */
- MiscReg reg_pmovsr;
+ RegVal reg_pmovsr;
/**
* Performance counter ID register
PMCR_t reg_pmcr_conf;
/** PMCR write mask when accessed from the guest */
- static const MiscReg reg_pmcr_wr_mask;
+ static const RegVal reg_pmcr_wr_mask;
/** Performance monitor interrupt number */
ArmInterruptPin *const interrupt;
memState->setStackMin(roundDown(memState->getStackMin(), pageSize));
}
-ArmISA::IntReg
+RegVal
ArmProcess32::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 6);
return tc->readIntReg(ArgumentReg0 + i++);
}
-ArmISA::IntReg
+RegVal
ArmProcess64::getSyscallArg(ThreadContext *tc, int &i)
{
assert(i < 8);
return tc->readIntReg(ArgumentReg0 + i++);
}
-ArmISA::IntReg
+RegVal
ArmProcess32::getSyscallArg(ThreadContext *tc, int &i, int width)
{
assert(width == 32 || width == 64);
return val;
}
-ArmISA::IntReg
+RegVal
ArmProcess64::getSyscallArg(ThreadContext *tc, int &i, int width)
{
return getSyscallArg(tc, i);
void
-ArmProcess32::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val)
+ArmProcess32::setSyscallArg(ThreadContext *tc, int i, RegVal val)
{
assert(i < 6);
tc->setIntReg(ArgumentReg0 + i, val);
}
void
-ArmProcess64::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val)
+ArmProcess64::setSyscallArg(ThreadContext *tc, int i, RegVal val)
{
assert(i < 8);
tc->setIntReg(ArgumentReg0 + i, val);
public:
- ArmISA::IntReg getSyscallArg(ThreadContext *tc, int &i, int width) override;
- ArmISA::IntReg getSyscallArg(ThreadContext *tc, int &i) override;
- void setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val) override;
- void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) override;
+ RegVal getSyscallArg(ThreadContext *tc, int &i, int width) override;
+ RegVal getSyscallArg(ThreadContext *tc, int &i) override;
+ void setSyscallArg(ThreadContext *tc, int i, RegVal val) override;
+ void setSyscallReturn(ThreadContext *tc,
+ SyscallReturn return_value) override;
};
class ArmProcess64 : public ArmProcess
public:
- ArmISA::IntReg getSyscallArg(ThreadContext *tc, int &i, int width) override;
- ArmISA::IntReg getSyscallArg(ThreadContext *tc, int &i) override;
- void setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val) override;
- void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) override;
+ RegVal getSyscallArg(ThreadContext *tc, int &i, int width) override;
+ RegVal getSyscallArg(ThreadContext *tc, int &i) override;
+ void setSyscallArg(ThreadContext *tc, int i, RegVal val) override;
+ void setSyscallReturn(ThreadContext *tc,
+ SyscallReturn return_value) override;
};
#endif // __ARM_PROCESS_HH__
using ArmISAInst::MaxInstDestRegs;
using ArmISAInst::MaxMiscDestRegs;
-typedef RegVal IntReg;
-
-// floating point register file entry type
-typedef RegVal FloatRegBits;
-typedef FloatRegVal FloatReg;
-
// Number of VecElem per Vector Register, computed based on the vector length
constexpr unsigned NumVecElemPerVecReg = 4;
using VecElem = uint32_t;
using ConstVecReg = ::VecRegT<VecElem, NumVecElemPerVecReg, true>;
using VecRegContainer = VecReg::Container;
-// cop-0/cop-1 system control register
-typedef RegVal MiscReg;
-
// condition code register; must be at least 32 bits for FpCondCodes
typedef uint64_t CCReg;