18 CHAR16 NullTerminator;
25 "sizeof (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA) is expected to be 18 bytes"
54 ResetData.NullTerminator = CHAR_NULL;
113 UINTN ResetDataStringSize;
114 GUID *ResetSubtypeGuid;
119 if ((ResetData ==
NULL) || (DataSize <
sizeof (
GUID))) {
127 ResetDataStringSize =
StrnSizeS (ResetData, (DataSize /
sizeof (CHAR16)));
133 if ((ResetDataStringSize < DataSize) && ((DataSize - ResetDataStringSize) >=
sizeof (
GUID))) {
134 ResetSubtypeGuid = (
GUID *)((UINT8 *)ResetData + ResetDataStringSize);
135 DEBUG ((DEBUG_VERBOSE,
"%a - Detected reset subtype %g...\n", __func__, ResetSubtypeGuid));
136 return ResetSubtypeGuid;
179 IN OUT VOID *ResetData,
181 IN CONST CHAR16 *ResetString OPTIONAL,
182 IN UINTN ExtraDataSize OPTIONAL,
183 IN CONST VOID *ExtraData OPTIONAL
186 UINTN ResetStringSize;
187 UINTN ResetDataBufferSize;
193 if (ResetDataSize ==
NULL) {
200 if ((ExtraDataSize > 0) && (ExtraData ==
NULL)) {
207 if ((ResetSubtype ==
NULL) && (ExtraDataSize > 0)) {
214 if (ResetString ==
NULL) {
221 ResetStringSize =
StrnSizeS (ResetString, MAX_UINT16);
222 ResetDataBufferSize = ResetStringSize + ExtraDataSize;
223 if (ResetSubtype !=
NULL) {
224 ResetDataBufferSize +=
sizeof (
GUID);
231 if (*ResetDataSize < ResetDataBufferSize) {
232 *ResetDataSize = ResetDataBufferSize;
236 *ResetDataSize = ResetDataBufferSize;
237 if (ResetData ==
NULL) {
244 Data = (UINT8 *)ResetData;
245 CopyMem (Data, ResetString, ResetStringSize);
246 Data += ResetStringSize;
247 if (ResetSubtype !=
NULL) {
249 Data +=
sizeof (
GUID);
252 if (ExtraDataSize > 0) {
253 CopyMem (Data, ExtraData, ExtraDataSize);
VOID EFIAPI ResetSystem(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
UINTN EFIAPI StrnSizeS(IN CONST CHAR16 *String, IN UINTN MaxSize)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
#define RETURN_BUFFER_TOO_SMALL
#define OFFSET_OF(TYPE, Field)
#define RETURN_INVALID_PARAMETER
#define DEBUG(Expression)
RETURN_STATUS EFIAPI BuildResetData(IN OUT UINTN *ResetDataSize, IN OUT VOID *ResetData, IN CONST GUID *ResetSubtype OPTIONAL, IN CONST CHAR16 *ResetString OPTIONAL, IN UINTN ExtraDataSize OPTIONAL, IN CONST VOID *ExtraData OPTIONAL)
VOID EFIAPI ResetPlatformSpecificGuid(IN CONST GUID *ResetSubtype)
VOID EFIAPI ResetSystemWithSubtype(IN EFI_RESET_TYPE ResetType, IN CONST GUID *ResetSubtype)
GUID *EFIAPI GetResetPlatformSpecificGuid(IN UINTN DataSize, IN CONST VOID *ResetData)
@ EfiResetPlatformSpecific