4 #define IRQ_STACK_SIZE THREAD_SIZE
5 #define IRQ_STACK_START_SP THREAD_START_SP
9 #include <linux/percpu.h>
11 #include <asm-generic/irq.h>
12 #include <asm/thread_info.h>
16 DECLARE_PER_CPU(unsigned long [IRQ_STACK_SIZE/sizeof(long)], irq_stack);
19 * The highest address on the stack, and the first to be used. Used to
20 * find the dummy-stack frame put down by el?_irq() in entry.S, which
21 * is structured as follows:
24 * | | <- irq_stack_ptr
26 * | x19 | <- irq_stack_ptr - 0x08
28 * | x29 | <- irq_stack_ptr - 0x10
31 * where x19 holds a copy of the task stack pointer where the struct pt_regs
32 * from kernel_entry can be found.
35 #define IRQ_STACK_PTR(cpu) ((unsigned long)per_cpu(irq_stack, cpu) + IRQ_STACK_START_SP)
38 * The offset from irq_stack_ptr where entry.S will store the original
39 * stack pointer. Used by unwind_frame() and dump_backtrace().
41 #define IRQ_STACK_TO_TASK_STACK(ptr) (*((unsigned long *)((ptr) - 0x08)))
43 extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
45 static inline int nr_legacy_irqs(void)
50 static inline bool on_irq_stack(unsigned long sp, int cpu)
52 /* variable names the same as kernel/stacktrace.c */
53 unsigned long low = (unsigned long)per_cpu(irq_stack, cpu);
54 unsigned long high = low + IRQ_STACK_START_SP;
56 return (low <= sp && sp <= high);
59 #endif /* !__ASSEMBLER__ */