]>
Commit | Line | Data |
---|---|---|
41335d22 | 1 | /** @file\r |
2 | Definition of Extended SAL Boot Service Protocol\r | |
3 | \r | |
9095d37b | 4 | The Extended SAL Boot Service Protocol provides a mechanisms for platform specific\r |
41335d22 | 5 | drivers to update the SAL System Table and register Extended SAL Procedures that are\r |
6 | callable in physical or virtual mode using the SAL calling convention.\r | |
7 | \r | |
9095d37b | 8 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 9 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
41335d22 | 10 | \r |
497a5fb1 SZ |
11 | @par Revision Reference:\r |
12 | This Protocol was introduced in PI Specification 1.2.\r | |
13 | \r | |
41335d22 | 14 | **/\r |
15 | \r | |
16 | #ifndef _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL_H_\r | |
17 | #define _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL_H_\r | |
18 | \r | |
19 | #include <IndustryStandard/Sal.h>\r | |
20 | \r | |
21 | #define EXTENDED_SAL_BOOT_SERVICE_PROTOCOL_GUID \\r | |
22 | { 0xde0ee9a4, 0x3c7a, 0x44f2, {0xb7, 0x8b, 0xe3, 0xcc, 0xd6, 0x9c, 0x3a, 0xf7 } }\r | |
23 | \r | |
24 | typedef struct _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL EXTENDED_SAL_BOOT_SERVICE_PROTOCOL;\r | |
25 | \r | |
26 | /**\r | |
27 | Adds platform specific information to the to the header of the SAL System Table.\r | |
28 | \r | |
29 | @param This A pointer to the EXTENDED_SAL_BOOT_SERVICE_PROTOCOL instance.\r | |
30 | @param SalAVersion Version of recovery SAL PEIM(s) in BCD format. Higher byte contains\r | |
31 | the major revision and the lower byte contains the minor revision.\r | |
32 | @param SalBVersion Version of DXE SAL Driver in BCD format. Higher byte contains\r | |
33 | the major revision and the lower byte contains the minor revision.\r | |
34 | @param OemId A pointer to a Null-terminated ASCII string that contains OEM unique string.\r | |
35 | The string cannot be longer than 32 bytes in total length\r | |
9095d37b | 36 | @param ProductId A pointer to a Null-terminated ASCII string that uniquely identifies a family of\r |
41335d22 | 37 | compatible products. The string cannot be longer than 32 bytes in total length.\r |
38 | \r | |
39 | @retval EFI_SUCCESS The SAL System Table header was updated successfully.\r | |
40 | @retval EFI_INVALID_PARAMETER OemId is NULL.\r | |
41 | @retval EFI_INVALID_PARAMETER ProductId is NULL.\r | |
42 | @retval EFI_INVALID_PARAMETER The length of OemId is greater than 32 characters.\r | |
43 | @retval EFI_INVALID_PARAMETER The length of ProductId is greater than 32 characters.\r | |
44 | \r | |
45 | **/\r | |
46 | typedef\r | |
47 | EFI_STATUS\r | |
a1749b80 | 48 | (EFIAPI *EXTENDED_SAL_ADD_SST_INFO)(\r |
41335d22 | 49 | IN EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *This,\r |
50 | IN UINT16 SalAVersion,\r | |
51 | IN UINT16 SalBVersion,\r | |
52 | IN CHAR8 *OemId,\r | |
53 | IN CHAR8 *ProductId\r | |
54 | );\r | |
55 | \r | |
56 | /**\r | |
57 | Adds an entry to the SAL System Table.\r | |
58 | \r | |
59 | This function adds the SAL System Table Entry specified by TableEntry and EntrySize\r | |
60 | to the SAL System Table.\r | |
61 | \r | |
62 | @param This A pointer to the EXTENDED_SAL_BOOT_SERVICE_PROTOCOL instance.\r | |
9095d37b | 63 | @param TableEntry Pointer to a buffer containing a SAL System Table entry that is EntrySize bytes\r |
41335d22 | 64 | in length. The first byte of the TableEntry describes the type of entry.\r |
65 | @param EntrySize The size, in bytes, of TableEntry.\r | |
66 | \r | |
67 | @retval EFI_SUCCESSThe SAL System Table was updated successfully.\r | |
68 | @retval EFI_INVALID_PARAMETER TableEntry is NULL.\r | |
69 | @retval EFI_INVALID_PARAMETER TableEntry specifies an invalid entry type.\r | |
70 | @retval EFI_INVALID_PARAMETER EntrySize is not valid for this type of entry.\r | |
71 | \r | |
72 | **/\r | |
73 | typedef\r | |
74 | EFI_STATUS\r | |
a1749b80 | 75 | (EFIAPI *EXTENDED_SAL_ADD_SST_ENTRY)(\r |
41335d22 | 76 | IN EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *This,\r |
77 | IN UINT8 *TableEntry,\r | |
78 | IN UINTN EntrySize\r | |
79 | );\r | |
80 | \r | |
81 | /**\r | |
82 | Internal ESAL procedures.\r | |
83 | \r | |
84 | This is prototype of internal Extended SAL procedures, which is registerd by\r | |
85 | EXTENDED_SAL_REGISTER_INTERNAL_PROC service.\r | |
86 | \r | |
87 | @param FunctionId The Function ID associated with this Extended SAL Procedure.\r | |
88 | @param Arg2 Second argument to the Extended SAL procedure.\r | |
89 | @param Arg3 Third argument to the Extended SAL procedure.\r | |
90 | @param Arg4 Fourth argument to the Extended SAL procedure.\r | |
91 | @param Arg5 Fifth argument to the Extended SAL procedure.\r | |
92 | @param Arg6 Sixth argument to the Extended SAL procedure.\r | |
93 | @param Arg7 Seventh argument to the Extended SAL procedure.\r | |
94 | @param Arg8 Eighth argument to the Extended SAL procedure.\r | |
95 | @param VirtualMode TRUE if the Extended SAL Procedure is being invoked in virtual mode.\r | |
96 | FALSE if the Extended SAL Procedure is being invoked in physical mode.\r | |
9095d37b | 97 | @param ModuleGlobal A pointer to the global context associated with this Extended SAL Procedure.\r |
41335d22 | 98 | \r |
99 | @return The result returned from the specified Extended SAL Procedure\r | |
100 | \r | |
101 | **/\r | |
102 | typedef\r | |
103 | SAL_RETURN_REGS\r | |
a1749b80 | 104 | (EFIAPI *SAL_INTERNAL_EXTENDED_SAL_PROC)(\r |
41335d22 | 105 | IN UINT64 FunctionId,\r |
106 | IN UINT64 Arg2,\r | |
107 | IN UINT64 Arg3,\r | |
108 | IN UINT64 Arg4,\r | |
109 | IN UINT64 Arg5,\r | |
110 | IN UINT64 Arg6,\r | |
111 | IN UINT64 Arg7,\r | |
112 | IN UINT64 Arg8,\r | |
113 | IN BOOLEAN VirtualMode,\r | |
114 | IN VOID *ModuleGlobal OPTIONAL\r | |
9095d37b | 115 | );\r |
41335d22 | 116 | \r |
117 | /**\r | |
118 | Registers an Extended SAL Procedure.\r | |
119 | \r | |
120 | The Extended SAL Procedure specified by InternalSalProc and named by ClassGuidLo,\r | |
121 | ClassGuidHi, and FunctionId is added to the set of available Extended SAL Procedures.\r | |
122 | \r | |
123 | @param This A pointer to the EXTENDED_SAL_BOOT_SERVICE_PROTOCOL instance.\r | |
9095d37b | 124 | @param ClassGuidLo The lower 64-bits of the class GUID for the Extended SAL Procedure being added.\r |
41335d22 | 125 | Each class GUID contains one or more functions specified by a Function ID.\r |
9095d37b | 126 | @param ClassGuidHi The upper 64-bits of the class GUID for the Extended SAL Procedure being added.\r |
41335d22 | 127 | Each class GUID contains one or more functions specified by a Function ID.\r |
9095d37b LG |
128 | @param FunctionId The Function ID for the Extended SAL Procedure that is being added. This Function\r |
129 | ID is a member of the Extended SAL Procedure class specified by ClassGuidLo\r | |
41335d22 | 130 | and ClassGuidHi.\r |
131 | @param InternalSalProc A pointer to the Extended SAL Procedure being added.\r | |
132 | @param PhysicalModuleGlobal Pointer to a module global structure. This is a physical mode pointer.\r | |
9095d37b | 133 | This pointer is passed to the Extended SAL Procedure specified by ClassGuidLo,\r |
41335d22 | 134 | ClassGuidHi, FunctionId, and InternalSalProc. If the system is in physical mode,\r |
135 | then this pointer is passed unmodified to InternalSalProc. If the system is in\r | |
136 | virtual mode, then the virtual address associated with this pointer is passed to\r | |
137 | InternalSalProc.\r | |
138 | \r | |
139 | @retval EFI_SUCCESS The Extended SAL Procedure was added.\r | |
140 | @retval EFI_OUT_OF_RESOURCES There are not enough resources available to add the Extended SAL Procedure.\r | |
141 | \r | |
142 | **/\r | |
143 | typedef\r | |
144 | EFI_STATUS\r | |
a1749b80 | 145 | (EFIAPI *EXTENDED_SAL_REGISTER_INTERNAL_PROC)(\r |
41335d22 | 146 | IN EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *This,\r |
147 | IN UINT64 ClassGuidLo,\r | |
148 | IN UINT64 ClassGuidHi,\r | |
149 | IN UINT64 FunctionId,\r | |
150 | IN SAL_INTERNAL_EXTENDED_SAL_PROC InternalSalProc,\r | |
151 | IN VOID *PhysicalModuleGlobal OPTIONAL\r | |
152 | );\r | |
153 | \r | |
154 | /**\r | |
155 | Calls a previously registered Extended SAL Procedure.\r | |
156 | \r | |
9095d37b LG |
157 | This function calls the Extended SAL Procedure specified by ClassGuidLo, ClassGuidHi,\r |
158 | and FunctionId. The set of previously registered Extended SAL Procedures is searched for a\r | |
159 | matching ClassGuidLo, ClassGuidHi, and FunctionId. If a match is not found, then\r | |
41335d22 | 160 | EFI_SAL_NOT_IMPLEMENTED is returned.\r |
161 | \r | |
162 | @param ClassGuidLo The lower 64-bits of the class GUID for the Extended SAL Procedure\r | |
163 | that is being called.\r | |
164 | @param ClassGuidHi The upper 64-bits of the class GUID for the Extended SAL Procedure\r | |
165 | that is being called.\r | |
166 | @param FunctionId Function ID for the Extended SAL Procedure being called.\r | |
167 | @param Arg2 Second argument to the Extended SAL procedure.\r | |
168 | @param Arg3 Third argument to the Extended SAL procedure.\r | |
169 | @param Arg4 Fourth argument to the Extended SAL procedure.\r | |
170 | @param Arg5 Fifth argument to the Extended SAL procedure.\r | |
171 | @param Arg6 Sixth argument to the Extended SAL procedure.\r | |
172 | @param Arg7 Seventh argument to the Extended SAL procedure.\r | |
173 | @param Arg8 Eighth argument to the Extended SAL procedure.\r | |
174 | \r | |
9095d37b | 175 | @retval EFI_SAL_NOT_IMPLEMENTED The Extended SAL Procedure specified by ClassGuidLo,\r |
41335d22 | 176 | ClassGuidHi, and FunctionId has not been registered.\r |
9095d37b | 177 | @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before virtual mappings\r |
41335d22 | 178 | for the specified Extended SAL Procedure are available.\r |
179 | @retval Other The result returned from the specified Extended SAL Procedure\r | |
180 | \r | |
181 | **/\r | |
182 | typedef\r | |
183 | SAL_RETURN_REGS\r | |
a1749b80 | 184 | (EFIAPI *EXTENDED_SAL_PROC)(\r |
41335d22 | 185 | IN UINT64 ClassGuidLo,\r |
186 | IN UINT64 ClassGuidHi,\r | |
187 | IN UINT64 FunctionId,\r | |
188 | IN UINT64 Arg2,\r | |
189 | IN UINT64 Arg3,\r | |
190 | IN UINT64 Arg4,\r | |
191 | IN UINT64 Arg5,\r | |
192 | IN UINT64 Arg6,\r | |
193 | IN UINT64 Arg7,\r | |
194 | IN UINT64 Arg8\r | |
195 | );\r | |
196 | \r | |
197 | ///\r | |
9095d37b | 198 | /// The EXTENDED_SAL_BOOT_SERVICE_PROTOCOL provides a mechanisms for platform specific\r |
41335d22 | 199 | /// drivers to update the SAL System Table and register Extended SAL Procedures that are\r |
200 | /// callable in physical or virtual mode using the SAL calling convention.\r | |
201 | ///\r | |
202 | struct _EXTENDED_SAL_BOOT_SERVICE_PROTOCOL {\r | |
203 | EXTENDED_SAL_ADD_SST_INFO AddSalSystemTableInfo;\r | |
204 | EXTENDED_SAL_ADD_SST_ENTRY AddSalSystemTableEntry;\r | |
9095d37b | 205 | EXTENDED_SAL_REGISTER_INTERNAL_PROC RegisterExtendedSalProc;\r |
41335d22 | 206 | EXTENDED_SAL_PROC ExtendedSalProc;\r |
207 | };\r | |
208 | \r | |
209 | extern EFI_GUID gEfiExtendedSalBootServiceProtocolGuid;\r | |
210 | \r | |
211 | #endif\r |