Deleted Added
sdiff udiff text old ( 14245:0c0a6fd47628 ) new ( 14246:033f20c96440 )
full compact
1/*
2 * Copyright (c) 2019 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 114 unchanged lines hidden (view full) ---

123 switch (misc_reg) {
124 // Active Priorities Group 1 Registers
125 case MISCREG_ICC_AP1R0:
126 case MISCREG_ICC_AP1R0_EL1: {
127 if ((currEL() == EL1) && !inSecureState() && hcr_imo) {
128 return isa->readMiscRegNoEffect(MISCREG_ICV_AP1R0_EL1);
129 }
130
131 break;
132 }
133
134 case MISCREG_ICC_AP1R1:
135 case MISCREG_ICC_AP1R1_EL1:
136
137 // only implemented if supporting 6 or more bits of priority
138 case MISCREG_ICC_AP1R2:
139 case MISCREG_ICC_AP1R2_EL1:

--- 595 unchanged lines hidden (view full) ---

735 switch (misc_reg) {
736 // Active Priorities Group 1 Registers
737 case MISCREG_ICC_AP1R0:
738 case MISCREG_ICC_AP1R0_EL1:
739 if ((currEL() == EL1) && !inSecureState() && hcr_imo) {
740 return isa->setMiscRegNoEffect(MISCREG_ICV_AP1R0_EL1, val);
741 }
742
743 break;
744
745 case MISCREG_ICC_AP1R1:
746 case MISCREG_ICC_AP1R1_EL1:
747
748 // only implemented if supporting 6 or more bits of priority
749 case MISCREG_ICC_AP1R2:
750 case MISCREG_ICC_AP1R2_EL1:
751

--- 962 unchanged lines hidden (view full) ---

1714 }
1715
1716 return hppi.intid;
1717}
1718
1719void
1720Gicv3CPUInterface::dropPriority(Gicv3::GroupId group)
1721{
1722 int apr_misc_reg;
1723 RegVal apr;
1724 apr_misc_reg = group == Gicv3::G0S ?
1725 MISCREG_ICC_AP0R0_EL1 : MISCREG_ICC_AP1R0_EL1;
1726 apr = isa->readMiscRegNoEffect(apr_misc_reg);
1727
1728 if (apr) {
1729 apr &= apr - 1;
1730 isa->setMiscRegNoEffect(apr_misc_reg, apr);
1731 }
1732
1733 update();
1734}
1735

--- 73 unchanged lines hidden (view full) ---

1809
1810void
1811Gicv3CPUInterface::activateIRQ(uint32_t int_id, Gicv3::GroupId group)
1812{
1813 // Update active priority registers.
1814 uint32_t prio = hppi.prio & 0xf8;
1815 int apr_bit = prio >> (8 - PRIORITY_BITS);
1816 int reg_bit = apr_bit % 32;
1817 int apr_idx = group == Gicv3::G0S ?
1818 MISCREG_ICC_AP0R0_EL1 : MISCREG_ICC_AP1R0_EL1;
1819 RegVal apr = isa->readMiscRegNoEffect(apr_idx);
1820 apr |= (1 << reg_bit);
1821 isa->setMiscRegNoEffect(apr_idx, apr);
1822
1823 // Move interrupt state from pending to active.
1824 if (int_id < Gicv3::SGI_MAX + Gicv3::PPI_MAX) {
1825 // SGI or PPI, redistributor
1826 redistributor->activateIRQ(int_id);

--- 748 unchanged lines hidden ---