45#include "debug/GIC.hh"
53using namespace ArmISA;
61 redistributor(nullptr),
64 maintenanceInterrupt(
gic->params().maint_int->get(tc)),
65 cpuId(tc->contextId())
93 "Invalid maintenance interrupt number\n");
101 if (hcr.tge && hcr.e2h) {
103 }
else if (hcr.tge) {
115 if (hcr.tge && hcr.e2h) {
117 }
else if (hcr.tge) {
189 ICH_VMCR_EL2 ich_vmcr_el2 =
191 value = ich_vmcr_el2.VENG0;
207 ICH_VMCR_EL2 ich_vmcr_el2 =
209 value = ich_vmcr_el2.VENG1;
216 ICC_IGRPEN1_EL3 igrp_el3 = 0;
231 (hcr_imo || hcr_fmo)) {
241 if ((rprio & 0x80) == 0) {
245 }
else if (rprio != 0xff) {
249 rprio = (rprio << 1) & 0xff;
280 ICH_LR_EL2 ich_lr_el2 =
286 value = ich_lr_el2.vINTID;
310 ICH_LR_EL2 ich_lr_el2 =
316 value = ich_lr_el2.vINTID;
343 ICH_VMCR_EL2 ich_vmcr_el2 =
346 value = ich_vmcr_el2.VBPR0;
352 ICH_VMCR_EL2 ich_vmcr_el2 =
355 if (ich_vmcr_el2.VCBPR) {
357 value = ich_vmcr_el2.VBPR0 + 1;
358 value = value < 7 ? value : 7;
360 value = ich_vmcr_el2.VBPR1;
377 if ((value & 0x80) == 0) {
381 }
else if (value != 0xff) {
385 value = (value << 1) & 0xff;
392 ICH_VMCR_EL2 ich_vmcr_el2 =
395 value = ich_vmcr_el2.VPMR;
430 ICH_LR_EL2 ich_lr_el2 =
434 int_id = ich_lr_el2.vINTID;
443 ich_lr_el2.State = ICH_LR_EL2_STATE_INVALID;
486 ICH_LR_EL2 ich_lr_el2 =
490 int_id = ich_lr_el2.vINTID;
499 ich_lr_el2.State = ICH_LR_EL2_STATE_INVALID;
519 ICC_SRE_EL1 icc_sre_el1 = 0;
537 ICC_SRE_EL2 icc_sre_el2 = 0;
541 icc_sre_el2.Enable = 1;
558 ICC_SRE_EL3 icc_sre_el3 = 0;
562 icc_sre_el3.Enable = 1;
583 ICC_CTLR_EL1 icc_ctlr_el1 = value;
584 icc_ctlr_el1.ExtRange = 0;
585 icc_ctlr_el1.RSS = 1;
586 icc_ctlr_el1.A3V = 1;
587 icc_ctlr_el1.SEIS = 0;
588 icc_ctlr_el1.IDbits = 1;
589 icc_ctlr_el1.PRIbits = PRIORITY_BITS - 1;
590 value = icc_ctlr_el1;
596 ICV_CTLR_EL1 icv_ctlr_el1 = value;
597 icv_ctlr_el1.RSS = 0;
598 icv_ctlr_el1.A3V = 1;
599 icv_ctlr_el1.SEIS = 0;
600 icv_ctlr_el1.IDbits = 1;
601 icv_ctlr_el1.PRIbits = 7;
602 value = icv_ctlr_el1;
618 ICC_CTLR_EL3 icc_ctlr_el3 = value;
619 icc_ctlr_el3.ExtRange = 0;
620 icc_ctlr_el3.RSS = 1;
621 icc_ctlr_el3.nDS = 0;
622 icc_ctlr_el3.A3V = 1;
623 icc_ctlr_el3.SEIS = 0;
624 icc_ctlr_el3.IDbits = 0;
625 icc_ctlr_el3.PRIbits = PRIORITY_BITS - 1;
626 value = icc_ctlr_el3;
678 ICH_VTR_EL2 ich_vtr_el2 = value;
682 ich_vtr_el2.IDbits = 1;
702 ICH_LR_EL2 ich_lr_el2 =
705 if ((ich_lr_el2.State == ICH_LR_EL2_STATE_INVALID) &&
706 (ich_lr_el2.HW || !ich_lr_el2.EOI)) {
707 value |= (1 << lr_idx);
722 value = value & 0xffffffff;
735 panic(
"Gicv3CPUInterface::readMiscReg(): unknown register %d (%s)",
739 DPRINTF(GIC,
"Gicv3CPUInterface::readMiscReg(): register %s value %#x\n",
747 bool do_virtual_update =
false;
748 DPRINTF(GIC,
"Gicv3CPUInterface::setMiscReg(): register %s value %#x\n",
806 int int_id =
val & 0xffffff;
831 int int_id =
val & 0xffffff;
841 if (drop_prio == 0xff) {
851 ICH_LR_EL2 ich_lr_el2 =
855 uint8_t lr_group_prio = ich_lr_el2.Priority & 0xf8;
857 if (lr_group ==
Gicv3::G0S && lr_group_prio == drop_prio) {
876 int int_id =
val & 0xffffff;
910 int int_id =
val & 0xffffff;
920 if (drop_prio == 0xff) {
930 ICH_LR_EL2 ich_lr_el2 =
934 uint8_t lr_group_prio = ich_lr_el2.Priority & 0xf8;
936 if (lr_group ==
Gicv3::G1NS && lr_group_prio == drop_prio) {
951 (hcr_imo || hcr_fmo)) {
955 int int_id =
val & 0xffffff;
975 bool irq_is_secure = !single_sec_state && (group !=
Gicv3::G1NS);
977 bool route_fiq_to_el3 = scr_el3.fiq;
978 bool route_irq_to_el3 = scr_el3.irq;
979 bool route_fiq_to_el2 = hcr_fmo;
980 bool route_irq_to_el2 = hcr_imo;
987 if (single_sec_state && irq_is_grp0 && !route_fiq_to_el3) {
991 if (!irq_is_secure && !irq_is_grp0 && !route_irq_to_el3) {
999 if (single_sec_state && irq_is_grp0 &&
1000 !route_fiq_to_el3 && !route_fiq_to_el2) {
1004 if (!irq_is_secure && !irq_is_grp0 &&
1005 !route_irq_to_el3 && !route_irq_to_el2) {
1009 if (irq_is_grp0 && !route_fiq_to_el3) {
1014 (!irq_is_secure || !single_sec_state) &&
1015 !route_irq_to_el3) {
1032 int int_id =
val & 0xffffff;
1076 ICC_CTLR_EL1 icc_ctlr_el1_s =
1088 ICC_CTLR_EL1 icc_ctlr_el1_ns =
1109 ICH_VMCR_EL2 ich_vmcr_el2 =
1112 if ((group ==
Gicv3::G1NS) && ich_vmcr_el2.VCBPR) {
1123 if (
val < min_VPBR) {
1128 ich_vmcr_el2.VBPR0 =
val;
1130 ich_vmcr_el2.VBPR1 =
val;
1134 do_virtual_update =
true;
1153 ICC_CTLR_EL1 requested_icc_ctlr_el1 =
val;
1154 ICC_CTLR_EL1 icc_ctlr_el1 =
1157 ICC_CTLR_EL3 icc_ctlr_el3 =
1171 icc_ctlr_el1.PMHE = requested_icc_ctlr_el1.PMHE;
1172 icc_ctlr_el3.PMHE = icc_ctlr_el1.PMHE;
1176 icc_ctlr_el1.PMHE = requested_icc_ctlr_el1.PMHE;
1180 icc_ctlr_el1.EOImode = requested_icc_ctlr_el1.EOImode;
1184 icc_ctlr_el3.EOImode_EL1S = icc_ctlr_el1.EOImode;
1187 icc_ctlr_el3.EOImode_EL1NS = icc_ctlr_el1.EOImode;
1198 icc_ctlr_el1.CBPR = requested_icc_ctlr_el1.CBPR;
1201 icc_ctlr_el3.CBPR_EL1S = icc_ctlr_el1.CBPR;
1203 icc_ctlr_el3.CBPR_EL1NS = icc_ctlr_el1.CBPR;
1208 icc_ctlr_el1.CBPR = requested_icc_ctlr_el1.CBPR;
1219 ICV_CTLR_EL1 requested_icv_ctlr_el1 =
val;
1220 ICV_CTLR_EL1 icv_ctlr_el1 =
1222 icv_ctlr_el1.EOImode = requested_icv_ctlr_el1.EOImode;
1223 icv_ctlr_el1.CBPR = requested_icv_ctlr_el1.CBPR;
1229 ICH_VMCR_EL2 ich_vmcr_el2 =
1231 ich_vmcr_el2.VCBPR = icv_ctlr_el1.CBPR;
1232 ich_vmcr_el2.VEOIM = icv_ctlr_el1.EOImode;
1250 ICC_CTLR_EL3 requested_icc_ctlr_el3 =
val;
1255 ICC_CTLR_EL1 icc_ctlr_el1_s =
1257 ICC_CTLR_EL1 icc_ctlr_el1_ns =
1262 icc_ctlr_el1_ns.EOImode = requested_icc_ctlr_el3.EOImode_EL1NS;
1265 icc_ctlr_el1_s.EOImode = requested_icc_ctlr_el3.EOImode_EL1S;
1267 icc_ctlr_el1_ns.CBPR = requested_icc_ctlr_el3.CBPR_EL1NS;
1269 icc_ctlr_el1_s.CBPR = requested_icc_ctlr_el3.CBPR_EL1S;
1276 ICC_CTLR_EL3 icc_ctlr_el3 =
1279 icc_ctlr_el3.RM = requested_icc_ctlr_el3.RM;
1280 icc_ctlr_el3.EOImode_EL1NS = requested_icc_ctlr_el3.EOImode_EL1NS;
1281 icc_ctlr_el3.EOImode_EL1S = requested_icc_ctlr_el3.EOImode_EL1S;
1282 icc_ctlr_el3.EOImode_EL3 = requested_icc_ctlr_el3.EOImode_EL3;
1283 icc_ctlr_el3.CBPR_EL1NS = requested_icc_ctlr_el3.CBPR_EL1NS;
1284 icc_ctlr_el3.CBPR_EL1S = requested_icc_ctlr_el3.CBPR_EL1S;
1306 if (!(old_icc_pmr_el1 & 0x80)) {
1320 val &= ~0
U << (8 - PRIORITY_BITS);
1325 ICH_VMCR_EL2 ich_vmcr_el2 =
1327 ich_vmcr_el2.VPMR =
val & 0xff;
1349 ICH_VMCR_EL2 ich_vmcr_el2 =
1351 ich_vmcr_el2.VENG0 =
enable;
1372 ICH_VMCR_EL2 ich_vmcr_el2 =
1374 ich_vmcr_el2.VENG1 =
enable;
1383 ICC_IGRPEN1_EL3 icc_igrpen1_el3 =
val;
1432 ICH_HCR_EL2 requested_ich_hcr_el2 =
val;
1433 ICH_HCR_EL2 ich_hcr_el2 =
1436 if (requested_ich_hcr_el2.EOIcount >= ich_hcr_el2.EOIcount)
1441 ich_hcr_el2.EOIcount = requested_ich_hcr_el2.EOIcount;
1444 ich_hcr_el2.TDIR = requested_ich_hcr_el2.TDIR;
1445 ich_hcr_el2.TSEI = requested_ich_hcr_el2.TSEI;
1446 ich_hcr_el2.TALL1 = requested_ich_hcr_el2.TALL1;;
1447 ich_hcr_el2.TALL0 = requested_ich_hcr_el2.TALL0;;
1448 ich_hcr_el2.TC = requested_ich_hcr_el2.TC;
1449 ich_hcr_el2.VGrp1DIE = requested_ich_hcr_el2.VGrp1DIE;
1450 ich_hcr_el2.VGrp1EIE = requested_ich_hcr_el2.VGrp1EIE;
1451 ich_hcr_el2.VGrp0DIE = requested_ich_hcr_el2.VGrp0DIE;
1452 ich_hcr_el2.VGrp0EIE = requested_ich_hcr_el2.VGrp0EIE;
1453 ich_hcr_el2.NPIE = requested_ich_hcr_el2.NPIE;
1454 ich_hcr_el2.LRENPIE = requested_ich_hcr_el2.LRENPIE;
1455 ich_hcr_el2.UIE = requested_ich_hcr_el2.UIE;
1456 ich_hcr_el2.En = requested_ich_hcr_el2.En;
1458 do_virtual_update =
true;
1465 ICH_LRC requested_ich_lrc =
val;
1468 ich_lrc.State = requested_ich_lrc.State;
1469 ich_lrc.HW = requested_ich_lrc.HW;
1470 ich_lrc.Group = requested_ich_lrc.Group;
1476 ich_lrc.Priority = (requested_ich_lrc.Priority & 0xf8) |
1477 (ich_lrc.Priority & 0x07);
1488 if (requested_ich_lrc.HW == 0) {
1489 ich_lrc.EOI = requested_ich_lrc.EOI;
1491 ich_lrc.pINTID = requested_ich_lrc.pINTID;
1495 do_virtual_update =
true;
1503 val = (old_val & 0xffffffff00000000) | (
val & 0xffffffff);
1504 do_virtual_update =
true;
1510 ICH_LR_EL2 requested_ich_lr_el2 =
val;
1513 ich_lr_el2.State = requested_ich_lr_el2.State;
1514 ich_lr_el2.HW = requested_ich_lr_el2.HW;
1515 ich_lr_el2.Group = requested_ich_lr_el2.Group;
1521 ich_lr_el2.Priority = (requested_ich_lr_el2.Priority & 0xf8) |
1522 (ich_lr_el2.Priority & 0x07);
1533 if (requested_ich_lr_el2.HW == 0) {
1534 ich_lr_el2.EOI = requested_ich_lr_el2.EOI;
1536 ich_lr_el2.pINTID = requested_ich_lr_el2.pINTID;
1543 ich_lr_el2.vINTID = requested_ich_lr_el2.vINTID;
1546 do_virtual_update =
true;
1553 ICH_VMCR_EL2 requested_ich_vmcr_el2 =
val;
1554 ICH_VMCR_EL2 ich_vmcr_el2 =
1556 ich_vmcr_el2.VPMR = requested_ich_vmcr_el2.VPMR;
1559 if (requested_ich_vmcr_el2.VBPR0 < min_vpr0) {
1560 ich_vmcr_el2.VBPR0 = min_vpr0;
1562 ich_vmcr_el2.VBPR0 = requested_ich_vmcr_el2.VBPR0;
1565 uint8_t min_vpr1 = min_vpr0 + 1;
1567 if (requested_ich_vmcr_el2.VBPR1 < min_vpr1) {
1568 ich_vmcr_el2.VBPR1 = min_vpr1;
1570 ich_vmcr_el2.VBPR1 = requested_ich_vmcr_el2.VBPR1;
1573 ich_vmcr_el2.VEOIM = requested_ich_vmcr_el2.VEOIM;
1574 ich_vmcr_el2.VCBPR = requested_ich_vmcr_el2.VCBPR;
1575 ich_vmcr_el2.VENG1 = requested_ich_vmcr_el2.VENG1;
1576 ich_vmcr_el2.VENG0 = requested_ich_vmcr_el2.VENG0;
1616 panic(
"Gicv3CPUInterface::setMiscReg(): unknown register %d (%s)",
1622 if (do_virtual_update) {
1645 ICH_LR_EL2 ich_lr_el2 =
1650 (ich_lr_el2.vINTID == int_id)) {
1692 if ((
currEL() ==
EL3) && icc_ctlr_el3.RM) {
1706 if (irq_is_secure) {
1722 int apr_misc_reg = 0;
1735 panic(
"Invalid Gicv3::GroupId");
1753 for (
int i = 0;
i < apr_max;
i++) {
1757 if (!vapr0 && !vapr1) {
1761 int vapr0_count =
ctz32(vapr0);
1762 int vapr1_count =
ctz32(vapr1);
1764 if (vapr0_count <= vapr1_count) {
1784 uint16_t target_list =
bits(
val, 15, 0);
1785 uint32_t int_id =
bits(
val, 27, 24);
1794 uint32_t affinity_i = redistributor_i->
getAffinity();
1805 if ((affinity_i >> 8) !=
1810 uint8_t aff0_i =
bits(affinity_i, 7, 0);
1812 if (!(aff0_i >=
rs * 16 && aff0_i < (
rs + 1) * 16 &&
1813 ((0x1 << (aff0_i -
rs * 16)) & target_list))) {
1818 redistributor_i->
sendSGI(int_id, group,
ns);
1823Gicv3CPUInterface::activateIRQ(uint32_t int_id,
Gicv3::GroupId group)
1827 int apr_bit = prio >> (8 - PRIORITY_BITS);
1828 int reg_bit = apr_bit % 32;
1842 panic(
"Invalid Gicv3::GroupId");
1846 apr |= (1 << reg_bit);
1875 uint8_t prio = ich_lr_el.Priority & 0xf8;
1877 int reg_no = apr_bit / 32;
1878 int reg_bit = apr_bit % 32;
1882 apr |= (1 << reg_bit);
1909 if (ich_lr_el2.HW) {
1920 ich_lr_el2.State = ich_lr_el2.State & ~ICH_LR_EL2_STATE_ACTIVE;
1931 ICC_CTLR_EL1 icc_ctlr_el1_s =
1933 ICC_CTLR_EL1 icc_ctlr_el1_ns =
1936 if ((group ==
Gicv3::G1S && icc_ctlr_el1_s.CBPR) ||
1956 return ~0
U << (bpr + 1);
1962 ICH_VMCR_EL2 ich_vmcr_el2 =
1965 if ((group ==
Gicv3::G1NS) && ich_vmcr_el2.VCBPR) {
1972 bpr = ich_vmcr_el2.VBPR0;
1974 bpr = ich_vmcr_el2.VBPR1;
1982 return ~0
U << (bpr + 1);
1989 ICC_CTLR_EL3 icc_ctlr_el3 =
1991 return icc_ctlr_el3.EOImode_EL3;
1993 ICC_CTLR_EL1 icc_ctlr_el1 = 0;
1998 return icc_ctlr_el1.EOImode;
2006 return ich_vmcr_el2.VEOIM;
2016 if (g1nz_ctz < g0_ctz && g1nz_ctz < gq_ctz) {
2020 if (gq_ctz < g0_ctz) {
2043 bool signal_IRQ =
false;
2044 bool signal_FIQ =
false;
2056 DPRINTF(GIC,
"Gicv3CPUInterface::update(): "
2057 "posting int as %d!\n", int_type);
2058 int_type ==
INT_IRQ ? signal_IRQ = true : signal_FIQ =
true;
2080 bool signal_IRQ =
false;
2081 bool signal_FIQ =
false;
2085 ICH_LR_EL2 ich_lr_el2 =
2089 if (ich_lr_el2.Group) {
2104 }
else if (maint_pending) {
2109 DPRINTF(GIC,
"Gicv3CPUInterface::virtualUpdate(): "
2117 DPRINTF(GIC,
"Gicv3CPUInterface::virtualUpdate(): "
2132 if (!ich_vmcr_el2.VENG0 && !ich_vmcr_el2.VENG1) {
2137 uint8_t highest_prio = 0xff;
2139 for (
int i = 0;
i < 16;
i++) {
2140 ICH_LR_EL2 ich_lr_el2 =
2147 if (ich_lr_el2.Group) {
2149 if (!ich_vmcr_el2.VENG1) {
2154 if (!ich_vmcr_el2.VENG0) {
2159 uint8_t prio = ich_lr_el2.Priority;
2161 if (prio < highest_prio) {
2162 highest_prio = prio;
2174 if (!ich_hcr_el2.En) {
2179 ICH_LR_EL2 ich_lr_el2 =
2181 uint8_t prio = ich_lr_el2.Priority;
2192 if (rprio == 0xff) {
2199 if ((prio & prio_mask) < (rprio & prio_mask)) {
2211 for (
int i = 0;
i < num_aprs;
i++) {
2232 uint32_t EOI_cout =
bits(ich_hcr_el2, 31, 27);
2234 ich_hcr_el2 =
insertBits(ich_hcr_el2, 31, 27, EOI_cout);
2242 bool is_fiq =
false;
2259 panic(
"Gicv3CPUInterface::intSignalType(): invalid group!");
2289 if (rprio == 0xff) {
2295 if ((
hppi.
prio & prio_mask) < (rprio & prio_mask)) {
2322 ICC_IGRPEN0_EL1 icc_igrpen0_el1 =
2328 ICC_IGRPEN1_EL1 icc_igrpen1_el1_s =
2334 ICC_IGRPEN1_EL1 icc_igrpen1_el1_ns =
2340 panic(
"Gicv3CPUInterface::groupEnable(): invalid group!\n");
2371 warn(
"Unimplemented Exception Level\n");
2416 ICH_LR_EL2 ich_lr_el2 =
2419 if ((ich_lr_el2.State == ICH_LR_EL2_STATE_INVALID) &&
2420 !ich_lr_el2.HW && ich_lr_el2.EOI) {
2421 value |= (1 << lr_idx);
2428Gicv3CPUInterface::ICH_MISR_EL2
2432 ICH_MISR_EL2 ich_misr_el2 = 0;
2433 ICH_HCR_EL2 ich_hcr_el2 =
2435 ICH_VMCR_EL2 ich_vmcr_el2 =
2443 ich_misr_el2.EOI = 1;
2451 uint32_t num_valid_interrupts = 0;
2452 uint32_t num_pending_interrupts = 0;
2455 ICH_LR_EL2 ich_lr_el2 =
2458 if (ich_lr_el2.State != ICH_LR_EL2_STATE_INVALID) {
2459 num_valid_interrupts++;
2463 num_pending_interrupts++;
2467 if (ich_hcr_el2.UIE && (num_valid_interrupts < 2)) {
2474 if (ich_hcr_el2.LRENPIE && ich_hcr_el2.EOIcount) {
2475 ich_misr_el2.LRENP = 1;
2481 if (ich_hcr_el2.NPIE && (num_pending_interrupts == 0)) {
2482 ich_misr_el2.NP = 1;
2488 if (ich_hcr_el2.VGrp0EIE && ich_vmcr_el2.VENG0) {
2489 ich_misr_el2.VGrp0E = 1;
2495 if (ich_hcr_el2.VGrp0DIE && !ich_vmcr_el2.VENG0) {
2496 ich_misr_el2.VGrp0D = 1;
2502 if (ich_hcr_el2.VGrp1EIE && ich_vmcr_el2.VENG1) {
2503 ich_misr_el2.VGrp1E = 1;
2509 if (ich_hcr_el2.VGrp1DIE && !ich_vmcr_el2.VENG1) {
2510 ich_misr_el2.VGrp1D = 1;
2513 return ich_misr_el2;
2527 ICC_CTLR_EL1 icc_ctlr_el1_s =
2537 ICC_CTLR_EL1 icc_ctlr_el1_ns =
2545 bpr = bpr < 7 ? bpr : 7;
2551 panic(
"Should be used with G1S and G1NS only\n");
2594 if (PRIORITY_BITS >= 6) {
2598 if (PRIORITY_BITS >= 7) {
Base class for devices that use the MiscReg interfaces.
virtual void setISA(ISA *isa)
void setMiscRegNoEffect(RegIndex idx, RegVal val) override
int snsBankedIndex64(MiscRegIndex reg, bool ns) const
RegVal readMiscRegNoEffect(RegIndex idx) const override
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
virtual void clear()=0
Clear a signalled interrupt.
virtual void raise()=0
Signal an interrupt.
uint32_t num() const
Get interrupt number.
static bool callSetWakeRequest(ThreadContext *tc)
Notify the power controller of WAKEREQUEST assertion.
bool has(ArmExtension ext) const
static void callClearWakeRequest(ThreadContext *tc)
Notify the power controller of WAKEREQUEST deassertion.
const Params & params() const
virtual bool blockIntUpdate() const
When trasferring the state between two GICs (essentially writing architectural registers) an interrup...
ArmSystem * getSystem() const
void dropPriority(Gicv3::GroupId group)
static const uint8_t VIRTUAL_PREEMPTION_BITS
uint8_t virtualDropPriority()
bool isSecureBelowEL3() const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void clearPendingInterrupts(void)
bool isEOISplitMode() const
bool groupEnabled(Gicv3::GroupId group) const
void resetHppi(uint32_t intid)
EndBitUnion(ICV_CTLR_EL1) protected void generateSGI(RegVal val, Gicv3::GroupId group)
void serialize(CheckpointOut &cp) const override
Serialize an object.
void virtualIncrementEOICount()
ArmISA::InterruptTypes intSignalType(Gicv3::GroupId group) const
ArmISA::ExceptionLevel currEL() const
uint8_t highestActivePriority() const
uint64_t eoiMaintenanceInterruptStatus() const
bool hppviCanPreempt(int lrIdx) const
void virtualActivateIRQ(uint32_t lrIdx)
Gicv3Redistributor * redistributor
void deassertWakeRequest(void)
bool inSecureState() const
uint32_t getHPPIR1() const
RegVal bpr1(Gicv3::GroupId group)
void setThreadContext(ThreadContext *tc) override
static const uint8_t GIC_MIN_BPR
bool getHCREL2IMO() const
RegVal readBankedMiscReg(ArmISA::MiscRegIndex misc_reg) const
bool virtualIsEOISplitMode() const
uint32_t groupPriorityMask(Gicv3::GroupId group)
Gicv3Distributor * distributor
ArmInterruptPin * maintenanceInterrupt
void assertWakeRequest(void)
ICH_MISR_EL2 maintenanceInterruptStatus() const
static const uint8_t GIC_MIN_BPR_NS
void deactivateIRQ(uint32_t intid, Gicv3::GroupId group)
static const uint64_t ICH_LR_EL2_STATE_ACTIVE_PENDING
static const uint8_t VIRTUAL_NUM_LIST_REGS
int highestActiveGroup() const
bool getHCREL2FMO() const
uint8_t virtualHighestActivePriority() const
void setBankedMiscReg(ArmISA::MiscRegIndex misc_reg, RegVal val) const
uint32_t virtualGroupPriorityMask(Gicv3::GroupId group) const
void setMiscReg(int misc_reg, RegVal val) override
Write to a system register belonging to this device.
static const uint64_t ICH_LR_EL2_STATE_ACTIVE
static const uint64_t ICH_LR_EL2_STATE_PENDING
Gicv3CPUInterface(Gicv3 *gic, ThreadContext *tc)
bool haveEL(ArmISA::ExceptionLevel el) const
int virtualFindActive(uint32_t intid) const
void virtualDeactivateIRQ(int lrIdx)
bool havePendingInterrupts(void) const
static const uint8_t GIC_MIN_VBPR
RegVal readMiscReg(int misc_reg) override
Read a system register belonging to this device.
uint32_t getHPPIR0() const
static const uint8_t VIRTUAL_PRIORITY_BITS
void copy(Gicv3Registers *from, Gicv3Registers *to)
void activateIRQ(uint32_t int_id)
void deactivateIRQ(uint32_t int_id)
Gicv3::GroupId getIntGroup(int int_id) const
uint32_t getAffinity() const
void activateIRQ(uint32_t int_id)
std::vector< bool > irqPending
Gicv3::GroupId getIntGroup(int int_id) const
void deactivateIRQ(uint32_t int_id)
static const uint32_t SMALLEST_LPI_ID
void sendSGI(uint32_t int_id, Gicv3::GroupId group, bool ns)
void setClrLPI(uint64_t data, bool set)
static void copyCpuRegister(Gicv3Registers *from, Gicv3Registers *to, const ArmISA::Affinity &aff, ArmISA::MiscRegIndex misc_reg)
Gicv3Redistributor * getRedistributor(ContextID context_id) const
void deassertInt(uint32_t cpu, ArmISA::InterruptTypes int_type)
Gicv3Distributor * getDistributor() const
bool haveAsserted(uint32_t cpu) const
static const int INTID_NONSECURE
void deassertAll(uint32_t cpu)
static const int INTID_SPURIOUS
static const int INTID_SECURE
void postInt(uint32_t cpu, ArmISA::InterruptTypes int_type)
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual void activate()=0
Set the status to Active.
virtual BaseISA * getIsaPtr() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
constexpr int ctz32(uint32_t value)
Count trailing zeros in a 32-bit value.
constexpr T insertBits(T val, unsigned first, unsigned last, B bit_val)
Returns val with bits first to last set to the LSBs of bit_val.
#define panic(...)
This implements a cprintf based panic() function.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define SERIALIZE_ENUM(scalar)
#define UNSERIALIZE_ENUM(scalar)
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
bool isSecure(ThreadContext *tc)
Bitfield< 11, 0 > affinity
bool isSecureBelowEL3(ThreadContext *tc)
@ MISCREG_ICC_BPR1_EL1_NS
@ MISCREG_ICC_IGRPEN1_EL1_NS
@ MISCREG_ICC_IGRPEN1_EL3
@ MISCREG_ICC_IGRPEN1_EL1_S
@ MISCREG_ICV_IGRPEN0_EL1
@ MISCREG_ICC_AP1R0_EL1_S
@ MISCREG_ICC_CTLR_EL1_NS
@ MISCREG_ICC_AP1R0_EL1_NS
@ MISCREG_ICC_IGRPEN0_EL1
@ MISCREG_ICC_IGRPEN1_EL1
@ MISCREG_ICV_IGRPEN1_EL1
const char *const miscRegName[]
bool inAArch64(ThreadContext *tc)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)