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