home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / pit.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  3.2 KB  |  86 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_PIT_H
  11. #define _SYS_PIT_H
  12.  
  13. #ident    "@(#)/usr/include/sys/pit.h.sl 1.1 4.0 12/08/90 28704 AT&T-USL"
  14.  
  15. /*
  16.  *         INTEL CORPORATION PROPRIETARY INFORMATION
  17.  *
  18.  *     This software is supplied under the terms of a license 
  19.  *    agreement or nondisclosure agreement with Intel Corpo-
  20.  *    ration and may not be copied or disclosed except in
  21.  *    accordance with the terms of that agreement.
  22.  */
  23.  
  24. #if defined (MB1) || defined (MB2)
  25. /* Definitions for 8254 Programmable Interrupt Timer ports on 386/20 */
  26. #define    PITCTR0_PORT    0xD0        /* counter 0 port */    
  27. #define    PITCTR1_PORT    0xD2        /* counter 1 port */    
  28. #define    PITCTR2_PORT    0xD4        /* counter 2 port */    
  29. #define    PITCTL_PORT    0xD6        /* PIT control port */
  30. #endif
  31.  
  32. #ifdef AT386
  33. /* Definitions for 8254 Programmable Interrupt Timer ports on AT 386 */
  34. #define    PITCTR0_PORT    0x40        /* counter 0 port */    
  35. #define    PITCTR1_PORT    0x41        /* counter 1 port */    
  36. #define    PITCTR2_PORT    0x42        /* counter 2 port */    
  37. #define    PITCTL_PORT    0x43        /* PIT control port */
  38. #define    PITAUX_PORT    0x61        /* PIT auxiliary port */
  39. #define SANITY_CTR0    0x48        /* sanity timer counter */
  40. #define SANITY_CTL    0x4B        /* sanity control word */
  41. #define SANITY_CHECK    0x461        /* bit 7 set if sanity timer went off*/
  42. #define FAILSAFE_NMI    0x80        /* to test if sanity timer went off */
  43. #define ENABLE_SANITY    0x04        /* Enables sanity clock NMI ints */
  44. #define RESET_SANITY    0x00        /* resets sanity NMI interrupt */
  45. #endif /* AT386 */
  46.  
  47. /* Definitions for 8254 commands */
  48.  
  49. /* Following are used for Timer 0 */
  50. #define PIT_C0          0x00            /* select counter 0 */
  51. #define    PIT_LOADMODE    0x30        /* load least significant byte followed
  52.                      * by most significant byte */
  53. #define PIT_NDIVMODE    0x04        /*divide by N counter */
  54. #define    PIT_SQUAREMODE    0x06        /* square-wave mode */
  55. #define    PIT_ENDSIGMODE    0x00        /* assert OUT at end-of-count mode*/
  56.  
  57. /* Used for Timer 1. Used for delay calculations in countdown mode */
  58. #define PIT_C1          0x40            /* select counter 1 */
  59. #define    PIT_READMODE    0x30        /* read or load least significant byte
  60.                      * followed by most significant byte */
  61. #define    PIT_RATEMODE    0x06        /* square-wave mode for USART */
  62.  
  63. #if defined(MB1)
  64. #define CLKNUM 12300            /* clock speed for the timer in hz 
  65.                      * divided by the constant HZ
  66.                      * ( defined in param.h )
  67.                      */
  68. #endif /* MB1 */
  69.  
  70. #if defined(MB2)
  71. #define CLKNUM 12500            /* clock speed for the timer in hz 
  72.                      * divided by the constant HZ
  73.                      * ( defined in param.h )
  74.                      */
  75. #endif /* MB2 */
  76.  
  77. #ifdef AT386
  78. #define    CLKNUM    (1193167/HZ)        /* clock speed for timer */
  79. #define SANITY_NUM    0xFFFF        /* Sanity timer goes off every .2 secs*/
  80. /* bits used in auxiliary control port for timer 2 */
  81. #define    PITAUX_GATE2    0x01        /* aux port, PIT gate 2 input */
  82. #define    PITAUX_OUT2    0x02        /* aux port, PIT clock out 2 enable */
  83. #endif /* AT386 */
  84.  
  85. #endif    /* _SYS_PIT_H */
  86.