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.

142 lines
3.6 KiB

  1. //++
  2. // TITLE ("Performance Monitor Control & Data Register Accesses")
  3. //
  4. //
  5. //
  6. // Copyright (c) 1995 Intel Corporation
  7. //
  8. // Module Name:
  9. //
  10. // i64prfls.s
  11. //
  12. // Abstract:
  13. //
  14. // This module implements Profiling.
  15. //
  16. // Author:
  17. //
  18. // Bernard Lint, M. Jayakumar 1 Sep '99
  19. //
  20. // Environment:
  21. //
  22. // Kernel mode
  23. //
  24. // Revision History:
  25. //
  26. //--
  27. #include "ksia64.h"
  28. .file "i64prfls.s"
  29. //
  30. // The following functions are defined until the compiler supports
  31. // the intrinsics __setReg() and __getReg() for the CV_IA64_PFCx,
  32. // CV_IA64_PFDx and CV_IA64_SaPMV registers.
  33. // Anyway, these functions might stay for a while, the compiler
  34. // having no consideration for micro-architecture specific
  35. // number of PMCs/PMDs.
  36. //
  37. LEAF_ENTRY(HalpFreezeProfileCounting)
  38. rsm (1 << PSR_UP) | (1 << PSR_PP)
  39. LEAF_RETURN
  40. LEAF_EXIT(HalpFreezeProfileCounting)
  41. LEAF_ENTRY(HalpUnFreezeProfileCounting)
  42. ssm (1 << PSR_UP) | (1 << PSR_PP)
  43. LEAF_RETURN
  44. LEAF_EXIT(HalpUnFreezeProfileCounting)
  45. LEAF_ENTRY(HalpReadPerfMonVectorReg)
  46. LEAF_SETUP(0,0,0,0)
  47. mov v0 = cr.pmv
  48. ;;
  49. LEAF_RETURN
  50. LEAF_EXIT(HalpReadPerfMonVectorReg)
  51. LEAF_ENTRY(HalpWritePerfMonVectorReg)
  52. LEAF_SETUP(1,0,0,0)
  53. mov cr.pmv = a0
  54. ;;
  55. LEAF_RETURN
  56. LEAF_EXIT(HalpWritePerfMonVectorReg)
  57. LEAF_ENTRY(HalpWritePerfMonCnfgReg)
  58. LEAF_SETUP(2,0,0,0)
  59. rPMC = t15
  60. mov rPMC = a0
  61. ;;
  62. mov pmc[rPMC] = a1
  63. ;;
  64. LEAF_RETURN
  65. LEAF_EXIT(HalpWritePerfMonCnfgReg)
  66. LEAF_ENTRY(HalpClearPerfMonCnfgOverflows)
  67. LEAF_SETUP(4,0,0,0)
  68. rPMC0 = t0
  69. rPMC1 = t1
  70. rPMC2 = t2
  71. rPMC3 = t3
  72. rPMC0val = t4
  73. rPMC1val = t5
  74. rPMC2val = t6
  75. rPMC3val = t7
  76. // Thierry - FIXFIX 03/4/2002:
  77. // Still need tuning to streamline SCRAB.
  78. mov rPMC3 = 3
  79. mov rPMC2 = 2
  80. ;;
  81. mov rPMC3val = pmc[rPMC3]
  82. mov rPMC2val = pmc[rPMC2]
  83. mov rPMC1 = 1
  84. mov rPMC0 = 0
  85. ;;
  86. mov rPMC1val = pmc[rPMC1]
  87. mov rPMC0val = pmc[rPMC0]
  88. and rPMC3val = rPMC3val, a3
  89. ;;
  90. mov pmc[rPMC3] = rPMC3val
  91. and rPMC2val = rPMC2val, a2
  92. ;;
  93. mov pmc[rPMC2] = rPMC2val
  94. and rPMC1val = rPMC1val, a1
  95. ;;
  96. mov pmc[rPMC1] = rPMC1val
  97. and rPMC0val = rPMC0val, a0
  98. ;;
  99. mov pmc[rPMC0] = rPMC0val
  100. LEAF_RETURN
  101. LEAF_EXIT(HalpClearPerfMonCnfgOverflows)
  102. LEAF_ENTRY(HalpReadPerfMonCnfgReg)
  103. LEAF_SETUP(1,0,0,0)
  104. rPMC = t15
  105. mov rPMC = a0
  106. ;;
  107. mov v0 = pmc[rPMC]
  108. ;;
  109. LEAF_RETURN
  110. LEAF_EXIT(HalpReadPerfMonCnfgReg)
  111. LEAF_ENTRY(HalpWritePerfMonDataReg)
  112. LEAF_SETUP(2,0,0,0)
  113. rPMD = t15
  114. mov rPMD = a0
  115. ;;
  116. mov pmd[rPMD] = a1
  117. ;;
  118. LEAF_RETURN
  119. LEAF_EXIT(HalpWritePerfMonDataReg)
  120. LEAF_ENTRY(HalpReadPerfMonDataReg)
  121. LEAF_SETUP(1,0,0,0)
  122. rPMD = t15
  123. mov rPMD = a0
  124. ;;
  125. mov v0 = pmd[rPMD]
  126. ;;
  127. LEAF_RETURN
  128. LEAF_EXIT(HalpReadPerfMonDataReg)