io.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. enum {
  10. VectorNMI = 2, /* non-maskable interrupt */
  11. VectorBPT = 3, /* breakpoint */
  12. VectorUD = 6, /* invalid opcode exception */
  13. VectorCNA = 7, /* coprocessor not available */
  14. Vector2F = 8, /* double fault */
  15. VectorCSO = 9, /* coprocessor segment overrun */
  16. VectorPF = 14, /* page fault */
  17. Vector15 = 15, /* reserved */
  18. VectorCERR = 16, /* coprocessor error */
  19. VectorPIC = 32, /* external i8259 interrupts */
  20. IrqCLOCK = 0,
  21. IrqKBD = 1,
  22. IrqUART1 = 3,
  23. IrqUART0 = 4,
  24. IrqPCMCIA = 5,
  25. IrqFLOPPY = 6,
  26. IrqLPT = 7,
  27. IrqIRQ7 = 7,
  28. IrqAUX = 12, /* PS/2 port */
  29. IrqIRQ13 = 13, /* coprocessor on 386 */
  30. IrqATA0 = 14,
  31. IrqATA1 = 15,
  32. MaxIrqPIC = 15,
  33. VectorLAPIC = VectorPIC+16, /* local APIC interrupts */
  34. IrqLINT0 = VectorLAPIC+0,
  35. IrqLINT1 = VectorLAPIC+1,
  36. IrqTIMER = VectorLAPIC+2,
  37. IrqERROR = VectorLAPIC+3,
  38. IrqPCINT = VectorLAPIC+4,
  39. IrqSPURIOUS = VectorLAPIC+15,
  40. MaxIrqLAPIC = VectorLAPIC+15,
  41. VectorSYSCALL = 64,
  42. VectorAPIC = 65, /* external APIC interrupts */
  43. MaxVectorAPIC = 255,
  44. };
  45. typedef struct Vkey {
  46. int tbdf; /* pci: ioapic or msi sources */
  47. int irq; /* 8259-emulating sources */
  48. } Vkey;
  49. typedef struct Vctl {
  50. Vctl* next; /* handlers on this vector */
  51. int isintr; /* interrupt or fault/trap */
  52. Vkey Vkey; /* source-specific key; tbdf for pci */
  53. void (*f)(Ureg*, void*); /* handler to call */
  54. void* a; /* argument to call it with */
  55. char name[KNAMELEN]; /* of driver */
  56. char *type;
  57. int (*isr)(int); /* get isr bit for this irq */
  58. int (*eoi)(int); /* eoi */
  59. int (*mask)(Vkey*, int); /* interrupt enable returns masked vector */
  60. int vno;
  61. } Vctl;
  62. typedef struct ACVctl {
  63. char* (*f)(Ureg*,void*);
  64. void* a;
  65. int vno;
  66. char name[KNAMELEN]; /* of driver */
  67. } ACVctl;
  68. enum {
  69. BusCBUS = 0, /* Corollary CBUS */
  70. BusCBUSII, /* Corollary CBUS II */
  71. BusEISA, /* Extended ISA */
  72. BusFUTURE, /* IEEE Futurebus */
  73. BusINTERN, /* Internal bus */
  74. BusISA, /* Industry Standard Architecture */
  75. BusMBI, /* Multibus I */
  76. BusMBII, /* Multibus II */
  77. BusMCA, /* Micro Channel Architecture */
  78. BusMPI, /* MPI */
  79. BusMPSA, /* MPSA */
  80. BusNUBUS, /* Apple Macintosh NuBus */
  81. BusPCI, /* Peripheral Component Interconnect */
  82. BusPCMCIA, /* PC Memory Card International Association */
  83. BusTC, /* DEC TurboChannel */
  84. BusVL, /* VESA Local bus */
  85. BusVME, /* VMEbus */
  86. BusXPRESS, /* Express System Bus */
  87. };