open_pic.h 2.8 KB

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