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