open_pic.h 2.9 KB

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