Windows NT 4.0 source code leak
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
1.9 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1992 Digital Equipment Corporation
  3. Module Name:
  4. jxprof.h
  5. Abstract:
  6. This header file defines profile counter hardware in the
  7. 82357 PIC chip used on the Alpha/Jensen Platform.
  8. Author:
  9. Jeff McLeman (mcleman) 5-June-1992
  10. Revision History:
  11. --*/
  12. #ifndef _JXPROF_
  13. #define _JXPROF_
  14. //
  15. // Define the timer values for the Profiler
  16. //
  17. #define PIC_BINARY 0
  18. #define PIC_BCD 1
  19. #define PIC_MODE0 0x00 // xxxx000x
  20. #define PIC_MODE1 0x02 // xxxx001x
  21. #define PIC_MODE2 0x04 // xxxx010x
  22. #define PIC_MODE3 0x06 // xxxx011x
  23. #define PIC_MODE4 0x08 // xxxx100x
  24. #define PIC_MODE5 0x0A // xxxx101x
  25. #define PIC_CLC 0x00 // xx00xxxx
  26. #define PIC_RWLSBO 0x10 // xx01xxxx
  27. #define PIC_RWMSBO 0x20 // xx10xxxx
  28. #define PIC_RWLSBMSB 0x30 // xx11xxxx
  29. #define PIC_SC0 0x00 // 00xxxxxx
  30. #define PIC_SC1 0x40 // 01xxxxxx
  31. #define PIC_SC2 0x80 // 10xxxxxx
  32. #define PIC_RBC 0xC0 // 11xxxxxx
  33. #define PIC_SCALE_FACTOR 10 * 1000 // # of microsecond units times 10.
  34. //
  35. // Define a macro to set and enable the system profiler timer.
  36. // Note that the interval 'c' is in 100nS units.
  37. // Note that also the interval is incremented AFTER it is scaled.
  38. // This is due to the fact that the timer counts down to 1 in mode 2
  39. //
  40. #define PIC_PROFILER_ON(c)\
  41. WRITE_PORT_UCHAR(&((PEISA_CONTROL) HalpEisaControlBase)->CommandMode1,\
  42. (ULONG)(PIC_BINARY | PIC_MODE2 | PIC_RWLSBMSB | PIC_SC0));\
  43. WRITE_PORT_UCHAR(&((PEISA_CONTROL) HalpEisaControlBase)->Timer1,\
  44. (ULONG)((c) & 0xff) );\
  45. WRITE_PORT_UCHAR(&((PEISA_CONTROL) HalpEisaControlBase)->Timer1,\
  46. (ULONG)(((c)>> 8) & 0xff) )
  47. //
  48. // Define a macro to shut down the profiler
  49. //
  50. #define PIC_PROFILER_OFF()\
  51. WRITE_PORT_UCHAR(&((PEISA_CONTROL) HalpEisaControlBase)->CommandMode1,\
  52. (ULONG)(PIC_BINARY | PIC_MODE4 | PIC_RWLSBMSB | PIC_SC0))
  53. #endif // _JXPROF_