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