Commit | Line | Data |
---|---|---|
fb9bd7d6 MZ |
1 | #ifndef __ASM_IRQ_H |
2 | #define __ASM_IRQ_H | |
3 | ||
132cd887 AT |
4 | #define IRQ_STACK_SIZE THREAD_SIZE |
5 | #define IRQ_STACK_START_SP THREAD_START_SP | |
6 | ||
7 | #ifndef __ASSEMBLER__ | |
8 | ||
9 | #include <linux/percpu.h> | |
10 | ||
fb9bd7d6 | 11 | #include <asm-generic/irq.h> |
132cd887 | 12 | #include <asm/thread_info.h> |
fb9bd7d6 | 13 | |
8e23dacd JM |
14 | #define __ARCH_HAS_DO_SOFTIRQ |
15 | ||
af2c632e CZ |
16 | struct pt_regs; |
17 | ||
132cd887 AT |
18 | DECLARE_PER_CPU(unsigned long [IRQ_STACK_SIZE/sizeof(long)], irq_stack); |
19 | ||
20 | /* | |
21 | * The highest address on the stack, and the first to be used. Used to | |
22 | * find the dummy-stack frame put down by el?_irq() in entry.S. | |
23 | */ | |
24 | #define IRQ_STACK_PTR(cpu) ((unsigned long)per_cpu(irq_stack, cpu) + IRQ_STACK_START_SP) | |
25 | ||
26 | /* | |
27 | * The offset from irq_stack_ptr where entry.S will store the original | |
28 | * stack pointer. Used by unwind_frame() and dump_backtrace(). | |
29 | */ | |
30 | #define IRQ_STACK_TO_TASK_STACK(ptr) *((unsigned long *)(ptr - 0x10)); | |
31 | ||
e851b58c | 32 | extern void set_handle_irq(void (*handle_irq)(struct pt_regs *)); |
fb9bd7d6 | 33 | |
b4ff8389 BO |
34 | static inline int nr_legacy_irqs(void) |
35 | { | |
36 | return 0; | |
37 | } | |
38 | ||
132cd887 AT |
39 | static inline bool on_irq_stack(unsigned long sp, int cpu) |
40 | { | |
41 | /* variable names the same as kernel/stacktrace.c */ | |
42 | unsigned long low = (unsigned long)per_cpu(irq_stack, cpu); | |
43 | unsigned long high = low + IRQ_STACK_START_SP; | |
44 | ||
45 | return (low <= sp && sp <= high); | |
46 | } | |
47 | ||
48 | #endif /* !__ASSEMBLER__ */ | |
fb9bd7d6 | 49 | #endif |