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