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