i82378Ibc.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* i82378.h - i82378 IBC (ISA Bridge Controller) driver */
  2. /* Copyright 1984-1996 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01c,30oct96,tam  added IBC_READ_BYTE and IBC_WRITE_BYTE definitions (spr #7415).
  7. 01b,11oct96,tam  added _ASMLANGUAGE conditional.
  8. 01a,29jan96,tam  written.
  9. */
  10. #ifndef __INCi82378Ibch
  11. #define __INCi82378Ibch
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /*
  16.  * The macro IBC_BASE_ADRS, PIC_REG_ADDR_INTERVAL  & PIT_REG_ADDR_INTERVAL
  17.  * must be defined when including this header.
  18.  */
  19. /* default definitions */
  20. #define CAST
  21. #define PIC_ADRS(base,reg)   (CAST (base+(reg*PIC_REG_ADDR_INTERVAL)))
  22. /* register definitions */
  23. #define PIC_port1(base) PIC_ADRS(base,0x00) /* port 1. */
  24. #define PIC_port2(base) PIC_ADRS(base,0x01) /* port 2. */
  25. /* hardware register access macros */
  26. #ifndef IBC_BYTE_READ /* reads IBC register */
  27. #    define IBC_BYTE_READ(addr,pData) (*pData = *(UCHAR *)(addr))
  28. #endif
  29. #ifndef IBC_BYTE_WRITE /* write to IBC register */
  30. #    define IBC_BYTE_WRITE(addr,data)  *(UCHAR *)(addr) = (data); EIEIO
  31. #endif
  32. /* alias */
  33. #define PIC_IMASK(base) PIC_port2(base) /* Interrupt mask. */
  34. #define PIC_IACK(base) PIC_port1(base) /* Interrupt acknowledge. */
  35. #define PIC_ISR_MASK(base) PIC_port1(base) /* in-service register mask */
  36. #define PIC_IRR_MASK(base) PIC_port1(base)  /* interrupt request reg */
  37. #define OCW3_DEF 0x08 /* 3rd default control word */
  38. #define OCW3_PCB 0x04 /* Polling Control Bit */
  39. #define OCW3_ISR 0x03 /* Read in-service reg */
  40. #define OCW3_IRR 0x02 /* Read inter request reg */
  41. #define ISA_INTR_ACK_REG        (CPU_PCI_IACK_ADRS + 0x1ff0)
  42. #define i82378_INT1_CTRL        (IBC_BASE_ADRS + 0x0020)        /* pic1 82378 */
  43. #define i82378_INT1_MASK        (IBC_BASE_ADRS + 0x0021)
  44. #define i82378_INT1_ELC         (IBC_BASE_ADRS + 0x04d0)
  45. #define i82378_INT2_CTRL        (IBC_BASE_ADRS + 0x00a0)        /* pic2 82378 */
  46. #define i82378_INT2_MASK        (IBC_BASE_ADRS + 0x00a1)
  47. #define i82378_INT2_ELC         (IBC_BASE_ADRS + 0x04d1)
  48. #define i82378_TMR1_CNT0        (IBC_BASE_ADRS + 0x0040)        /* timer */
  49. #define i82378_TMR1_CNT1        (IBC_BASE_ADRS + 0x0041)
  50. #define i82378_TMR1_CNT2        (IBC_BASE_ADRS + 0x0042)
  51. #define i82378_TMR1_CMOD        (IBC_BASE_ADRS + 0x0043)
  52. #define i82378_RST_IRQ12        (IBC_BASE_ADRS + 0x0060)
  53. #define i82378_NMI_SCTRL        (IBC_BASE_ADRS + 0x0061)
  54. #define i82378_PCOP             (IBC_BASE_ADRS + 0x0c04)
  55. #define i82378_TMCP             (IBC_BASE_ADRS + 0x0c01)
  56. /* programmable interrupt controller (PIC) */
  57. #define PIC1_BASE_ADR           i82378_INT1_CTRL
  58. #define PIC2_BASE_ADR           i82378_INT2_CTRL
  59. /* programmable interrupt timers */
  60. #define PIT_BASE_ADR            i82378_TMR1_CNT0        /* timeraddrs */
  61. #define PIT_CLOCK               1193180
  62. /* typedefs */
  63. #ifndef _ASMLANGUAGE
  64. typedef struct intHandlerDesc /* interrupt handler desciption */
  65.     {
  66.     VOIDFUNCPTR vec; /* interrupt vector */
  67.     int arg; /* interrupt handler argument */
  68.     struct intHandlerDesc * next; /* next interrupt handler & argument */
  69.     } INT_HANDLER_DESC;
  70. #endif /* _ASMLANGUAGE */
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif /* __INCi82378Ibch */