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.

124 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. mtrr.h
  5. Abstract:
  6. This module contains the i386 specific mtrr register
  7. hardware definitions.
  8. Author:
  9. Ken Reneris (kenr) 11-Oct-95
  10. Environment:
  11. Kernel mode only.
  12. Revision History:
  13. --*/
  14. //
  15. // MTRR MSR architecture definitions
  16. //
  17. #define MTRR_MSR_CAPABILITIES 0x0fe
  18. #define MTRR_MSR_DEFAULT 0x2ff
  19. #define MTRR_MSR_VARIABLE_BASE 0x200
  20. #define MTRR_MSR_VARIABLE_MASK (MTRR_MSR_VARIABLE_BASE+1)
  21. #define MTRR_PAGE_SIZE 4096
  22. #define MTRR_PAGE_MASK (~(MTRR_PAGE_SIZE-1))
  23. //
  24. // Memory range types
  25. //
  26. #define MTRR_TYPE_UC 0
  27. #define MTRR_TYPE_USWC 1
  28. #define MTRR_TYPE_WT 4
  29. #define MTRR_TYPE_WP 5
  30. #define MTRR_TYPE_WB 6
  31. #define MTRR_TYPE_MAX 7
  32. //
  33. // MTRR specific registers - capability register, default
  34. // register, and variable mask and base register
  35. //
  36. #include "pshpack1.h"
  37. typedef struct _MTRR_CAPABILITIES {
  38. union {
  39. struct {
  40. ULONG VarCnt:8;
  41. ULONG FixSupported:1;
  42. ULONG Reserved_0:1;
  43. ULONG UswcSupported:1;
  44. ULONG Reserved_1:21;
  45. ULONG Reserved_2;
  46. } hw;
  47. ULONGLONG QuadPart;
  48. } u;
  49. } MTRR_CAPABILITIES, *PMTRR_CAPABILITIES;
  50. typedef struct _MTRR_DEFAULT {
  51. union {
  52. struct {
  53. ULONG Type:8;
  54. ULONG Reserved_0:2;
  55. ULONG FixedEnabled:1;
  56. ULONG MtrrEnabled:1;
  57. ULONG Reserved_1:20;
  58. ULONG Reserved_2;
  59. } hw;
  60. ULONGLONG QuadPart;
  61. } u;
  62. } MTRR_DEFAULT, *PMTRR_DEFAULT;
  63. typedef struct _MTRR_VARIABLE_BASE {
  64. union {
  65. struct {
  66. ULONG Type:8;
  67. ULONG Reserved_0:4;
  68. ULONG PhysBase_1:20;
  69. ULONG PhysBase_2:4;
  70. ULONG PhysBase_3:4;
  71. ULONG Reserved_1:24;
  72. } hw;
  73. ULONGLONG QuadPart;
  74. } u;
  75. } MTRR_VARIABLE_BASE, *PMTRR_VARIABLE_BASE;
  76. typedef struct _MTRR_VARIABLE_MASK {
  77. union {
  78. struct {
  79. ULONG Reserved_0:11;
  80. ULONG Valid:1;
  81. ULONG PhysMask_1:20;
  82. ULONG PhysMask_2:4;
  83. ULONG PhysMask_3:4;
  84. ULONG Reserved_1:24;
  85. } hw;
  86. ULONGLONG QuadPart;
  87. } u;
  88. } MTRR_VARIABLE_MASK, *PMTRR_VARIABLE_MASK;
  89. #include "poppack.h"
  90. typedef struct _PROCESSOR_LOCKSTEP {
  91. ULONG Processor;
  92. volatile ULONG TargetCount;
  93. volatile ULONG *TargetPhase;
  94. } PROCESSOR_LOCKSTEP, *PPROCESSOR_LOCKSTEP;
  95. VOID
  96. KiLockStepExecution(
  97. IN PPROCESSOR_LOCKSTEP Context
  98. );