]>
git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
2 boot information boot time changes.
5 Based on files under Nt32Pkg/MiscSubClassPlatformDxe/
7 Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
8 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
9 Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
10 Copyright (c) 2015, Linaro Limited. All rights reserved.<BR>
11 SPDX-License-Identifier: BSD-2-Clause-Patent
15 #include <Library/BaseLib.h>
16 #include <Library/BaseMemoryLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/MemoryAllocationLib.h>
19 #include <Library/OemMiscLib.h>
20 #include <Library/UefiBootServicesTableLib.h>
22 #include "SmbiosMisc.h"
25 This function makes boot time changes to the contents of the
26 MiscBootInformation (Type 32) record.
28 @param RecordData Pointer to SMBIOS table with default values.
29 @param Smbios SMBIOS protocol.
31 @retval EFI_SUCCESS The SMBIOS table was successfully added.
32 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
33 @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory.
36 SMBIOS_MISC_TABLE_FUNCTION(MiscBootInformation
)
39 SMBIOS_TABLE_TYPE32
*SmbiosRecord
;
40 SMBIOS_TABLE_TYPE32
*InputData
;
43 // First check for invalid parameters.
45 if (RecordData
== NULL
) {
46 return EFI_INVALID_PARAMETER
;
49 InputData
= (SMBIOS_TABLE_TYPE32
*)RecordData
;
52 // Two zeros following the last string.
54 SmbiosRecord
= AllocateZeroPool (sizeof (SMBIOS_TABLE_TYPE32
) + 1 + 1);
55 if (SmbiosRecord
== NULL
) {
56 return EFI_OUT_OF_RESOURCES
;
59 (VOID
)CopyMem (SmbiosRecord
, InputData
, sizeof (SMBIOS_TABLE_TYPE32
));
61 SmbiosRecord
->Hdr
.Length
= sizeof (SMBIOS_TABLE_TYPE32
);
63 SmbiosRecord
->BootStatus
= OemGetBootStatus ();
66 // Now we have got the full smbios record, call smbios protocol to add this record.
68 Status
= SmbiosMiscAddRecord ((UINT8
*)SmbiosRecord
, NULL
);
69 if (EFI_ERROR (Status
)) {
70 DEBUG ((DEBUG_ERROR
, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
71 __FUNCTION__
, __LINE__
, Status
));
74 FreePool (SmbiosRecord
);