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.

105 lines
2.1 KiB

  1. /**
  2. *** Copyright (C) 1996-97 Intel Corporation. All rights reserved.
  3. ***
  4. *** The information and source code contained herein is the exclusive
  5. *** property of Intel Corporation and may not be disclosed, examined
  6. *** or reproduced in whole or in part without explicit written authorization
  7. *** from the company.
  8. **/
  9. /*++
  10. Copyright (c) 1995 Intel Corporation
  11. Module Name:
  12. simperfc.c
  13. Abstract:
  14. This module implements the routines to support performance counters.
  15. Author:
  16. 14-Apr-1995
  17. Environment:
  18. Kernel mode
  19. Revision History:
  20. --*/
  21. #include "halp.h"
  22. LARGE_INTEGER
  23. KeQueryPerformanceCounter (
  24. OUT PLARGE_INTEGER PerformanceFrequency OPTIONAL
  25. )
  26. /*++
  27. Routine Description:
  28. This routine returns current 64-bit performance counter and,
  29. optionally, the Performance Frequency.
  30. In the simulation environment, this support is not needed.
  31. However, the performance monitor of the architecture may be
  32. used to implement this feature.
  33. Arguments:
  34. PerformanceFrequency - optionally, supplies the address
  35. of a variable to receive the performance counter frequency.
  36. Return Value:
  37. Current value of the performance counter will be returned.
  38. --*/
  39. {
  40. LARGE_INTEGER Result;
  41. Result.QuadPart = __getReg(CV_IA64_ApITC);
  42. if (ARGUMENT_PRESENT(PerformanceFrequency)) {
  43. PerformanceFrequency->QuadPart = 10000000; // 100ns/10MHz clock
  44. }
  45. return Result;
  46. }
  47. VOID
  48. HalCalibratePerformanceCounter (
  49. IN volatile PLONG Number,
  50. IN ULONGLONG NewCount
  51. )
  52. /*++
  53. Routine Description:
  54. This routine resets the performance counter value for the current
  55. processor to zero. The reset is done such that the resulting value
  56. is closely synchronized with other processors in the configuration.
  57. In the simulation environment, the performance counter feature is
  58. not supported. This routine does nothing.
  59. Arguments:
  60. Number - Supplies a pointer to count of the number of processors in
  61. the configuration.
  62. Return Value:
  63. None.
  64. --*/
  65. {
  66. *Number = 0;
  67. return;
  68. }