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.

263 lines
5.3 KiB

  1. #ifndef _SAL_PROC_H
  2. #define _SAL_PROC_H
  3. /*
  4. *
  5. * Copyright (c) 1999 Intel Corporation
  6. *
  7. * Module Name:
  8. *
  9. * SalProc.h
  10. *
  11. * Abstract:
  12. *
  13. * Main SAL interface routins for IA-64 calls.
  14. *
  15. *
  16. * Revision History
  17. *
  18. */
  19. /* return value that mimicks r8,r9,r10 & r11 registers */
  20. typedef struct {
  21. UINT64 p0;
  22. UINT64 p1;
  23. UINT64 p2;
  24. UINT64 p3;
  25. } rArg;
  26. #define SAL_PCI_CONFIG_READ 0x01000010
  27. #define SAL_PCI_CONFIG_WRITE 0x01000011
  28. typedef VOID (*PFN)();
  29. typedef rArg (*PFN_SAL_PROC)(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
  30. typedef rArg (*PFN_SAL_CALLBACK)(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
  31. typedef struct _PLABEL {
  32. UINT64 ProcEntryPoint;
  33. UINT64 GP;
  34. } PLABEL;
  35. typedef struct tagIA32_BIOS_REGISTER_STATE {
  36. /* general registers */
  37. UINT32 eax;
  38. UINT32 ecx;
  39. UINT32 edx;
  40. UINT32 ebx;
  41. /* stack registers */
  42. UINT32 esp;
  43. UINT32 ebp;
  44. UINT32 esi;
  45. UINT32 edi;
  46. /* eflags */
  47. UINT32 eflags;
  48. /* instruction pointer */
  49. UINT32 eip;
  50. UINT16 cs;
  51. UINT16 ds;
  52. UINT16 es;
  53. UINT16 fs;
  54. UINT16 gs;
  55. UINT16 ss;
  56. /* Reserved */
  57. UINT32 Reserved1;
  58. UINT64 Reserved2;
  59. } IA32_BIOS_REGISTER_STATE;
  60. VOID EFIInitMsg(VOID);
  61. EFI_STATUS
  62. PlRegisterAndStartTimer(
  63. IN UINTN Period
  64. );
  65. EFI_STATUS
  66. PlDeRegisterAndCancelTimer(VOID);
  67. VOID
  68. SalProc (
  69. IN UINT64 Arg1,
  70. IN UINT64 Arg2,
  71. IN UINT64 Arg3,
  72. IN UINT64 Arg4,
  73. IN UINT64 Arg5,
  74. IN UINT64 Arg6,
  75. IN UINT64 Arg7,
  76. IN UINT64 Arg8,
  77. OUT rArg *Results OPTIONAL
  78. );
  79. VOID
  80. SalCallBack (
  81. IN UINT64 Arg1,
  82. IN UINT64 Arg2,
  83. IN UINT64 Arg3,
  84. IN UINT64 Arg4,
  85. IN UINT64 Arg5,
  86. IN UINT64 Arg6,
  87. IN UINT64 Arg7,
  88. IN UINT64 Arg8,
  89. OUT rArg *Results OPTIONAL
  90. );
  91. VOID
  92. RUNTIMEFUNCTION
  93. RtSalCallBack (
  94. IN UINT64 Arg1,
  95. IN UINT64 Arg2,
  96. IN UINT64 Arg3,
  97. IN UINT64 Arg4,
  98. IN UINT64 Arg5,
  99. IN UINT64 Arg6,
  100. IN UINT64 Arg7,
  101. IN UINT64 Arg8,
  102. OUT rArg *Results OPTIONAL
  103. );
  104. extern PLABEL RtGlobalSalProcEntry;
  105. extern PLABEL RtGlobalSALCallBack;
  106. #pragma pack(1)
  107. /*
  108. * SAL System Table
  109. */
  110. typedef struct {
  111. UINT32 Signature;
  112. UINT32 Length;
  113. UINT16 Revision;
  114. UINT16 EntryCount;
  115. UINT8 CheckSum;
  116. UINT8 Reserved[7];
  117. UINT16 SALA_Ver;
  118. UINT16 SALB_Ver;
  119. UINT8 OemId[32];
  120. UINT8 ProductID[32];
  121. UINT8 Reserved2[8];
  122. } SAL_SYSTEM_TABLE_HDR;
  123. #define SAL_ST_ENTRY_POINT 0
  124. #define SAL_ST_MEMORY_DESCRIPTOR 1
  125. #define SAL_ST_PLATFORM_FEATURES 2
  126. #define SAL_ST_TR_USAGE 3
  127. #define SAL_ST_PTC 4
  128. #define SAL_ST_AP_WAKEUP 5
  129. typedef struct {
  130. UINT8 Type; /* Type == 0 */
  131. UINT8 Reserved[7];
  132. UINT64 PalProcEntry;
  133. UINT64 SalProcEntry;
  134. UINT64 GlobalDataPointer;
  135. UINT64 Reserved2[2];
  136. } SAL_ST_ENTRY_POINT_DESCRIPTOR;
  137. typedef struct {
  138. UINT8 Type; /* Type == 1 */
  139. UINT8 NeedVirtualRegistration;
  140. UINT8 MemoryAttributes;
  141. UINT8 PageAccessRights;
  142. UINT8 SupportedAttributes;
  143. UINT8 Reserved;
  144. UINT16 MemoryType;
  145. UINT64 PhysicalMemoryAddress;
  146. UINT32 Length;
  147. UINT32 Reserved1;
  148. UINT64 OemReserved;
  149. } SAL_ST_MEMORY_DESCRIPTOR_ENTRY;
  150. /*
  151. * MemoryType info
  152. */
  153. #define SAL_SAPIC_IPI_BLOCK 0x0002
  154. #define SAL_IO_PORT_MAPPING 0x0003
  155. typedef struct {
  156. UINT8 Type; /* Type == 2 */
  157. UINT8 PlatformFeatures;
  158. UINT8 Reserved[14];
  159. } SAL_ST_MEMORY_DECRIPTOR;
  160. typedef struct {
  161. UINT8 Type; /* Type == 3 */
  162. UINT8 TRType;
  163. UINT8 TRNumber;
  164. UINT8 Reserved[5];
  165. UINT64 VirtualAddress;
  166. UINT64 EncodedPageSize;
  167. UINT64 Reserved1;
  168. } SAL_ST_TR_DECRIPTOR;
  169. typedef struct {
  170. UINT64 NumberOfProcessors;
  171. UINT64 LocalIDRegister;
  172. } SAL_COHERENCE_DOMAIN_INFO;
  173. typedef struct {
  174. UINT8 Type; /* Type == 4 */
  175. UINT8 Reserved[3];
  176. UINT32 NumberOfDomains;
  177. SAL_COHERENCE_DOMAIN_INFO *DomainInformation;
  178. } SAL_ST_CACHE_COHERENCE_DECRIPTOR;
  179. typedef struct {
  180. UINT8 Type; /* Type == 5 */
  181. UINT8 WakeUpType;
  182. UINT8 Reserved[6];
  183. UINT64 ExternalInterruptVector;
  184. } SAL_ST_AP_WAKEUP_DECRIPTOR;
  185. typedef struct {
  186. SAL_SYSTEM_TABLE_HDR Header;
  187. SAL_ST_ENTRY_POINT_DESCRIPTOR Entry0;
  188. } SAL_SYSTEM_TABLE_ASCENDING_ORDER;
  189. #define FIT_ENTRY_PTR (0x100000000 - 32) /* 4GB - 24 */
  190. #define FIT_PALA_ENTRY (0x100000000 - 48) /* 4GB - 32 */
  191. #define FIT_PALB_TYPE 01
  192. typedef struct {
  193. UINT64 Address;
  194. UINT8 Size[3];
  195. UINT8 Reserved;
  196. UINT16 Revision;
  197. UINT8 Type:7;
  198. UINT8 CheckSumValid:1;
  199. UINT8 CheckSum;
  200. } FIT_ENTRY;
  201. #pragma pack()
  202. typedef
  203. rArg
  204. (*CALL_SAL_PROC)(
  205. IN UINT64 Arg1,
  206. IN UINT64 Arg2,
  207. IN UINT64 Arg3,
  208. IN UINT64 Arg4,
  209. IN UINT64 Arg5,
  210. IN UINT64 Arg6,
  211. IN UINT64 Arg7,
  212. IN UINT64 Arg8
  213. );
  214. typedef
  215. rArg
  216. (*CALL_PAL_PROC)(
  217. IN UINT64 Arg1,
  218. IN UINT64 Arg2,
  219. IN UINT64 Arg3,
  220. IN UINT64 Arg4
  221. );
  222. extern CALL_SAL_PROC GlobalSalProc;
  223. extern CALL_PAL_PROC GlobalPalProc;
  224. extern PLABEL SalProcPlabel;
  225. extern PLABEL PalProcPlabel;
  226. #endif