[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 05/10] arm64: Add accessors for the ICH_APxRn_EL2 registers
From: Manish Jaggi <manish.jaggi@xxxxxxxxxx> define accessors that take the register number as a parameter. Signed-off-by: Manish Jaggi <manish.jaggi@xxxxxxxxxx> --- xen/arch/arm/arm64/vsysreg.c | 92 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c index ba4a5ab7e1..a698af21f2 100644 --- a/xen/arch/arm/arm64/vsysreg.c +++ b/xen/arch/arm/arm64/vsysreg.c @@ -314,6 +314,98 @@ void handle_igrpen1(struct cpu_user_regs *regs, int regidx, bool read, __vgic_v3_write_igrpen1(regs, regidx); } +void __vgic_v3_write_ap0rn(u32 val, int n) +{ + switch (n) + { + case 0: + WRITE_SYSREG32(val, ICH_AP0R0_EL2); + break; + case 1: + WRITE_SYSREG32(val, ICH_AP0R1_EL2); + break; + case 2: + WRITE_SYSREG32(val, ICH_AP0R2_EL2); + break; + case 3: + WRITE_SYSREG32(val, ICH_AP0R3_EL2); + break; + default: + unreachable(); + } +} + +void __vgic_v3_write_ap1rn(u32 val, int n) +{ + switch (n) + { + case 0: + WRITE_SYSREG32(val, ICH_AP1R0_EL2); + break; + case 1: + WRITE_SYSREG32(val, ICH_AP1R1_EL2); + break; + case 2: + WRITE_SYSREG32(val, ICH_AP1R2_EL2); + break; + case 3: + WRITE_SYSREG32(val, ICH_AP1R3_EL2); + break; + default: + unreachable(); + } +} + +u32 __vgic_v3_read_ap0rn(int n) +{ + u32 val; + + switch (n) + { + case 0: + val = READ_SYSREG32(ICH_AP0R0_EL2); + break; + case 1: + val = READ_SYSREG32(ICH_AP0R1_EL2); + break; + case 2: + val = READ_SYSREG32(ICH_AP0R2_EL2); + break; + case 3: + val = READ_SYSREG32(ICH_AP0R3_EL2); + break; + default: + unreachable(); + } + + return val; +} + +u32 __vgic_v3_read_ap1rn(int n) +{ + u32 val; + + switch (n) + { + case 0: + val = READ_SYSREG32(ICH_AP1R0_EL2); + break; + case 1: + val = READ_SYSREG32(ICH_AP1R1_EL2); + break; + case 2: + val = READ_SYSREG32(ICH_AP1R2_EL2); + break; + case 3: + val = READ_SYSREG32(ICH_AP1R3_EL2); + break; + default: + unreachable(); + } + + return val; +} + int do_fixup_vgic_errata(struct cpu_user_regs *regs, const union hsr hsr) { int ret = 0; -- 2.14.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |