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.

150 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. amdk7.h
  5. Author:
  6. Todd Carpenter (1/30/01) - create file
  7. Environment:
  8. Kernel mode
  9. Notes:
  10. Revision History:
  11. --*/
  12. #ifndef _AMDK7_H
  13. #define _AMDK7_H
  14. #define AMDK7_PARAMETERS_KEY L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\AmdK7\\Parameters"
  15. #define ENABLE_LEGACY_INTERFACE 0x1
  16. #define AMDK7_FID_VID_CONTROL_MSR 0xC0010041
  17. #define AMDK7_FID_VID_STATUS_MSR 0xC0010042
  18. #define AmdK7FidVidTransition(_x_) \
  19. WriteMSR(AMDK7_FID_VID_CONTROL_MSR, _x_);
  20. typedef struct {
  21. union {
  22. struct {
  23. ULONG Fid:5; // 4:0
  24. ULONG Reserved1:3; // 7:5
  25. ULONG Vid:5; // 12:8
  26. ULONG Reserved2:3; // 15:13
  27. ULONG FidControl:1; // 16
  28. ULONG VidControl:1; // 17
  29. ULONG Reserved3:2; // 19:18
  30. ULONG FidChngRatio:1; // 20
  31. ULONG Reserved4:11; // 31:21
  32. ULONG SGTC:20; // 51:32
  33. ULONG Reserved5:12; // 63:52
  34. };
  35. ULONG64 AsQWord;
  36. };
  37. } FID_VID_CONTROL, *PFID_VID_CONTROL;
  38. typedef struct {
  39. union {
  40. struct {
  41. ULONG CFid:5; // 4:0 - Current FID
  42. ULONG Reserved1:3; // 7:5
  43. ULONG SFid:5; // 12:8 - Startup FID
  44. ULONG Reserved2:3; // 15:13
  45. ULONG MFid:5; // 20:16 - Maximum FID
  46. ULONG Reserved3:11;// 31:21
  47. ULONG CVid:5; // 36:32 - Current VID
  48. ULONG Reserved4:3; // 39:37
  49. ULONG SVid:5; // 44:40 - Startup VID
  50. ULONG Reserved5:3; // 47:45
  51. ULONG MVid:5; // 52:48 - Maximum VID
  52. ULONG Reserved6:11;// 63:53
  53. };
  54. ULONG64 AsQWord;
  55. };
  56. } FID_VID_STATUS, *PFID_VID_STATUS;
  57. typedef struct {
  58. union {
  59. struct {
  60. ULONG Fid:5; // 4:0
  61. ULONG Vid:5; // 9:5
  62. ULONG SGTC:20; // 29:10
  63. ULONG Reserved:2; // 31:30
  64. };
  65. ULONG AsDWord;
  66. };
  67. } PSS_CONTROL, *PPSS_CONTROL;
  68. typedef struct {
  69. union {
  70. struct {
  71. ULONG Fid:5; // 4:0 - Current FID
  72. ULONG Vid:5; // 9:5 - Current VID
  73. ULONG Reserved:22; // 31:10
  74. };
  75. ULONG AsDWord;
  76. };
  77. } PSS_STATUS, *PPSS_STATUS;
  78. ULONG64
  79. ConvertPssControlToFidVidControl(
  80. ULONG PssControlValue,
  81. BOOLEAN Fid
  82. );
  83. ULONG
  84. ConvertFidVidStatusToPssStatus(
  85. ULONG64 FidVidStatus
  86. );
  87. NTSTATUS
  88. FindCurrentPssPerfState(
  89. PACPI_PSS_PACKAGE PssPackage,
  90. PULONG PssState
  91. );
  92. //
  93. // Debug Routines
  94. //
  95. #if DBG
  96. VOID
  97. DumpFidVidStatus(
  98. IN ULONG64 FidVidStatus
  99. );
  100. VOID
  101. DumpFidVidControl(
  102. IN ULONG64 FidVidControl
  103. );
  104. VOID
  105. DumpPssStatus(
  106. IN ULONG PssStatus
  107. );
  108. VOID
  109. DumpPssControl(
  110. IN ULONG PssControl
  111. );
  112. #else
  113. #define DumpFidVidStatus(_x_)
  114. #define DumpFidVidControl(_x_)
  115. #define DumpPssStatus(_x_)
  116. #define DumpPssControl(_x_)
  117. #endif
  118. #endif _AMDK7_H