open_pic.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. #ifndef _PPC_KERNEL_OPEN_PIC_H
  12. #define _PPC_KERNEL_OPEN_PIC_H
  13. #include <linux/irq.h>
  14. #define OPENPIC_SIZE 0x40000
  15. /*
  16. * Non-offset'ed vector numbers
  17. */
  18. #define OPENPIC_VEC_TIMER 110 /* and up */
  19. #define OPENPIC_VEC_IPI 118 /* and up */
  20. #define OPENPIC_VEC_SPURIOUS 255
  21. /* Priorities */
  22. #define OPENPIC_PRIORITY_IPI_BASE 10
  23. #define OPENPIC_PRIORITY_DEFAULT 4
  24. #define OPENPIC_PRIORITY_NMI 9
  25. /* OpenPIC IRQ controller structure */
  26. extern struct hw_interrupt_type open_pic;
  27. /* OpenPIC IPI controller structure */
  28. #ifdef CONFIG_SMP
  29. extern struct hw_interrupt_type open_pic_ipi;
  30. #endif /* CONFIG_SMP */
  31. extern u_int OpenPIC_NumInitSenses;
  32. extern u_char *OpenPIC_InitSenses;
  33. extern void __iomem * OpenPIC_Addr;
  34. extern int epic_serial_mode;
  35. /* Exported functions */
  36. extern void openpic_set_sources(int first_irq, int num_irqs, void __iomem *isr);
  37. extern void openpic_init(int linux_irq_offset);
  38. extern void openpic_init_nmi_irq(u_int irq);
  39. extern void openpic_set_irq_priority(u_int irq, u_int pri);
  40. extern void openpic_hookup_cascade(u_int irq, char *name,
  41. int (*cascade_fn)(struct pt_regs *));
  42. extern u_int openpic_irq(void);
  43. extern void openpic_eoi(void);
  44. extern void openpic_request_IPIs(void);
  45. extern void do_openpic_setup_cpu(void);
  46. extern int openpic_get_irq(struct pt_regs *regs);
  47. extern void openpic_reset_processor_phys(u_int cpumask);
  48. extern void openpic_setup_ISU(int isu_num, unsigned long addr);
  49. extern void openpic_cause_IPI(u_int ipi, cpumask_t cpumask);
  50. extern void smp_openpic_message_pass(int target, int msg);
  51. extern void openpic_set_k2_cascade(int irq);
  52. extern void openpic_set_priority(u_int pri);
  53. extern u_int openpic_get_priority(void);
  54. extern inline int openpic_to_irq(int irq)
  55. {
  56. /* IRQ 0 usually means 'disabled'.. don't mess with it
  57. * exceptions to this (sandpoint maybe?)
  58. * shouldn't use openpic_to_irq
  59. */
  60. if (irq != 0){
  61. return irq += NUM_8259_INTERRUPTS;
  62. } else {
  63. return 0;
  64. }
  65. }
  66. /* Support for second openpic on G5 macs */
  67. // FIXME: To be replaced by sane cascaded controller management */
  68. #define PMAC_OPENPIC2_OFFSET 128
  69. #define OPENPIC2_VEC_TIMER 110 /* and up */
  70. #define OPENPIC2_VEC_IPI 118 /* and up */
  71. #define OPENPIC2_VEC_SPURIOUS 127
  72. extern void* OpenPIC2_Addr;
  73. /* Exported functions */
  74. extern void openpic2_set_sources(int first_irq, int num_irqs, void *isr);
  75. extern void openpic2_init(int linux_irq_offset);
  76. extern void openpic2_init_nmi_irq(u_int irq);
  77. extern u_int openpic2_irq(void);
  78. extern void openpic2_eoi(void);
  79. extern int openpic2_get_irq(struct pt_regs *regs);
  80. extern void openpic2_setup_ISU(int isu_num, unsigned long addr);
  81. #endif /* _PPC_KERNEL_OPEN_PIC_H */