]>
Commit | Line | Data |
---|---|---|
5e973c96 | 1 | /** @file\r |
1fdd39d3 | 2 | boot information boot time changes.\r |
3 | SMBIOS type 32.\r | |
5e973c96 | 4 | \r |
7ee85aa2 | 5 | Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r |
9d2eedba | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
5e973c96 | 7 | \r |
8 | **/\r | |
1fdd39d3 | 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 | |
17 | @param RecordData Pointer to copy of RecordData from the Data Table. \r | |
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 | |
31 | \r | |
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 | |
52 | SmbiosRecord->Hdr.Handle = 0; \r | |
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 | |
7ee85aa2 SZ |
58 | Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r |
59 | \r | |
1fdd39d3 | 60 | FreePool(SmbiosRecord);\r |
61 | return Status;\r | |
62 | }\r |