]>
Commit | Line | Data |
---|---|---|
949f388f | 1 | /** @file\r |
2 | boot information boot time changes.\r | |
3 | SMBIOS type 32.\r | |
4 | \r | |
2bfd90f9 | 5 | Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r |
e3ba31da | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
949f388f | 7 | \r |
8 | **/\r | |
9 | \r | |
10 | #include "MiscSubClassDriver.h"\r | |
11 | \r | |
12 | \r | |
13 | /**\r | |
14 | This function makes boot time changes to the contents of the\r | |
15 | MiscBootInformation (Type 32).\r | |
16 | \r | |
d18d8a1d | 17 | @param RecordData Pointer to copy of RecordData from the Data Table.\r |
949f388f | 18 | \r |
19 | @retval EFI_SUCCESS All parameters were valid.\r | |
20 | @retval EFI_UNSUPPORTED Unexpected RecordType value.\r | |
21 | @retval EFI_INVALID_PARAMETER Invalid parameter was found.\r | |
22 | \r | |
23 | **/\r | |
24 | \r | |
25 | MISC_SMBIOS_TABLE_FUNCTION(BootInformationStatus)\r | |
26 | {\r | |
27 | EFI_STATUS Status;\r | |
28 | EFI_SMBIOS_HANDLE SmbiosHandle;\r | |
29 | SMBIOS_TABLE_TYPE32 *SmbiosRecord;\r | |
30 | EFI_MISC_BOOT_INFORMATION_STATUS* ForType32InputData;\r | |
d18d8a1d | 31 | \r |
949f388f | 32 | ForType32InputData = (EFI_MISC_BOOT_INFORMATION_STATUS *)RecordData;\r |
33 | \r | |
34 | //\r | |
35 | // First check for invalid parameters.\r | |
36 | //\r | |
37 | if (RecordData == NULL) {\r | |
38 | return EFI_INVALID_PARAMETER;\r | |
39 | }\r | |
40 | \r | |
41 | //\r | |
42 | // Two zeros following the last string.\r | |
43 | //\r | |
44 | SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r | |
45 | ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r | |
46 | \r | |
47 | SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;\r | |
48 | SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);\r | |
49 | //\r | |
50 | // Make handle chosen by smbios protocol.add automatically.\r | |
51 | //\r | |
d18d8a1d | 52 | SmbiosRecord->Hdr.Handle = 0;\r |
949f388f | 53 | SmbiosRecord->BootStatus = (UINT8)ForType32InputData->BootInformationStatus;\r |
54 | \r | |
55 | //\r | |
56 | // Now we have got the full smbios record, call smbios protocol to add this record.\r | |
57 | //\r | |
2bfd90f9 SZ |
58 | Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r |
59 | \r | |
949f388f | 60 | FreePool(SmbiosRecord);\r |
61 | return Status;\r | |
62 | }\r |