[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 05/17] Expose ich_read/write_lr in vgic-v3-sr.c
gicv3_ich_read/write_lr functions are duplicated in vgic-v3-sr.c This is done to make the file independent of the xen vgic code for handling the errata. Both the functions in the patch are static, so this patch needs subsequent patches to compile without error (unused function) Signed-off-by: Manish Jaggi <manish.jaggi@xxxxxxxxxx> --- xen/arch/arm/arm64/vgic-v3-sr.c | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/xen/arch/arm/arm64/vgic-v3-sr.c b/xen/arch/arm/arm64/vgic-v3-sr.c index 48346ed628..fc5246539e 100644 --- a/xen/arch/arm/arm64/vgic-v3-sr.c +++ b/xen/arch/arm/arm64/vgic-v3-sr.c @@ -209,6 +209,89 @@ static uint32_t vgic_v3_read_ap1rn(int n) return val; } +static uint64_t gicv3_ich_read_lr(int lr) +{ + switch ( lr ) + { + case 0: return READ_SYSREG(ICH_LR0_EL2); + case 1: return READ_SYSREG(ICH_LR1_EL2); + case 2: return READ_SYSREG(ICH_LR2_EL2); + case 3: return READ_SYSREG(ICH_LR3_EL2); + case 4: return READ_SYSREG(ICH_LR4_EL2); + case 5: return READ_SYSREG(ICH_LR5_EL2); + case 6: return READ_SYSREG(ICH_LR6_EL2); + case 7: return READ_SYSREG(ICH_LR7_EL2); + case 8: return READ_SYSREG(ICH_LR8_EL2); + case 9: return READ_SYSREG(ICH_LR9_EL2); + case 10: return READ_SYSREG(ICH_LR10_EL2); + case 11: return READ_SYSREG(ICH_LR11_EL2); + case 12: return READ_SYSREG(ICH_LR12_EL2); + case 13: return READ_SYSREG(ICH_LR13_EL2); + case 14: return READ_SYSREG(ICH_LR14_EL2); + case 15: return READ_SYSREG(ICH_LR15_EL2); + default: + unreachable(); + } +} + +static void gicv3_ich_write_lr(int lr, uint64_t val) +{ + switch ( lr ) + { + case 0: + WRITE_SYSREG(val, ICH_LR0_EL2); + break; + case 1: + WRITE_SYSREG(val, ICH_LR1_EL2); + break; + case 2: + WRITE_SYSREG(val, ICH_LR2_EL2); + break; + case 3: + WRITE_SYSREG(val, ICH_LR3_EL2); + break; + case 4: + WRITE_SYSREG(val, ICH_LR4_EL2); + break; + case 5: + WRITE_SYSREG(val, ICH_LR5_EL2); + break; + case 6: + WRITE_SYSREG(val, ICH_LR6_EL2); + break; + case 7: + WRITE_SYSREG(val, ICH_LR7_EL2); + break; + case 8: + WRITE_SYSREG(val, ICH_LR8_EL2); + break; + case 9: + WRITE_SYSREG(val, ICH_LR9_EL2); + break; + case 10: + WRITE_SYSREG(val, ICH_LR10_EL2); + break; + case 11: + WRITE_SYSREG(val, ICH_LR11_EL2); + break; + case 12: + WRITE_SYSREG(val, ICH_LR12_EL2); + break; + case 13: + WRITE_SYSREG(val, ICH_LR13_EL2); + break; + case 14: + WRITE_SYSREG(val, ICH_LR14_EL2); + break; + case 15: + WRITE_SYSREG(val, ICH_LR15_EL2); + break; + default: + return; + } + isb(); +} + /* * returns true if the register is emulated. */ -- 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 |