]>
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
) {
38 SMBIOS_TABLE_TYPE32
*SmbiosRecord
;
39 SMBIOS_TABLE_TYPE32
*InputData
;
42 // First check for invalid parameters.
44 if (RecordData
== NULL
) {
45 return EFI_INVALID_PARAMETER
;
48 InputData
= (SMBIOS_TABLE_TYPE32
*)RecordData
;
51 // Two zeros following the last string.
53 SmbiosRecord
= AllocateZeroPool (sizeof (SMBIOS_TABLE_TYPE32
) + 1 + 1);
54 if (SmbiosRecord
== NULL
) {
55 return EFI_OUT_OF_RESOURCES
;
58 (VOID
)CopyMem (SmbiosRecord
, InputData
, sizeof (SMBIOS_TABLE_TYPE32
));
60 SmbiosRecord
->Hdr
.Length
= sizeof (SMBIOS_TABLE_TYPE32
);
62 SmbiosRecord
->BootStatus
= OemGetBootStatus ();
65 // Now we have got the full smbios record, call smbios protocol to add this record.
67 Status
= SmbiosMiscAddRecord ((UINT8
*)SmbiosRecord
, NULL
);
68 if (EFI_ERROR (Status
)) {
71 "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
78 FreePool (SmbiosRecord
);