]> git.proxmox.com Git - mirror_edk2.git/blame - Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c
BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[mirror_edk2.git] / Nt32Pkg / MiscSubClassPlatformDxe / MiscBootInformationFunction.c
CommitLineData
5e973c96 1/** @file\r
1fdd39d3 2 boot information boot time changes.\r
3 SMBIOS type 32.\r
5e973c96 4 \r
7ee85aa2 5Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
8f2a5f80 6This program and the accompanying materials\r
5e973c96 7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
1fdd39d3 10\r
5e973c96 11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
1fdd39d3 15\r
16#include "MiscSubclassDriver.h"\r
17\r
18\r
19/**\r
20 This function makes boot time changes to the contents of the\r
21 MiscBootInformation (Type 32).\r
22\r
23 @param RecordData Pointer to copy of RecordData from the Data Table. \r
24\r
25 @retval EFI_SUCCESS All parameters were valid.\r
26 @retval EFI_UNSUPPORTED Unexpected RecordType value.\r
27 @retval EFI_INVALID_PARAMETER Invalid parameter was found.\r
28\r
29**/\r
30\r
31MISC_SMBIOS_TABLE_FUNCTION(BootInformationStatus)\r
32{\r
33 EFI_STATUS Status;\r
34 EFI_SMBIOS_HANDLE SmbiosHandle;\r
35 SMBIOS_TABLE_TYPE32 *SmbiosRecord;\r
36 EFI_MISC_BOOT_INFORMATION_STATUS* ForType32InputData;\r
37 \r
38 ForType32InputData = (EFI_MISC_BOOT_INFORMATION_STATUS *)RecordData;\r
39\r
40 //\r
41 // First check for invalid parameters.\r
42 //\r
43 if (RecordData == NULL) {\r
44 return EFI_INVALID_PARAMETER;\r
45 }\r
46\r
47 //\r
48 // Two zeros following the last string.\r
49 //\r
50 SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r
51 ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r
52\r
53 SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;\r
54 SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);\r
55 //\r
56 // Make handle chosen by smbios protocol.add automatically.\r
57 //\r
58 SmbiosRecord->Hdr.Handle = 0; \r
59 SmbiosRecord->BootStatus = (UINT8)ForType32InputData->BootInformationStatus;\r
60\r
61 //\r
62 // Now we have got the full smbios record, call smbios protocol to add this record.\r
63 //\r
7ee85aa2
SZ
64 Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
65\r
1fdd39d3 66 FreePool(SmbiosRecord);\r
67 return Status;\r
68}\r