From 330cbfbdad5da9e18ce8914f24999d263d53bbab Mon Sep 17 00:00:00 2001 From: Sylvain Gauthier Date: Fri, 8 Mar 2019 14:02:55 +1100 Subject: [PATCH] Made declaration of handleReservedIRQ optional, refactored consequently --- include/arch/arm/arch/object/interrupt.h | 27 +++++++++++++++++++ .../plat/allwinnerA20/plat/machine/hardware.h | 10 ------- include/plat/am335x/plat/machine/hardware.h | 3 --- include/plat/am335x/plat/machine/interrupt.h | 6 ----- include/plat/apq8064/plat/machine/hardware.h | 6 ----- include/plat/bcm2837/plat/machine.h | 8 ------ include/plat/exynos4/plat/machine/hardware.h | 6 ----- include/plat/exynos5/plat/machine/hardware.h | 11 -------- include/plat/hikey/plat/machine/hardware.h | 6 ----- include/plat/imx31/plat/machine/interrupt.h | 11 -------- include/plat/imx6/plat/machine/hardware.h | 15 ----------- include/plat/imx7/plat/machine/hardware.h | 6 ----- include/plat/omap3/plat/machine/interrupt.h | 10 ------- include/plat/pc99/plat/machine/interrupt.h | 1 + include/plat/spike/plat/machine/hardware.h | 1 - include/plat/tk1/plat/machine/hardware.h | 21 --------------- include/plat/tx1/plat/machine/hardware.h | 11 -------- include/plat/tx2/plat/machine/hardware.h | 7 ----- include/plat/zynq7000/plat/machine/hardware.h | 11 -------- include/plat/zynqmp/plat/machine/hardware.h | 6 ----- src/object/interrupt.c | 7 +++++ src/plat/spike/machine/hardware.c | 7 ----- 22 files changed, 35 insertions(+), 162 deletions(-) diff --git a/include/arch/arm/arch/object/interrupt.h b/include/arch/arm/arch/object/interrupt.h index 8e344a6b7..1822f0e53 100644 --- a/include/arch/arm/arch/object/interrupt.h +++ b/include/arch/arm/arch/object/interrupt.h @@ -20,6 +20,33 @@ exception_t Arch_decodeIRQControlInvocation(word_t invLabel, word_t length, cte_t *srcSlot, extra_caps_t excaps, word_t *buffer); +/* Handle a platform-reserved IRQ. */ +#define DEF_HANDLE_RESERVED_IRQ +static inline void +handleReservedIRQ(irq_t irq) +{ +#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT + if (irq == KERNEL_PMU_IRQ) { + handleOverflowIRQ(); + } +#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */ + +#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT + if ((config_set(CONFIG_ARM_HYPERVISOR_SUPPORT)) && (irq == INTERRUPT_VGIC_MAINTENANCE)) { + VGICMaintenance(); + return; + } +#endif + +#ifdef CONFIG_ARM_SMMMU + if (config_set(CONFIG_ARM_SMMU) && (irq == INTERRUPT_SMMU)) { + plat_smmu_handle_interrupt(); + return; + } +#endif +} + + static inline exception_t Arch_checkIRQ(word_t irq_w) { diff --git a/include/plat/allwinnerA20/plat/machine/hardware.h b/include/plat/allwinnerA20/plat/machine/hardware.h index 012e323d9..43e457d06 100755 --- a/include/plat/allwinnerA20/plat/machine/hardware.h +++ b/include/plat/allwinnerA20/plat/machine/hardware.h @@ -11,16 +11,6 @@ #ifndef __PLAT_MACHINE_HARDWARE_H #define __PLAT_MACHINE_HARDWARE_H -#include -#include -#include -#include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -} - #endif diff --git a/include/plat/am335x/plat/machine/hardware.h b/include/plat/am335x/plat/machine/hardware.h index f5f9e035a..cffeb06af 100644 --- a/include/plat/am335x/plat/machine/hardware.h +++ b/include/plat/am335x/plat/machine/hardware.h @@ -11,9 +11,6 @@ #ifndef __PLAT_MACHINE_HARDWARE_H #define __PLAT_MACHINE_HARDWARE_H -#include -#include -#include #include #include diff --git a/include/plat/am335x/plat/machine/interrupt.h b/include/plat/am335x/plat/machine/interrupt.h index 4d125275a..0477823bc 100644 --- a/include/plat/am335x/plat/machine/interrupt.h +++ b/include/plat/am335x/plat/machine/interrupt.h @@ -101,12 +101,6 @@ maskInterrupt(bool_t disable, interrupt_t irq) } } -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -} - static inline void ackInterrupt(irq_t irq) { diff --git a/include/plat/apq8064/plat/machine/hardware.h b/include/plat/apq8064/plat/machine/hardware.h index c2da5c965..26e6abdfe 100644 --- a/include/plat/apq8064/plat/machine/hardware.h +++ b/include/plat/apq8064/plat/machine/hardware.h @@ -16,10 +16,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -} - #endif /* !__PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/bcm2837/plat/machine.h b/include/plat/bcm2837/plat/machine.h index da5d5d29d..912699775 100644 --- a/include/plat/bcm2837/plat/machine.h +++ b/include/plat/bcm2837/plat/machine.h @@ -132,14 +132,6 @@ enum irqNumbers { irqInvalid = (irq_t) - 1 }; -static inline void -handleReservedIRQ(irq_t irq) -{ - if (config_set(CONFIG_IRQ_REPORTING)) { - printf("Received reserved IRQ: %d\n", (int)irq); - } -} - interrupt_t getActiveIRQ(void); diff --git a/include/plat/exynos4/plat/machine/hardware.h b/include/plat/exynos4/plat/machine/hardware.h index c2da5c965..26e6abdfe 100644 --- a/include/plat/exynos4/plat/machine/hardware.h +++ b/include/plat/exynos4/plat/machine/hardware.h @@ -16,10 +16,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -} - #endif /* !__PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/exynos5/plat/machine/hardware.h b/include/plat/exynos5/plat/machine/hardware.h index 8613e9155..d7bfb62a4 100644 --- a/include/plat/exynos5/plat/machine/hardware.h +++ b/include/plat/exynos5/plat/machine/hardware.h @@ -18,15 +18,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ - if ((config_set(CONFIG_ARM_HYPERVISOR_SUPPORT)) && - (irq == INTERRUPT_VGIC_MAINTENANCE)) { - VGICMaintenance(); - return; - } -} - #endif /* !__PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/hikey/plat/machine/hardware.h b/include/plat/hikey/plat/machine/hardware.h index cad9016ad..1afbe2b16 100755 --- a/include/plat/hikey/plat/machine/hardware.h +++ b/include/plat/hikey/plat/machine/hardware.h @@ -17,10 +17,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -} - #endif diff --git a/include/plat/imx31/plat/machine/interrupt.h b/include/plat/imx31/plat/machine/interrupt.h index c013840c3..c0bc9653e 100644 --- a/include/plat/imx31/plat/machine/interrupt.h +++ b/include/plat/imx31/plat/machine/interrupt.h @@ -84,17 +84,6 @@ maskInterrupt(bool_t disable, interrupt_t irq) } } -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT - if (irq == KERNEL_PMU_IRQ) { - handleOverflowIRQ(); - } -#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */ -} - static inline void ackInterrupt(irq_t irq) { diff --git a/include/plat/imx6/plat/machine/hardware.h b/include/plat/imx6/plat/machine/hardware.h index 89f72ea90..0be111e07 100644 --- a/include/plat/imx6/plat/machine/hardware.h +++ b/include/plat/imx6/plat/machine/hardware.h @@ -11,21 +11,6 @@ #ifndef __PLAT_MACHINE_HARDWARE_H #define __PLAT_MACHINE_HARDWARE_H -#include -#include -#include -#include #include -#include - -static inline void -handleReservedIRQ(irq_t irq) -{ -#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT - if (irq == KERNEL_PMU_IRQ) { - handleOverflowIRQ(); - } -#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */ -} #endif /* !__PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/imx7/plat/machine/hardware.h b/include/plat/imx7/plat/machine/hardware.h index c2da5c965..26e6abdfe 100644 --- a/include/plat/imx7/plat/machine/hardware.h +++ b/include/plat/imx7/plat/machine/hardware.h @@ -16,10 +16,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -} - #endif /* !__PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/omap3/plat/machine/interrupt.h b/include/plat/omap3/plat/machine/interrupt.h index e8e789950..df5e65edc 100644 --- a/include/plat/omap3/plat/machine/interrupt.h +++ b/include/plat/omap3/plat/machine/interrupt.h @@ -91,16 +91,6 @@ maskInterrupt(bool_t disable, interrupt_t irq) } } -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ - /* We shouldn't be receiving any reserved IRQs anyway. */ - maskInterrupt(true, irq); - - return; -} - static inline void ackInterrupt(irq_t irq) { diff --git a/include/plat/pc99/plat/machine/interrupt.h b/include/plat/pc99/plat/machine/interrupt.h index 18e6ae1b8..effe8005e 100644 --- a/include/plat/pc99/plat/machine/interrupt.h +++ b/include/plat/pc99/plat/machine/interrupt.h @@ -24,6 +24,7 @@ #include /* Handle a platform-reserved IRQ. */ +#define DEF_HANDLE_RESERVED_IRQ static inline void handleReservedIRQ(irq_t irq) { diff --git a/include/plat/spike/plat/machine/hardware.h b/include/plat/spike/plat/machine/hardware.h index 5f59ae327..5c1dfb0bc 100644 --- a/include/plat/spike/plat/machine/hardware.h +++ b/include/plat/spike/plat/machine/hardware.h @@ -65,7 +65,6 @@ bool_t add_avail_p_reg(p_region_t reg); void map_kernel_devices(void); bool_t CONST isReservedIRQ(irq_t irq); -void handleReservedIRQ(irq_t irq); void ackInterrupt(irq_t irq); bool_t isIRQPending(void); /** MODIFIES: [*] */ diff --git a/include/plat/tk1/plat/machine/hardware.h b/include/plat/tk1/plat/machine/hardware.h index e1c91a1b4..77babc646 100644 --- a/include/plat/tk1/plat/machine/hardware.h +++ b/include/plat/tk1/plat/machine/hardware.h @@ -24,25 +24,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT - if (irq == KERNEL_PMU_IRQ) { - handleOverflowIRQ(); - } -#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */ - - if ((config_set(CONFIG_ARM_HYPERVISOR_SUPPORT)) && (irq == INTERRUPT_VGIC_MAINTENANCE)) { - VGICMaintenance(); - return; - } - - if (config_set(CONFIG_ARM_SMMU) && (irq == INTERRUPT_SMMU)) { - plat_smmu_handle_interrupt(); - return; - } -} - #endif diff --git a/include/plat/tx1/plat/machine/hardware.h b/include/plat/tx1/plat/machine/hardware.h index 25cc839d3..a120d25bc 100644 --- a/include/plat/tx1/plat/machine/hardware.h +++ b/include/plat/tx1/plat/machine/hardware.h @@ -20,15 +20,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ - if ((config_set(CONFIG_ARM_HYPERVISOR_SUPPORT)) && (irq == INTERRUPT_VGIC_MAINTENANCE)) { - VGICMaintenance(); - return; - } - printf("spurious irq %d\n", (int)irq); -} - #endif /* __PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/tx2/plat/machine/hardware.h b/include/plat/tx2/plat/machine/hardware.h index f472598cc..be463a5e6 100644 --- a/include/plat/tx2/plat/machine/hardware.h +++ b/include/plat/tx2/plat/machine/hardware.h @@ -20,11 +20,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ - printf("spurious irq %d\n", (int)irq); -} - #endif /* __PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/zynq7000/plat/machine/hardware.h b/include/plat/zynq7000/plat/machine/hardware.h index 821274dc8..373705af7 100644 --- a/include/plat/zynq7000/plat/machine/hardware.h +++ b/include/plat/zynq7000/plat/machine/hardware.h @@ -18,15 +18,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -#ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT - if (irq == KERNEL_PMU_IRQ) { - handleOverflowIRQ(); - } -#endif /* CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT */ -} - #endif /* !__PLAT_MACHINE_HARDWARE_H */ diff --git a/include/plat/zynqmp/plat/machine/hardware.h b/include/plat/zynqmp/plat/machine/hardware.h index e1c7634e6..55f490c0d 100644 --- a/include/plat/zynqmp/plat/machine/hardware.h +++ b/include/plat/zynqmp/plat/machine/hardware.h @@ -27,10 +27,4 @@ #include #include -/* Handle a platform-reserved IRQ. */ -static inline void -handleReservedIRQ(irq_t irq) -{ -} - #endif /* !__PLAT_MACHINE_HARDWARE_H */ diff --git a/src/object/interrupt.c b/src/object/interrupt.c index 7964b6456..78bced808 100644 --- a/src/object/interrupt.c +++ b/src/object/interrupt.c @@ -25,6 +25,13 @@ #include #include +#ifndef DEF_HANDLE_RESERVED_IRQ +static inline void +handleReservedIRQ(irq_t irq) +{ +} +#endif + exception_t decodeIRQControlInvocation(word_t invLabel, word_t length, cte_t *srcSlot, extra_caps_t excaps, diff --git a/src/plat/spike/machine/hardware.c b/src/plat/spike/machine/hardware.c index eb6da7ea4..2d95d263c 100644 --- a/src/plat/spike/machine/hardware.c +++ b/src/plat/spike/machine/hardware.c @@ -110,13 +110,6 @@ isReservedIRQ(irq_t irq) return false; } -/* Handle a platform-reserved IRQ. */ -void -handleReservedIRQ(irq_t irq) -{ - printf("handleReservedIRQ \n"); -} - void ackInterrupt(irq_t irq) {