Source code of Windows XP (NT5)
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.

190 lines
5.8 KiB

  1. #ifndef IA64PROF_H_INCLUDED
  2. #define IA64PROF_H_INCLUDED
  3. /*++
  4. Copyright (c) 1989-2000 Microsoft Corporation
  5. Component Name:
  6. IA64 Profiling
  7. Module Name:
  8. ia64prof.h
  9. Abstract:
  10. This header file presents the IA64 specific profiling definitions
  11. Author:
  12. David N. Cutler (davec) 5-Mar-1989
  13. Environment:
  14. ToBeSpecified
  15. Revision History:
  16. 3/15/2000 Thierry Fevrier (v-thief@microsoft.com):
  17. Initial version
  18. --*/
  19. //
  20. // Warning: The definition of HALPROFILE_PCR should match the HalReserved[] type definition
  21. // and the PROCESSOR_PROFILING_INDEX based indexes.
  22. //
  23. //
  24. // IA64 Generic - Number of PMCs / PMDs pairs.
  25. //
  26. #define PROCESSOR_IA64_PERFCOUNTERS_PAIRS 4
  27. typedef struct _HALPROFILE_PCR {
  28. ULONGLONG ProfilingRunning;
  29. ULONGLONG ProfilingInterruptHandler;
  30. ULONGLONG ProfilingInterrupts; // XXTF - DEBUG
  31. ULONGLONG ProfilingInterruptsWithoutProfiling; // XXTF - DEBUG
  32. ULONGLONG ProfileSource [ PROCESSOR_IA64_PERFCOUNTERS_PAIRS ];
  33. ULONGLONG PerfCnfg [ PROCESSOR_IA64_PERFCOUNTERS_PAIRS ];
  34. ULONGLONG PerfData [ PROCESSOR_IA64_PERFCOUNTERS_PAIRS ];
  35. ULONGLONG PerfCnfgReload[ PROCESSOR_IA64_PERFCOUNTERS_PAIRS ];
  36. ULONGLONG PerfDataReload[ PROCESSOR_IA64_PERFCOUNTERS_PAIRS ];
  37. } HALPROFILE_PCR, *PHALPROFILE_PCR;
  38. #define HALPROFILE_PCR ( (PHALPROFILE_PCR)(&(PCR->HalReserved[PROCESSOR_PROFILING_INDEX])) )
  39. //
  40. // Define space in the HAL-reserved part of the PCR structure for each
  41. // performance counter's interval count
  42. //
  43. // Note that i64prfs.s depends on these positions in the PCR.
  44. //
  45. //
  46. // Per-Processor Profiling Status
  47. //
  48. #define HalpProfilingRunning HALPROFILE_PCR->ProfilingRunning
  49. //
  50. // Per-Processor registered Profiling Interrupt Handler
  51. //
  52. #define HalpProfilingInterruptHandler HALPROFILE_PCR->ProfilingInterruptHandler
  53. //
  54. // Per-Processor Profiling Interrupts Status
  55. //
  56. #define HalpProfilingInterrupts HALPROFILE_PCR->ProfilingInterrupts
  57. #define HalpProfilingInterruptsWithoutProfiling HALPROFILE_PCR->ProfilingInterruptsWithoutProfiling
  58. //
  59. // Define the currently selected profile source for each counter
  60. //
  61. // FIXFIX - Merced Specific.
  62. #define HalpProfileSource4 (KPROFILE_SOURCE)HALPROFILE_PCR->ProfileSource[0] // PMC4
  63. #define HalpProfileSource5 (KPROFILE_SOURCE)HALPROFILE_PCR->ProfileSource[1] // PMC5
  64. #define HalpProfileSource6 (KPROFILE_SOURCE)HALPROFILE_PCR->ProfileSource[2] // PMC6
  65. #define HalpProfileSource7 (KPROFILE_SOURCE)HALPROFILE_PCR->ProfileSource[3] // PMC7
  66. #define PCRProfileCnfg4 ( (PULONGLONG) (&(HALPROFILE_PCR->PerfCnfg[0])) )
  67. #define PCRProfileCnfg5 ( (PULONGLONG) (&(HALPROFILE_PCR->PerfCnfg[1])) )
  68. #define PCRProfileCnfg6 ( (PULONGLONG) (&(HALPROFILE_PCR->PerfCnfg[2])) )
  69. #define PCRProfileCnfg7 ( (PULONGLONG) (&(HALPROFILE_PCR->PerfCnfg[3])) )
  70. #define PCRProfileData4 ( (PULONGLONG) (&(HALPROFILE_PCR->PerfData[0])) )
  71. #define PCRProfileData5 ( (PULONGLONG) (&(HALPROFILE_PCR->PerfData[1])) )
  72. #define PCRProfileData6 ( (PULONGLONG) (&(HALPROFILE_PCR->PerfData[2])) )
  73. #define PCRProfileData7 ( (PULONGLONG) (&(HALPROFILE_PCR->PerfData[3])) )
  74. #define PCRProfileCnfg4Reload ( (PULONGLONG) (&(HALPROFILE_PCR->PerfCnfgReload[0])) )
  75. #define PCRProfileCnfg5Reload ( (PULONGLONG) (&(HALPROFILE_PCR->PerfCnfgReload[1])) )
  76. #define PCRProfileCnfg6Reload ( (PULONGLONG) (&(HALPROFILE_PCR->PerfCnfgReload[2])) )
  77. #define PCRProfileCnfg7Reload ( (PULONGLONG) (&(HALPROFILE_PCR->PerfCnfgReload[3])) )
  78. #define PCRProfileData4Reload ( (PULONGLONG) (&(HALPROFILE_PCR->PerfCnfgReload[0])) )
  79. #define PCRProfileData5Reload ( (PULONGLONG) (&(HALPROFILE_PCR->PerfDataReload[1])) )
  80. #define PCRProfileData6Reload ( (PULONGLONG) (&(HALPROFILE_PCR->PerfDataReload[2])) )
  81. #define PCRProfileData7Reload ( (PULONGLONG) (&(HALPROFILE_PCR->PerfDataReload[3])) )
  82. //
  83. // IA64 Monitored Events have
  84. //
  85. // FIXFIX - Merced Specific.
  86. typedef enum _PMCD_SOURCE_MASK {
  87. PMCD_MASK_4 = 0x1,
  88. PMCD_MASK_5 = 0x2,
  89. PMCD_MASK_6 = 0x4,
  90. PMCD_MASK_7 = 0x8,
  91. PMCD_MASK_45 = (PMCD_MASK_4 | PMCD_MASK_5),
  92. PMCD_MASK_4567 = (PMCD_MASK_4 | PMCD_MASK_5 | PMCD_MASK_6 | PMCD_MASK_7)
  93. } PMCD_SOURCE_MASK;
  94. //
  95. // Define the mapping between possible profile sources and the
  96. // CPU-specific settings for the IA64 specific Event Counters.
  97. //
  98. typedef struct _HALP_PROFILE_MAPPING {
  99. BOOLEAN Supported;
  100. ULONG Event;
  101. ULONG ProfileSource;
  102. ULONG ProfileSourceMask;
  103. ULONGLONG Interval;
  104. ULONGLONG DefInterval; // Default or Desired Interval
  105. ULONGLONG MaxInterval; // Maximum Interval
  106. ULONGLONG MinInterval; // Maximum Interval
  107. } HALP_PROFILE_MAPPING, *PHALP_PROFILE_MAPPING;
  108. /////////////
  109. //
  110. // XXTF - ToBeDone - 02/08/2000.
  111. // The following section should provide the IA64 PMC APIs.
  112. // These should be considered as inline versions of the Halp*ProfileCounter*()
  113. // functions. This will allow user application to use standardized APIs to
  114. // program the performance monitor counters.
  115. //
  116. // HalpSetProfileCounterConfiguration()
  117. // HalpSetProfileCounterPrivilegeLevelMask()
  118. typedef enum _PMC_PLM_MASK {
  119. PMC_PLM_NONE = 0x0,
  120. PMC_PLM_0 = 0x1,
  121. PMC_PLM_1 = 0x2,
  122. PMC_PLM_2 = 0x4,
  123. PMC_PLM_3 = 0x8,
  124. PMC_PLM_ALL = (PMC_PLM_3|PMC_PLM_2|PMC_PLM_1|PMC_PLM_0)
  125. } PMC_PLM_MASK;
  126. // HalpSetProfileCounterConfiguration()
  127. typedef enum _PMC_NAMESPACE {
  128. PMC_DISABLE_OVERFLOW_INTERRUPT = 0x0,
  129. PMC_ENABLE_OVERFLOW_INTERRUPT = 0x1,
  130. PMC_DISABLE_PRIVILEGE_MONITOR = 0x0,
  131. PMC_ENABLE_PRIVILEGE_MONITOR = 0x1
  132. } PMC_NAMESPACE;
  133. // HalpSetProfileCounterConfiguration()
  134. // HalpSetProfileCounterInstructionSetMask()
  135. typedef enum _PMC_INSTRUCTION_SET_MASK {
  136. PMC_ISM_ALL = 0x0,
  137. PMC_ISM_IA64 = 0x1,
  138. PMC_ISM_IA32 = 0x2,
  139. PMC_ISM_NONE = 0x3
  140. } PMC_INSTRUCTION_SET_MASK;
  141. //
  142. ////////////
  143. #endif /* IA64PROF_H_INCLUDED */