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.

246 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. kiamd64.h
  5. Abstract:
  6. This module contains the private (internal) platform specific header file
  7. for the kernel.
  8. Author:
  9. David N. Cutler (davec) 15-May-2000
  10. Revision History:
  11. --*/
  12. #if !defined(_KIAMD64_)
  13. #define _KIAMD64_
  14. VOID
  15. KiCheckBreakInRequest (
  16. VOID
  17. );
  18. VOID
  19. KiInitializeBootStructures (
  20. PLOADER_PARAMETER_BLOCK LoaderBlock
  21. );
  22. ULONG
  23. KiCopyInformation (
  24. IN OUT PEXCEPTION_RECORD ExceptionRecord1,
  25. IN PEXCEPTION_RECORD ExceptionRecord2
  26. );
  27. extern KIRQL KiProfileIrql;
  28. BOOLEAN
  29. KeInvalidateAllCaches (
  30. IN BOOLEAN AllProcessors
  31. );
  32. VOID
  33. KiRetireDpcList (
  34. PKPRCB Prcb
  35. );
  36. //
  37. // Define function prototypes for trap processing functions.
  38. //
  39. VOID
  40. KiDivideErrorFault (
  41. VOID
  42. );
  43. VOID
  44. KiDebugTrapOrFault (
  45. VOID
  46. );
  47. VOID
  48. KiNmiInterrupt (
  49. VOID
  50. );
  51. VOID
  52. KiBreakpointTrap (
  53. VOID
  54. );
  55. VOID
  56. KiOverflowTrap (
  57. VOID
  58. );
  59. VOID
  60. KiBoundFault (
  61. VOID
  62. );
  63. VOID
  64. KiInvalidOpcodeFault (
  65. VOID
  66. );
  67. VOID
  68. KiNpxNotAvailableFault (
  69. VOID
  70. );
  71. VOID
  72. KiDoubleFaultAbort (
  73. VOID
  74. );
  75. VOID
  76. KiNpxSegmentOverrunAbort (
  77. VOID
  78. );
  79. VOID
  80. KiInvalidTssFault (
  81. VOID
  82. );
  83. VOID
  84. KiSegmentNotPresentFault (
  85. VOID
  86. );
  87. VOID
  88. KiSetPageAttributesTable (
  89. VOID
  90. );
  91. VOID
  92. KiStackFault (
  93. VOID
  94. );
  95. VOID
  96. KiGeneralProtectionFault (
  97. VOID
  98. );
  99. VOID
  100. KiPageFault (
  101. VOID
  102. );
  103. VOID
  104. KiFloatingErrorFault (
  105. VOID
  106. );
  107. VOID
  108. KiAlignmentFault (
  109. VOID
  110. );
  111. VOID
  112. KiMcheckAbort (
  113. VOID
  114. );
  115. VOID
  116. KiXmmException (
  117. VOID
  118. );
  119. VOID
  120. KiApcInterrupt (
  121. VOID
  122. );
  123. VOID
  124. KiDebugServiceTrap (
  125. VOID
  126. );
  127. VOID
  128. KiDpcInterrupt (
  129. VOID
  130. );
  131. VOID
  132. KiSystemCall32 (
  133. VOID
  134. );
  135. VOID
  136. KiSystemCall64 (
  137. VOID
  138. );
  139. //
  140. // Define unexpected interrupt structure and table.
  141. //
  142. // N.B. The actual table is generated in assembler.
  143. //
  144. typedef struct _UNEXPECTED_INTERRUPT {
  145. ULONG Array[4];
  146. } UNEXPECTED_INTERRUPT, *PUNEXPECTED_INTERRUPT;
  147. UNEXPECTED_INTERRUPT KxUnexpectedInterrupt0[];
  148. //
  149. // PAE definitions.
  150. //
  151. #define MAX_IDENTITYMAP_ALLOCATIONS 30
  152. typedef struct _IDENTITY_MAP {
  153. PHARDWARE_PTE TopLevelDirectory;
  154. ULONG64 IdentityCR3;
  155. ULONG64 IdentityAddr;
  156. ULONG PagesAllocated;
  157. PVOID PageList[MAX_IDENTITYMAP_ALLOCATIONS];
  158. } IDENTITY_MAP, *PIDENTITY_MAP;
  159. VOID
  160. Ki386ClearIdentityMap(
  161. PIDENTITY_MAP IdentityMap
  162. );
  163. VOID
  164. Ki386EnableTargetLargePage(
  165. PIDENTITY_MAP IdentityMap
  166. );
  167. BOOLEAN
  168. Ki386CreateIdentityMap(
  169. IN OUT PIDENTITY_MAP IdentityMap,
  170. IN PVOID StartVa,
  171. IN PVOID EndVa
  172. );
  173. BOOLEAN
  174. Ki386EnableCurrentLargePage (
  175. IN ULONG IdentityAddr,
  176. IN ULONG IdentityCr3
  177. );
  178. extern PVOID Ki386EnableCurrentLargePageEnd;
  179. #define PPI_BITS 2
  180. #define PDI_BITS 9
  181. #define PTI_BITS 9
  182. #define PDI_MASK ((1 << PDI_BITS) - 1)
  183. #define PTI_MASK ((1 << PTI_BITS) - 1)
  184. #define KiGetPpeIndex(va) ((((ULONG)(va)) >> PPI_SHIFT) & PPI_MASK)
  185. #define KiGetPdeIndex(va) ((((ULONG)(va)) >> PDI_SHIFT) & PDI_MASK)
  186. #define KiGetPteIndex(va) ((((ULONG)(va)) >> PTI_SHIFT) & PTI_MASK)
  187. extern ULONG KeAmd64MachineType;
  188. #endif // !defined(_KIAMD64_)