MIPS: Introduce irq_stack
[firefly-linux-kernel-4.4.55.git] / arch / mips / include / asm / irq.h
index 15e0fecbc300fd9752023931984fe277a73da876..ebb9efb025029d6f5184f45f765688912a1ece48 100644 (file)
 
 #include <irq.h>
 
+#define IRQ_STACK_SIZE                 THREAD_SIZE
+
+extern void *irq_stack[NR_CPUS];
+
+static inline bool on_irq_stack(int cpu, unsigned long sp)
+{
+       unsigned long low = (unsigned long)irq_stack[cpu];
+       unsigned long high = low + IRQ_STACK_SIZE;
+
+       return (low <= sp && sp <= high);
+}
+
 #ifdef CONFIG_I8259
 static inline int irq_canonicalize(int irq)
 {