Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.3 KiB

  1. ;/*++
  2. ;
  3. ; Copyright (c) 1996-97 Microsoft Corporation
  4. ;
  5. ; Module Name:
  6. ;
  7. ; mp8254.inc
  8. ;
  9. ; Abstract:
  10. ;
  11. ; This module contains common definitions for the 8254 used
  12. ; by the timer tick routine and the query peformance counter
  13. ; routine.
  14. ;
  15. ; Author:
  16. ;
  17. ; Shivnandan Kaushik
  18. ;
  19. if 0 ; Begin C only code */
  20. //
  21. // Constants used to initialize timer 0
  22. //
  23. #define TIMER1_DATA_PORT0 (PUCHAR)0x40 // Timer1, channel 0 data port
  24. #define TIMER1_DATA_PORT1 (PUCHAR)0x41 // Timer1, channel 1 data port
  25. #define TIMER1_DATA_PORT2 (PUCHAR)0x42 // Timer1, channel 2 data port
  26. #define TIMER1_CONTROL_PORT (PUCHAR)0x43 // Timer1 control port
  27. #define TIMER2_DATA_PORT0 (PUCHAR)0x48 // Timer2, channel 0 data port
  28. #define TIMER2_CONTROL_PORT (PUCHAR)0x4B // Timer2 control port
  29. #define TIMER_COMMAND_COUNTER0 0x00 // Select channel 0
  30. #define TIMER_COMMAND_COUNTER1 0x40 // Select channel 1
  31. #define TIMER_COMMAND_COUNTER2 0x80 // Select channel 2
  32. #define TIMER_COMMAND_RW_16BIT 0x30 // Read/Write LSB firt then MSB
  33. #define TIMER_COMMAND_MODE2 4 // Use mode 2
  34. #define TIMER_COMMAND_MODE3 6
  35. #define TIMER_COMMAND_BCD 0 // Binary count down
  36. #define TIMER_COMMAND_LATCH_READ 0 // Latch read command
  37. #define TIMER_CLOCK_IN 1193167
  38. #define PERFORMANCE_FREQUENCY 1193182 // frequency of 8254
  39. #define PERFORMANCE_INTERVAL 0x0ffff // Maximum counter value
  40. #define PERF_USE_8254 0x01
  41. #define PERF_8254_INITIALIZED 0x40
  42. /*
  43. endif
  44. ;
  45. ; Begin assembly part of the definitions
  46. ;
  47. ;
  48. ; Constants used to initialize timer 0
  49. ;
  50. TIMER1_DATA_PORT0 EQU 40H ; Timer1, channel 0 data port
  51. TIMER1_CONTROL_PORT0 EQU 43H ; Timer1, channel 0 control port
  52. COMMAND_8254_COUNTER0 EQU 00H ; Select count 0
  53. COMMAND_8254_RW_16BIT EQU 30H ; Read/Write LSB first then MSB
  54. COMMAND_8254_MODE2 EQU 4 ; Use mode 2
  55. COMMAND_8254_BCD EQU 0 ; Binary count down
  56. COMMAND_8254_LATCH_READ EQU 0 ; Latch read command
  57. PERFORMANCE_FREQUENCY EQU 1193182 ; frequency of 8254
  58. PERFORMANCE_INTERVAL EQU 0ffffH ; Maximum counter value
  59. PERF_USE_8254 EQU 01h
  60. PERF_8254_INITIALIZED EQU 40h
  61. ;*/