]> git.proxmox.com Git - mirror_edk2.git/blame - EmulatorPkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c
EmulatorPkg: Remove all trailing whitespace
[mirror_edk2.git] / EmulatorPkg / MiscSubClassPlatformDxe / MiscBootInformationFunction.c
CommitLineData
949f388f 1/** @file\r
2 boot information boot time changes.\r
3 SMBIOS type 32.\r
4\r
5 Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
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
d18d8a1d 23 @param RecordData Pointer to copy of RecordData from the Data Table.\r
949f388f 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
d18d8a1d 37\r
949f388f 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
d18d8a1d 58 SmbiosRecord->Hdr.Handle = 0;\r
949f388f 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
64 SmbiosHandle = 0;\r
65 Status = Smbios-> Add(\r
d18d8a1d 66 Smbios,\r
949f388f 67 NULL,\r
d18d8a1d 68 &SmbiosHandle,\r
949f388f 69 (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r
70 );\r
71 FreePool(SmbiosRecord);\r
72 return Status;\r
73}\r