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