Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
0007  * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle
0008  */
0009 #ifndef _ASM_IRQ_H
0010 #define _ASM_IRQ_H
0011 
0012 #include <linux/linkage.h>
0013 #include <linux/smp.h>
0014 
0015 #include <asm/mipsmtregs.h>
0016 
0017 #include <irq.h>
0018 
0019 #define IRQ_STACK_SIZE          THREAD_SIZE
0020 #define IRQ_STACK_START         (IRQ_STACK_SIZE - 16)
0021 
0022 extern void __init init_IRQ(void);
0023 extern void *irq_stack[NR_CPUS];
0024 
0025 /*
0026  * The highest address on the IRQ stack contains a dummy frame put down in
0027  * genex.S (handle_int & except_vec_vi_handler) which is structured as follows:
0028  *
0029  *   top ------------
0030  *       | task sp  | <- irq_stack[cpu] + IRQ_STACK_START
0031  *       ------------
0032  *       |          | <- First frame of IRQ context
0033  *       ------------
0034  *
0035  * task sp holds a copy of the task stack pointer where the struct pt_regs
0036  * from exception entry can be found.
0037  */
0038 
0039 static inline bool on_irq_stack(int cpu, unsigned long sp)
0040 {
0041     unsigned long low = (unsigned long)irq_stack[cpu];
0042     unsigned long high = low + IRQ_STACK_SIZE;
0043 
0044     return (low <= sp && sp <= high);
0045 }
0046 
0047 #ifdef CONFIG_I8259
0048 static inline int irq_canonicalize(int irq)
0049 {
0050     return ((irq == I8259A_IRQ_BASE + 2) ? I8259A_IRQ_BASE + 9 : irq);
0051 }
0052 #else
0053 #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
0054 #endif
0055 
0056 asmlinkage void plat_irq_dispatch(void);
0057 
0058 extern void do_IRQ(unsigned int irq);
0059 
0060 struct irq_domain;
0061 extern void do_domain_IRQ(struct irq_domain *domain, unsigned int irq);
0062 
0063 extern void arch_init_irq(void);
0064 extern void spurious_interrupt(void);
0065 
0066 extern int allocate_irqno(void);
0067 extern void alloc_legacy_irqno(void);
0068 extern void free_irqno(unsigned int irq);
0069 
0070 /*
0071  * Before R2 the timer and performance counter interrupts were both fixed to
0072  * IE7.  Since R2 their number has to be read from the c0_intctl register.
0073  */
0074 #define CP0_LEGACY_COMPARE_IRQ 7
0075 #define CP0_LEGACY_PERFCNT_IRQ 7
0076 
0077 extern int cp0_compare_irq;
0078 extern int cp0_compare_irq_shift;
0079 extern int cp0_perfcount_irq;
0080 extern int cp0_fdc_irq;
0081 
0082 extern int get_c0_fdc_int(void);
0083 
0084 void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
0085                     bool exclude_self);
0086 #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
0087 
0088 #endif /* _ASM_IRQ_H */