From: Antonios Motakis <[email protected]> On AArch64 we won't need to initialize an IRQ stack; just move the functionality to a header, so we may reuse the gic library.
Signed-off-by: Antonios Motakis <[email protected]> --- inmates/lib/arm/gic.c | 5 +---- inmates/lib/arm/include/gic.h | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/inmates/lib/arm/gic.c b/inmates/lib/arm/gic.c index 0ab8198..79d208c 100644 --- a/inmates/lib/arm/gic.c +++ b/inmates/lib/arm/gic.c @@ -14,7 +14,6 @@ #include <gic.h> static irq_handler_t irq_handler = (irq_handler_t)NULL; -static __attribute__((aligned(0x1000))) u32 irq_stack[1024]; /* Replaces the weak reference in header.S */ void vector_irq(void) @@ -37,9 +36,7 @@ void gic_setup(irq_handler_t handler) gic_init(); irq_handler = handler; - asm volatile (".arch_extension virt\n"); - asm volatile ("msr SP_irq, %0\n" : : "r" (irq_stack)); - asm volatile ("cpsie i\n"); + gic_setup_irq_stack(); } void gic_enable_irq(unsigned int irq) diff --git a/inmates/lib/arm/include/gic.h b/inmates/lib/arm/include/gic.h index 6a28e7d..55c09ea 100644 --- a/inmates/lib/arm/include/gic.h +++ b/inmates/lib/arm/include/gic.h @@ -20,6 +20,15 @@ #ifndef __ASSEMBLY__ +static inline void gic_setup_irq_stack(void) +{ + static __attribute__((aligned(0x1000))) u32 irq_stack[1024]; + + asm volatile (".arch_extension virt\n"); + asm volatile ("msr SP_irq, %0\n" : : "r" (irq_stack)); + asm volatile ("cpsie i\n"); +} + int gic_init(void); void gic_enable(unsigned int irqn); void gic_write_eoi(u32 irqn); -- 2.8.0.rc3 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
