import of ftp.dlink.com/GPL/DSMG-600_reB/ppclinux.tar.gz
[linux-2.4.21-pre4.git] / include / asm-ppc / open_pic.h
1 /*
2  * BK Id: SCCS/s.open_pic.h 1.17 01/07/03 12:34:14 trini
3  */
4 /*
5  *  include/asm-ppc/open_pic.h -- OpenPIC Interrupt Handling
6  *
7  *  Copyright (C) 1997 Geert Uytterhoeven
8  *
9  *  This file is subject to the terms and conditions of the GNU General Public
10  *  License.  See the file COPYING in the main directory of this archive
11  *  for more details.
12  *  
13  */
14
15 #ifndef _PPC_KERNEL_OPEN_PIC_H
16 #define _PPC_KERNEL_OPEN_PIC_H
17
18 #include <linux/config.h>
19 #include <linux/irq.h>
20
21 #define OPENPIC_SIZE    0x40000
22
23 /*
24  *  Non-offset'ed vector numbers
25  */
26
27 #define OPENPIC_VEC_TIMER       64      /* and up */
28 #define OPENPIC_VEC_IPI         72      /* and up */
29 #define OPENPIC_VEC_SPURIOUS    127
30
31 /* OpenPIC IRQ controller structure */
32 extern struct hw_interrupt_type open_pic;
33
34 /* OpenPIC IPI controller structure */
35 #ifdef CONFIG_SMP
36 extern struct hw_interrupt_type open_pic_ipi;
37 #endif /* CONFIG_SMP */
38
39 extern u_int OpenPIC_NumInitSenses;
40 extern u_char *OpenPIC_InitSenses;
41 extern void* OpenPIC_Addr;
42
43 /* Exported functions */
44 extern void openpic_set_sources(int first_irq, int num_irqs, void *isr);
45 extern void openpic_init(int linux_irq_offset);
46 extern void openpic_init_nmi_irq(u_int irq);
47 extern void openpic_hookup_cascade(u_int irq, char *name,
48                                    int (*cascade_fn)(struct pt_regs *));
49 extern u_int openpic_irq(void);
50 extern void openpic_eoi(void);
51 extern void openpic_request_IPIs(void);
52 extern void do_openpic_setup_cpu(void);
53 extern int openpic_get_irq(struct pt_regs *regs);
54 extern void openpic_reset_processor_phys(u_int cpumask);
55 extern void openpic_setup_ISU(int isu_num, unsigned long addr);
56 extern void openpic_cause_IPI(u_int ipi, u_int cpumask);
57 extern void smp_openpic_message_pass(int target, int msg, unsigned long data,
58                                      int wait);
59
60 extern inline int openpic_to_irq(int irq)
61 {
62         /* IRQ 0 usually means 'disabled'.. don't mess with it 
63          * exceptions to this (sandpoint maybe?) 
64          * shouldn't use openpic_to_irq 
65          */
66         if (irq != 0){
67                 //REX:
68                 //return irq += NUM_8259_INTERRUPTS;
69                 return irq;
70         } else {
71                 return 0;
72         }
73 }
74 /*extern int open_pic_irq_offset;*/
75 #endif /* _PPC_KERNEL_OPEN_PIC_H */