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.

141 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. legacy.h
  5. Author:
  6. Todd Carpenter (4/16/01) - create file
  7. Environment:
  8. Kernel mode
  9. Notes:
  10. Revision History:
  11. --*/
  12. #ifndef _AMDK7_LEGACY_H
  13. #define _AMDK7_LEGACY_H
  14. #include <pshpack1.h>
  15. #define PST_BLOCK_SIGNATURE 0x4b444d41 // "AMDK"
  16. #define PST_BLOCK_SIGNATURE_STRING "AMDK7PNOW!" // 41 4d 44 4b 37 50 4e 4f 57 21
  17. #define PST_BLOCK_SIGNATURE_STRING_LEN 10
  18. #define PST_SEARCH_RANGE_BEGIN 0xC0000
  19. #define PST_SEARCH_RANGE_END 0xFFFF0
  20. #define PST_SEARCH_RANGE_LENGTH (PST_SEARCH_RANGE_END-PST_SEARCH_RANGE_BEGIN+1)
  21. #define PST_SEARCH_INTERVAL 16 // search on 16 byte boundaries
  22. #pragma pack (push, 1)
  23. typedef struct _PST_SIGNATURE {
  24. ULONG CpuId;
  25. UCHAR FSBSpeed;
  26. UCHAR MaxFid;
  27. UCHAR StartVid;
  28. } PST_SIGNATURE, *PPST_SIGNATURE;
  29. typedef struct _PST_DATA {
  30. UCHAR Fid;
  31. UCHAR Vid;
  32. } PST_DATA, *PPST_DATA;
  33. typedef struct _PST_ENTRY {
  34. ULONG CpuId;
  35. UCHAR FSBSpeed;
  36. UCHAR MaxFid;
  37. UCHAR StartVid;
  38. UCHAR NumPStates; // total number of vid-fid pairs (must be >= 1)
  39. PST_DATA States[1];
  40. } PST_ENTRY, *PPST_ENTRY, **PPPST_ENTRY;
  41. typedef struct _PST_BLOCK_HEADER {
  42. UCHAR Signature[10]; // "AMDK7PNOW!"
  43. UCHAR TableVersion;
  44. UCHAR Flags;
  45. USHORT SettlingTime;
  46. UCHAR Reserved1;
  47. UCHAR NumPST;
  48. PST_ENTRY PstState;
  49. } PST_BLOCK_HEADER, *PPST_BLOCK_HEADER, **PPPST_BLOCK_HEADER;
  50. #pragma pack (pop)
  51. //
  52. // Functions
  53. //
  54. NTSTATUS
  55. FindPSTBlock (
  56. OUT PPPST_BLOCK_HEADER PstBlock
  57. );
  58. NTSTATUS
  59. FindMatchingPSTEntry(
  60. IN PPST_BLOCK_HEADER PstBlock,
  61. IN PPST_SIGNATURE Signature,
  62. OUT PPPST_ENTRY PstStates
  63. );
  64. NTSTATUS
  65. CreateSystemSignature(
  66. PPST_SIGNATURE Signature
  67. );
  68. UCHAR
  69. GetFSBSpeed(
  70. VOID
  71. );
  72. NTSTATUS
  73. ConvertPstToPss (
  74. IN PFDO_DATA DevExt,
  75. IN PPST_ENTRY PstEntry,
  76. OUT PACPI_PSS_PACKAGE *PssPackage
  77. );
  78. ULONG
  79. GetPSTSize(
  80. IN PPST_BLOCK_HEADER PstBlock
  81. );
  82. #if DBG
  83. VOID
  84. DumpPSTBlock(
  85. PPST_BLOCK_HEADER PstBlock
  86. );
  87. VOID
  88. DumpPSTEntry(
  89. PPST_ENTRY PstEntry
  90. );
  91. VOID
  92. DumpPSTSignature(
  93. PPST_SIGNATURE PstSig
  94. );
  95. #else
  96. #define DumpPSTBlock(_x_)
  97. #define DumpPSTEntry(_x_)
  98. #define DumpPSTSignature(_x_)
  99. #endif
  100. #endif