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.

283 lines
6.6 KiB

  1. /**
  2. *** Copyright (C) 1996-97 Intel Corporation. All rights reserved.
  3. ***
  4. *** The information and source code contained herein is the exclusive
  5. *** property of Intel Corporation and may not be disclosed, examined
  6. *** or reproduced in whole or in part without explicit written authorization
  7. *** from the company.
  8. **/
  9. //++
  10. //
  11. // Module name
  12. // sal.h
  13. // Author
  14. // Allen Kay (akay) Jun-12-95
  15. // Description
  16. // Defines SAL data structures
  17. //--
  18. #ifndef __SUSAL__
  19. #define __SUSAL__
  20. typedef struct _IA32_BIOS_REGISTER_STATE {
  21. // general registers
  22. ULONG eax;
  23. ULONG ecx;
  24. ULONG edx;
  25. ULONG ebx;
  26. ULONG esp;
  27. // stack registers
  28. ULONG ebp;
  29. ULONG esi;
  30. ULONG edi;
  31. // eflags
  32. ULONG eflags;
  33. // instruction pointer
  34. ULONG eip;
  35. // segment registers
  36. USHORT cs;
  37. USHORT ds;
  38. USHORT es;
  39. USHORT fs;
  40. USHORT gs;
  41. USHORT ss;
  42. ULONG Reserved1;
  43. ULONGLONG Reserved2;
  44. } IA32_BIOS_REGISTER_STATE, *PIA32_BIOS_REGISTER_STATE;
  45. typedef union _BIT32_AND_BIT16 {
  46. ULONG Part32;
  47. struct {
  48. USHORT LowPart16;
  49. USHORT HighPart16;
  50. };
  51. struct {
  52. UCHAR Byte0;
  53. UCHAR Byte1;
  54. UCHAR Byte2;
  55. UCHAR Byte3;
  56. };
  57. } BIT32_AND_BIT16;
  58. //
  59. // EFLAG definition
  60. //
  61. #define CARRY_FLAG 0x1
  62. #define PARITY_FLAG 0x2
  63. #define AUXILARY_FLAG 0x4
  64. #define ZERO_FLAG 0x8
  65. #define SIGN_FLAG 0x10
  66. #define TRAP_FLAG 0x11
  67. //
  68. // SAL descriptor types
  69. //
  70. typedef enum {
  71. PAL_SAL_EP_TYPE = 0,
  72. SAL_MEMORY_TYPE,
  73. PLATFORM_FEATURES_TYPE,
  74. TRANSLATION_REGISTER_TYPE,
  75. PTC_COHERENCE_TYPE,
  76. AP_WAKEUP_TYPE
  77. };
  78. //
  79. // Format of the SAL System Table (SST) Header. SAL Specs July 2000, Revision: 2.9.
  80. // The SST is followed by a variable number of entries with varying length.
  81. //
  82. typedef struct _SST_HEADER {
  83. ULONG Signature;
  84. ULONG Length;
  85. USHORT SalRev;
  86. USHORT EntryCount;
  87. UCHAR CheckSum;
  88. UCHAR Reserved1[7];
  89. USHORT Sal_A_Version;
  90. USHORT Sal_B_Version;
  91. UCHAR OemId[32];
  92. UCHAR ProductId[32];
  93. UCHAR Reserved2[8];
  94. } SST_HEADER, *PSST_HEADER;
  95. //
  96. // PAL and SAL entry point descriptor
  97. //
  98. typedef struct _PAL_SAL_ENTRY_POINT {
  99. UCHAR EntryType;
  100. UCHAR Reserved0[7];
  101. ULONGLONG PalEntryPoint;
  102. ULONGLONG SalEntryPoint;
  103. ULONGLONG GlobalPointer;
  104. UCHAR Reserved1[16];
  105. } PAL_SAL_ENTRY_POINT, *PPAL_SAL_ENTRY_POINT;
  106. //
  107. // Memory descriptor
  108. //
  109. typedef struct _SAL_MEMORY_DESCRIPTOR {
  110. UCHAR EntryType;
  111. UCHAR NeedVaReg;
  112. UCHAR CurrentAttribute;
  113. UCHAR PageAccessRights;
  114. UCHAR SupportedAttribute;
  115. UCHAR Reserved1[1];
  116. UCHAR MemoryType;
  117. UCHAR MemoryUsage;
  118. ULONGLONG Address;
  119. ULONG Length;
  120. UCHAR Reserved[4];
  121. UCHAR OemReserved[8];
  122. } SAL_MEMORY_DESCRIPTOR, *PSAL_MEMORY_DESCRIPTOR;
  123. typedef struct _PLATFORM_FEATURES {
  124. UCHAR EntryType;
  125. UCHAR FeatureList;
  126. UCHAR Reserved[14];
  127. } PLATFORM_FEATURES, *PPLATFORM_FEATURES;
  128. typedef struct _TRANSLATION_REGISTER {
  129. UCHAR EntryType;
  130. UCHAR TRType;
  131. UCHAR TRNumber;
  132. UCHAR Reserved1[5];
  133. ULONGLONG VirtualAddress;
  134. ULONGLONG PageSize;
  135. UCHAR Reserved2[8];
  136. } TRANSLATION_REGISTER, *PTRANSLATION_REGISTER;
  137. typedef struct _PTC_COHERENCE_DOMAIN {
  138. UCHAR EntryType;
  139. UCHAR Reserved[3];
  140. ULONG NumberOfDomains;
  141. ULONGLONG CoherenceDomainInfo;
  142. } PTC_COHERENCE_DOMAIN, *PPTC_COHERENCE_DOMAIN;
  143. typedef struct _COHERENCE_DOMAIN_INFO {
  144. ULONGLONG NumberOfProcessors;
  145. ULONGLONG LocalIdRegisters;
  146. } COHERENCE_DOMAIN_INFO, *PCOHERENCE_DOMAIN_INFO;
  147. typedef struct _AP_WAKEUP_DESCRIPTOR {
  148. UCHAR EntryType;
  149. UCHAR WakeupMechanism;
  150. UCHAR Reserved[6];
  151. ULONGLONG WakeupVector;
  152. } AP_WAKEUP_DESCRIPTOR, *PAP_WAKEUP_DESCRIPTOR;
  153. typedef struct _BOOT_INFO_TABLE {
  154. ULONGLONG Signature;
  155. ULONG TableLength;
  156. UCHAR CheckSum;
  157. UCHAR DriveNumber;
  158. UCHAR OsRecord;
  159. UCHAR Reserved1[1];
  160. PULONGLONG OsBootDevice;
  161. UCHAR ConsoleInputNumber;
  162. UCHAR ConsoleOutputNumber;
  163. UCHAR Reserved2[6];
  164. ULONGLONG OsBootDeviceRecord;
  165. ULONGLONG ConsoleIn1DevInfo;
  166. ULONGLONG ConsoleOut1DevInfo;
  167. } BOOT_INFO_TABLE, *PBOOT_INFO_TABLE;
  168. //
  169. //
  170. // EDD Disk Address Packet definition
  171. //
  172. typedef struct _DISK_ADDRESS_PACKET {
  173. UCHAR PacketSize;
  174. UCHAR Reserved0;
  175. UCHAR BlocksToTransfer;
  176. UCHAR Reserved1;
  177. ULONG Buffer32;
  178. ULONGLONG LBA;
  179. PUCHAR Buffer64;
  180. } DISK_ADDRESS_PACKET, *PDISK_ADDRESS_PACKET;
  181. //
  182. // SAL procedure function ID's
  183. //
  184. #define SAL_SYSTEM_RESET 0x01000000
  185. #define SAL_SET_VECTORS 0x01000001
  186. #define SAL_GET_STATE_INFO 0x01000002
  187. #define SAL_GET_STATE_INFO_SIZE 0x01000003
  188. #define SAL_CLEAR_STATE_INFO 0x01000004
  189. #define SAL_MC_RENDEZ 0x01000005
  190. #define SAL_MC_SET_PARAMS 0x01000006
  191. #define SAL_VERSION 0x01000007
  192. #define SAL_CACHE_FLUSH 0x01000010
  193. #define SAL_CACHE_INIT 0x01000011
  194. #define SAL_PCI_CONFIG_READ 0x01000030
  195. #define SAL_PCI_CONFIG_WRITE 0x01000031
  196. #define SAL_FREQ_BASE 0x01000032
  197. #define SAL_EXT_ISR_ADD 0x01000033
  198. #define SAL_EXT_ISR_DELETE 0x01000034
  199. #define SAL_ALLOC_MEM 0x01000050
  200. #define SAL_FREE_MEM 0x01000051
  201. #define SAL_UPDATE_PAL 0x01000060
  202. //
  203. // Macro used by functions in exp.c
  204. //
  205. #define BCD_TO_BIN(BcdNumber) (BcdNumber & 0xf0) + (BcdNumber & 0x0f)
  206. //
  207. // Structure definitions and equates for INT 15 function E820
  208. //
  209. typedef struct _E820_FRAME {
  210. ULONG ErrorFlag;
  211. ULONG Key;
  212. ULONG DescSize;
  213. ULONG BaseAddrLow;
  214. ULONG BaseAddrHigh;
  215. ULONG SizeLow;
  216. ULONG SizeHigh;
  217. ULONG MemoryType;
  218. } E820_FRAME, *PE820_FRAME;
  219. //
  220. // Return value structure
  221. //
  222. typedef struct _SAL_RETURN_VALUES {
  223. ULONGLONG RetVal0;
  224. ULONGLONG RetVal1;
  225. ULONGLONG RetVal2;
  226. ULONGLONG RetVal3;
  227. } SAL_RETURN_VALUES, *PSAL_RETURN_VALUES;
  228. //
  229. // SAL Handoff Parameters
  230. //
  231. typedef struct _SAL_HANDOFF_PARAMS {
  232. ULONG_PTR MPSConfigTable;
  233. ULONG_PTR SalSystemTable;
  234. ULONG_PTR BootInfoTable;
  235. ULONG_PTR PalProcEp;
  236. ULONG_PTR SalProcEp;
  237. ULONGLONG SalProcGp;
  238. ULONG_PTR AcpiRsdt;
  239. } SAL_HANDOFF_PARAMS, *PSAL_HANDOFF_PARAMS;
  240. //
  241. // Defining entry point for SAL_PROC.
  242. //
  243. typedef
  244. VOID
  245. (*PTRANSFER_ROUTINE) ();
  246. //
  247. // Misc. definitions.
  248. //
  249. #define SAL_BLOCK_SIZE 0x1000 // SAL memory block size
  250. #endif __SUSAL__