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.

145 lines
3.5 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. dataamd.c
  5. Abstract:
  6. This module contains the private hardware specific global storage for
  7. the memory management subsystem.
  8. Author:
  9. Landy Wang (landyw) 08-Apr-2000
  10. Revision History:
  11. --*/
  12. #include "mi.h"
  13. //
  14. // A zero Pte.
  15. //
  16. const MMPTE ZeroPte = { 0 };
  17. //
  18. // A kernel zero PTE.
  19. //
  20. const MMPTE ZeroKernelPte = {0x0};
  21. MMPTE ValidKernelPte = { MM_PTE_VALID_MASK |
  22. MM_PTE_WRITE_MASK |
  23. MM_PTE_GLOBAL_MASK |
  24. MM_PTE_DIRTY_MASK |
  25. MM_PTE_ACCESS_MASK };
  26. const MMPTE ValidKernelPteLocal = { MM_PTE_VALID_MASK |
  27. MM_PTE_WRITE_MASK |
  28. MM_PTE_DIRTY_MASK |
  29. MM_PTE_ACCESS_MASK };
  30. const MMPTE ValidUserPte = { MM_PTE_VALID_MASK |
  31. MM_PTE_WRITE_MASK |
  32. MM_PTE_OWNER_MASK |
  33. MM_PTE_DIRTY_MASK |
  34. MM_PTE_ACCESS_MASK };
  35. const MMPTE ValidPtePte = { MM_PTE_VALID_MASK |
  36. MM_PTE_WRITE_MASK |
  37. MM_PTE_DIRTY_MASK |
  38. MM_PTE_ACCESS_MASK };
  39. const MMPTE ValidPdePde = { MM_PTE_VALID_MASK |
  40. MM_PTE_WRITE_MASK |
  41. MM_PTE_DIRTY_MASK |
  42. MM_PTE_ACCESS_MASK };
  43. MMPTE ValidKernelPde = { MM_PTE_VALID_MASK |
  44. MM_PTE_WRITE_MASK |
  45. MM_PTE_GLOBAL_MASK |
  46. MM_PTE_DIRTY_MASK |
  47. MM_PTE_ACCESS_MASK };
  48. const MMPTE ValidKernelPdeLocal = { MM_PTE_VALID_MASK |
  49. MM_PTE_WRITE_MASK |
  50. MM_PTE_DIRTY_MASK |
  51. MM_PTE_ACCESS_MASK };
  52. MMPTE DemandZeroPde = { MM_READWRITE << MM_PROTECT_FIELD_SHIFT };
  53. const MMPTE DemandZeroPte = { MM_READWRITE << MM_PROTECT_FIELD_SHIFT };
  54. const MMPTE TransitionPde = { MM_PTE_WRITE_MASK |
  55. MM_PTE_OWNER_MASK |
  56. MM_PTE_TRANSITION_MASK |
  57. MM_READWRITE << MM_PROTECT_FIELD_SHIFT };
  58. MMPTE PrototypePte = { (MI_PTE_LOOKUP_NEEDED << 32) |
  59. MM_PTE_PROTOTYPE_MASK |
  60. MM_READWRITE << MM_PROTECT_FIELD_SHIFT };
  61. //
  62. // PTE which generates an access violation when referenced.
  63. //
  64. const MMPTE NoAccessPte = {MM_NOACCESS << MM_PROTECT_FIELD_SHIFT };
  65. //
  66. // Pool start and end.
  67. //
  68. PVOID MmNonPagedPoolStart;
  69. PVOID MmNonPagedPoolEnd = (PVOID)MM_NONPAGED_POOL_END;
  70. PVOID MmPagedPoolStart = (PVOID)MM_PAGED_POOL_START;
  71. PVOID MmPagedPoolEnd;
  72. //
  73. // Color tables for free and zeroed pages.
  74. //
  75. PMMCOLOR_TABLES MmFreePagesByColor[2];
  76. //
  77. // Color tables for modified pages destined for the paging file.
  78. //
  79. MMPFNLIST MmModifiedPageListByColor[MM_MAXIMUM_NUMBER_OF_COLORS] = {
  80. 0, ModifiedPageList, MM_EMPTY_LIST, MM_EMPTY_LIST};
  81. //
  82. // Count of the number of modified pages destined for the paging file.
  83. //
  84. PFN_NUMBER MmTotalPagesForPagingFile = 0;
  85. //
  86. // PTE reserved for mapping pages for the debugger.
  87. //
  88. PMMPTE MmDebugPte;
  89. PVOID MmDebugVa;
  90. //
  91. // 16 PTEs reserved for mapping MDLs (64k max).
  92. //
  93. PMMPTE MmCrashDumpPte;
  94. PVOID MmCrashDumpVa;
  95. ULONG_PTR MmBootImageSize;