]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/MiscBootInformationFunction.c
841d5923146a8fec231a455e5d59613a7ef3c5f8
[mirror_edk2.git] / QuarkPlatformPkg / Platform / Dxe / SmbiosMiscDxe / MiscBootInformationFunction.c
1 /** @file
2 boot information boot time changes.
3 SMBIOS type 32.
4
5 Copyright (c) 2013-2015 Intel Corporation.
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9
10 **/
11
12
13 #include "CommonHeader.h"
14 #include "SmbiosMisc.h"
15
16
17 /**
18 This function makes boot time changes to the contents of the
19 MiscBootInformation (Type 32).
20
21 @param RecordData Pointer to copy of RecordData from the Data Table.
22
23 @retval EFI_SUCCESS All parameters were valid.
24 @retval EFI_UNSUPPORTED Unexpected RecordType value.
25 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
26
27 **/
28
29 MISC_SMBIOS_TABLE_FUNCTION(MiscBootInfoStatus)
30 {
31 EFI_STATUS Status;
32 EFI_SMBIOS_HANDLE SmbiosHandle;
33 SMBIOS_TABLE_TYPE32 *SmbiosRecord;
34 EFI_MISC_BOOT_INFORMATION_STATUS* ForType32InputData;
35
36 ForType32InputData = (EFI_MISC_BOOT_INFORMATION_STATUS *)RecordData;
37
38 //
39 // First check for invalid parameters.
40 //
41 if (RecordData == NULL) {
42 return EFI_INVALID_PARAMETER;
43 }
44
45 //
46 // Two zeros following the last string.
47 //
48 SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);
49 ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);
50
51 SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;
52 SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);
53 //
54 // Make handle chosen by smbios protocol.add automatically.
55 //
56 SmbiosRecord->Hdr.Handle = 0;
57 SmbiosRecord->BootStatus = (UINT8)ForType32InputData->BootInformationStatus;
58
59 //
60 // Now we have got the full smbios record, call smbios protocol to add this record.
61 //
62 SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
63 Status = Smbios-> Add(
64 Smbios,
65 NULL,
66 &SmbiosHandle,
67 (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
68 );
69 FreePool(SmbiosRecord);
70 return Status;
71 }