}
}
-ArmISA::MiscReg
+RegVal
Gicv3CPUInterface::readMiscReg(int misc_reg)
{
- ArmISA::MiscReg value = isa->readMiscRegNoEffect(misc_reg);
+ RegVal value = isa->readMiscRegNoEffect(misc_reg);
bool hcr_fmo = getHCREL2FMO();
bool hcr_imo = getHCREL2IMO();
int lr_idx = getHPPVILR();
if (lr_idx >= 0) {
- ArmISA::MiscReg lr =
+ RegVal lr =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
Gicv3::GroupId group =
lr & ICH_LR_EL2_GROUP ? Gicv3::G1NS : Gicv3::G0S;
int lr_idx = getHPPVILR();
if (lr_idx >= 0) {
- ArmISA::MiscReg lr =
+ RegVal lr =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
Gicv3::GroupId group =
lr & ICH_LR_EL2_GROUP ? Gicv3::G1NS : Gicv3::G0S;
case MISCREG_ICV_BPR1_EL1: {
Gicv3::GroupId group =
misc_reg == MISCREG_ICV_BPR0_EL1 ? Gicv3::G0S : Gicv3::G1NS;
- ArmISA::MiscReg ich_vmcr_el2 =
+ RegVal ich_vmcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
bool sat_inc = false;
uint32_t int_id = Gicv3::INTID_SPURIOUS;
if (lr_idx >= 0) {
- ArmISA::MiscReg lr =
+ RegVal lr =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
if (!(lr & ICH_LR_EL2_GROUP) && hppviCanPreempt(lr_idx)) {
uint32_t int_id = Gicv3::INTID_SPURIOUS;
if (lr_idx >= 0) {
- ArmISA::MiscReg lr =
+ RegVal lr =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
if (lr & ICH_LR_EL2_GROUP && hppviCanPreempt(lr_idx)) {
if (haveEL(EL3) && !distributor->DS) {
// DIB is RO alias of ICC_SRE_EL3.DIB
// DFB is RO alias of ICC_SRE_EL3.DFB
- ArmISA::MiscReg icc_sre_el3 =
+ RegVal icc_sre_el3 =
isa->readMiscRegNoEffect(MISCREG_ICC_SRE_EL3);
dfb = icc_sre_el3 & ICC_SRE_EL3_DFB;
dib = icc_sre_el3 & ICC_SRE_EL3_DIB;
} else if (haveEL(EL3) && distributor->DS) {
// DIB is RW alias of ICC_SRE_EL3.DIB
// DFB is RW alias of ICC_SRE_EL3.DFB
- ArmISA::MiscReg icc_sre_el3 =
+ RegVal icc_sre_el3 =
isa->readMiscRegNoEffect(MISCREG_ICC_SRE_EL3);
dfb = icc_sre_el3 & ICC_SRE_EL3_DFB;
dib = icc_sre_el3 & ICC_SRE_EL3_DIB;
} else if ((!haveEL(EL3) || distributor->DS) and haveEL(EL2)) {
// DIB is RO alias of ICC_SRE_EL2.DIB
// DFB is RO alias of ICC_SRE_EL2.DFB
- ArmISA::MiscReg icc_sre_el2 =
+ RegVal icc_sre_el2 =
isa->readMiscRegNoEffect(MISCREG_ICC_SRE_EL2);
dfb = icc_sre_el2 & ICC_SRE_EL2_DFB;
dib = icc_sre_el2 & ICC_SRE_EL2_DIB;
case MISCREG_ICV_CTLR_EL1: {
value = ICC_CTLR_EL1_A3V | (1 << ICC_CTLR_EL1_IDBITS_SHIFT) |
(7 << ICC_CTLR_EL1_PRIBITS_SHIFT);
- ArmISA::MiscReg ich_vmcr_el2 =
+ RegVal ich_vmcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
if (ich_vmcr_el2 & ICH_VMCR_EL2_VEOIM) {
value |= ICC_CTLR_EL3_RSS | ICC_CTLR_EL3_A3V | (0 << 11) |
((PRIORITY_BITS - 1) << 8);
// Aliased bits...
- ArmISA::MiscReg icc_ctlr_el1_ns =
+ RegVal icc_ctlr_el1_ns =
isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL1_NS);
- ArmISA::MiscReg icc_ctlr_el1_s =
+ RegVal icc_ctlr_el1_s =
isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL1_S);
if (icc_ctlr_el1_ns & ICC_CTLR_EL1_EOIMODE) {
value = 0;
// Scan list registers and fill in the U, NP and EOI bits
eoiMaintenanceInterruptStatus((uint32_t *) &value);
- ArmISA::MiscReg ich_hcr_el2 =
+ RegVal ich_hcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_HCR_EL2);
- ArmISA::MiscReg ich_vmcr_el2 =
+ RegVal ich_vmcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
if (ich_hcr_el2 &
value = 0;
for (int lr_idx = 0; lr_idx < VIRTUAL_NUM_LIST_REGS; lr_idx++) {
- ArmISA::MiscReg lr =
+ RegVal lr =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
if ((lr & ICH_LR_EL2_STATE_MASK) == 0 &&
}
void
-Gicv3CPUInterface::setMiscReg(int misc_reg, ArmISA::MiscReg val)
+Gicv3CPUInterface::setMiscReg(int misc_reg, RegVal val)
{
bool do_virtual_update = false;
DPRINTF(GIC, "Gicv3CPUInterface::setMiscReg(): "
// No LR found matching
virtualIncrementEOICount();
} else {
- ArmISA::MiscReg lr =
+ RegVal lr =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
Gicv3::GroupId lr_group =
lr & ICH_LR_EL2_GROUP ? Gicv3::G1NS : Gicv3::G0S;
// No LR found matching
virtualIncrementEOICount();
} else {
- ArmISA::MiscReg lr =
+ RegVal lr =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
Gicv3::GroupId lr_group =
lr & ICH_LR_EL2_GROUP ? Gicv3::G1NS : Gicv3::G0S;
case MISCREG_ICV_BPR1_EL1: {
Gicv3::GroupId group =
misc_reg == MISCREG_ICV_BPR0_EL1 ? Gicv3::G0S : Gicv3::G1NS;
- ArmISA::MiscReg ich_vmcr_el2 =
+ RegVal ich_vmcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
if (group == Gicv3::G1NS && (ich_vmcr_el2 & ICH_VMCR_EL2_VCBPR)) {
mask = ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE;
}
- ArmISA::MiscReg old_val =
+ RegVal old_val =
isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL1);
old_val &= ~mask;
val = old_val | (val & mask);
}
case MISCREG_ICV_CTLR_EL1: {
- ArmISA::MiscReg ich_vmcr_el2 =
+ RegVal ich_vmcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
ich_vmcr_el2 = insertBits(ich_vmcr_el2, ICH_VMCR_EL2_VCBPR_SHIFT,
val & ICC_CTLR_EL1_CBPR ? 1 : 0);
case MISCREG_ICC_MCTLR:
case MISCREG_ICC_CTLR_EL3: {
- ArmISA::MiscReg icc_ctlr_el1_s =
+ RegVal icc_ctlr_el1_s =
isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL1_S);
- ArmISA::MiscReg icc_ctlr_el1_ns =
+ RegVal icc_ctlr_el1_ns =
isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL1_NS);
// ICC_CTLR_EL1(NS).EOImode is an alias of
isa->setMiscRegNoEffect(MISCREG_ICC_CTLR_EL1_S, icc_ctlr_el1_s);
isa->setMiscRegNoEffect(MISCREG_ICC_CTLR_EL1_NS, icc_ctlr_el1_ns);
// Only ICC_CTLR_EL3_EOIMODE_EL3 is writable
- ArmISA::MiscReg old_icc_ctlr_el3 =
+ RegVal old_icc_ctlr_el3 =
isa->readMiscRegNoEffect(MISCREG_ICC_CTLR_EL3);
old_icc_ctlr_el3 &= ~(ICC_CTLR_EL3_EOIMODE_EL3 | ICC_CTLR_EL3_RM);
val = old_icc_ctlr_el3 |
* NS access and Group 0 is inaccessible to NS: return the
* NS view of the current priority
*/
- ArmISA::MiscReg old_icc_pmr_el1 =
+ RegVal old_icc_pmr_el1 =
isa->readMiscRegNoEffect(MISCREG_ICC_PMR_EL1);
if (!(old_icc_pmr_el1 & 0x80)) {
case MISCREG_ICV_IGRPEN0_EL1: {
bool enable = val & 0x1;
- ArmISA::MiscReg ich_vmcr_el2 =
+ RegVal ich_vmcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
ich_vmcr_el2 = insertBits(ich_vmcr_el2,
ICH_VMCR_EL2_VENG0_SHIFT, enable);
case MISCREG_ICV_IGRPEN1_EL1: {
bool enable = val & 0x1;
- ArmISA::MiscReg ich_vmcr_el2 =
+ RegVal ich_vmcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
ich_vmcr_el2 = insertBits(ich_vmcr_el2,
ICH_VMCR_EL2_VENG1_SHIFT, enable);
} else if (haveEL(EL3) && distributor->DS) {
// DIB is RW alias of ICC_SRE_EL3.DIB
// DFB is RW alias of ICC_SRE_EL3.DFB
- ArmISA::MiscReg icc_sre_el3 =
+ RegVal icc_sre_el3 =
isa->readMiscRegNoEffect(MISCREG_ICC_SRE_EL3);
icc_sre_el3 = insertBits(icc_sre_el3, ICC_SRE_EL3_DFB, dfb);
icc_sre_el3 = insertBits(icc_sre_el3, ICC_SRE_EL3_DIB, dib);
// Enforce RES0 bits in priority field, 5 of 8 bits used
val = insertBits(val, ICH_LRC_PRIORITY_SHIFT + 2,
ICH_LRC_PRIORITY_SHIFT, 0);
- ArmISA::MiscReg old_val = isa->readMiscRegNoEffect(misc_reg);
+ RegVal old_val = isa->readMiscRegNoEffect(misc_reg);
val = (old_val & 0xffffffff) | (val << 32);
do_virtual_update = true;
break;
case MISCREG_ICH_LR0 ... MISCREG_ICH_LR15: {
// AArch32 (maps to AArch64 MISCREG_ICH_LR<n>_EL2 low half part)
- ArmISA::MiscReg old_val = isa->readMiscRegNoEffect(misc_reg);
+ RegVal old_val = isa->readMiscRegNoEffect(misc_reg);
val = (old_val & 0xffffffff00000000) | (val & 0xffffffff);
do_virtual_update = true;
break;
Gicv3CPUInterface::virtualFindActive(uint32_t int_id)
{
for (uint32_t lr_idx = 0; lr_idx < VIRTUAL_NUM_LIST_REGS; lr_idx++) {
- ArmISA::MiscReg lr =
+ RegVal lr =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
uint32_t lr_intid = bits(lr, 31, 0);
Gicv3CPUInterface::dropPriority(Gicv3::GroupId group)
{
int apr_misc_reg;
- ArmISA::MiscReg apr;
+ RegVal apr;
apr_misc_reg = group == Gicv3::G0S ?
MISCREG_ICC_AP0R0_EL1 : MISCREG_ICC_AP1R0_EL1;
apr = isa->readMiscRegNoEffect(apr_misc_reg);
int apr_max = 1 << (VIRTUAL_PREEMPTION_BITS - 5);
for (int i = 0; i < apr_max; i++) {
- ArmISA::MiscReg vapr0 =
- isa->readMiscRegNoEffect(MISCREG_ICH_AP0R0_EL2 + i);
- ArmISA::MiscReg vapr1 =
- isa->readMiscRegNoEffect(MISCREG_ICH_AP1R0_EL2 + i);
+ RegVal vapr0 = isa->readMiscRegNoEffect(MISCREG_ICH_AP0R0_EL2 + i);
+ RegVal vapr1 = isa->readMiscRegNoEffect(MISCREG_ICH_AP1R0_EL2 + i);
if (!vapr0 && !vapr1) {
continue;
int reg_bit = apr_bit % 32;
int apr_idx = group == Gicv3::G0S ?
MISCREG_ICC_AP0R0_EL1 : MISCREG_ICC_AP1R0_EL1;
- ArmISA::MiscReg apr = isa->readMiscRegNoEffect(apr_idx);
+ RegVal apr = isa->readMiscRegNoEffect(apr_idx);
apr |= (1 << reg_bit);
isa->setMiscRegNoEffect(apr_idx, apr);
Gicv3CPUInterface::virtualActivateIRQ(uint32_t lr_idx)
{
// Update active priority registers.
- ArmISA::MiscReg lr = isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 +
+ RegVal lr = isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 +
lr_idx);
Gicv3::GroupId group = lr & ICH_LR_EL2_GROUP ? Gicv3::G1NS : Gicv3::G0S;
uint8_t prio = bits(lr, 55, 48) & 0xf8;
int reg_bit = apr_bit % 32;
int apr_idx = group == Gicv3::G0S ?
MISCREG_ICH_AP0R0_EL2 + reg_no : MISCREG_ICH_AP1R0_EL2 + reg_no;
- ArmISA::MiscReg apr = isa->readMiscRegNoEffect(apr_idx);
+ RegVal apr = isa->readMiscRegNoEffect(apr_idx);
apr |= (1 << reg_bit);
isa->setMiscRegNoEffect(apr_idx, apr);
// Move interrupt state from pending to active.
void
Gicv3CPUInterface::virtualDeactivateIRQ(int lr_idx)
{
- ArmISA::MiscReg lr = isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 +
+ RegVal lr = isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 +
lr_idx);
if (lr & ICH_LR_EL2_HW) {
uint32_t
Gicv3CPUInterface::virtualGroupPriorityMask(Gicv3::GroupId group)
{
- ArmISA::MiscReg ich_vmcr_el2 =
+ RegVal ich_vmcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
if (group == Gicv3::G1NS && (ich_vmcr_el2 & ICH_VMCR_EL2_VCBPR)) {
bool
Gicv3CPUInterface::virtualIsEOISplitMode()
{
- ArmISA::MiscReg ich_vmcr_el2 =
- isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
+ RegVal ich_vmcr_el2 = isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
return ich_vmcr_el2 & ICH_VMCR_EL2_VEOIM;
}
int lr_idx = getHPPVILR();
if (lr_idx >= 0) {
- ArmISA::MiscReg ich_lr_el2 =
+ RegVal ich_lr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
if (hppviCanPreempt(lr_idx)) {
}
}
- ArmISA::MiscReg ich_hcr_el2 =
- isa->readMiscRegNoEffect(MISCREG_ICH_HCR_EL2);
+ RegVal ich_hcr_el2 = isa->readMiscRegNoEffect(MISCREG_ICH_HCR_EL2);
if (ich_hcr_el2 & ICH_HCR_EL2_EN) {
if (maintenanceInterruptStatus()) {
Gicv3CPUInterface::getHPPVILR()
{
int idx = -1;
- ArmISA::MiscReg ich_vmcr_el2 =
- isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
+ RegVal ich_vmcr_el2 = isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
if (!(ich_vmcr_el2 & (ICH_VMCR_EL2_VENG0 | ICH_VMCR_EL2_VENG1))) {
// VG0 and VG1 disabled...
uint8_t highest_prio = 0xff;
for (int i = 0; i < 16; i++) {
- ArmISA::MiscReg ich_lri_el2 =
+ RegVal ich_lri_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + i);
uint8_t state = bits(ich_lri_el2, 63, 62);
bool
Gicv3CPUInterface::hppviCanPreempt(int lr_idx)
{
- ArmISA::MiscReg lr = isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 +
- lr_idx);
+ RegVal lr = isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
if (!(isa->readMiscRegNoEffect(MISCREG_ICH_HCR_EL2) & ICH_HCR_EL2_EN)) {
// virtual interface is disabled
uint8_t num_aprs = 1 << (VIRTUAL_PRIORITY_BITS - 5);
for (int i = 0; i < num_aprs; i++) {
- ArmISA::MiscReg vapr =
+ RegVal vapr =
isa->readMiscRegNoEffect(MISCREG_ICH_AP0R0_EL2 + i) |
isa->readMiscRegNoEffect(MISCREG_ICH_AP1R0_EL2 + i);
Gicv3CPUInterface::virtualIncrementEOICount()
{
// Increment the EOICOUNT field in ICH_HCR_EL2
- ArmISA::MiscReg ich_hcr_el2 =
- isa->readMiscRegNoEffect(MISCREG_ICH_HCR_EL2);
+ RegVal ich_hcr_el2 = isa->readMiscRegNoEffect(MISCREG_ICH_HCR_EL2);
uint32_t EOI_cout = bits(ich_hcr_el2, 31, 27);
EOI_cout++;
ich_hcr_el2 = insertBits(ich_hcr_el2, 31, 27, EOI_cout);
bool seen_pending = false;
for (int lr_idx = 0; lr_idx < VIRTUAL_NUM_LIST_REGS; lr_idx++) {
- ArmISA::MiscReg lr =
- isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
+ RegVal lr = isa->readMiscRegNoEffect(MISCREG_ICH_LR0_EL2 + lr_idx);
if ((lr & (ICH_LR_EL2_STATE_MASK | ICH_LR_EL2_HW | ICH_LR_EL2_EOI)) ==
ICH_LR_EL2_EOI) {
}
if (misr) {
- ArmISA::MiscReg ich_hcr_el2 =
+ RegVal ich_hcr_el2 =
isa->readMiscRegNoEffect(MISCREG_ICH_HCR_EL2);
if (valid_count < 2 && (ich_hcr_el2 & ICH_HCR_EL2_UIE)) {
uint32_t value = 0;
/* Scan list registers and fill in the U, NP and EOI bits */
eoiMaintenanceInterruptStatus(&value);
- ArmISA::MiscReg ich_hcr_el2 =
- isa->readMiscRegNoEffect(MISCREG_ICH_HCR_EL2);
- ArmISA::MiscReg ich_vmcr_el2 =
- isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
+ RegVal ich_hcr_el2 = isa->readMiscRegNoEffect(MISCREG_ICH_HCR_EL2);
+ RegVal ich_vmcr_el2 = isa->readMiscRegNoEffect(MISCREG_ICH_VMCR_EL2);
if (ich_hcr_el2 & (ICH_HCR_EL2_LRENPIE | ICH_HCR_EL2_EOICOUNT_MASK)) {
value |= ICH_MISR_EL2_LRENP;