]>
Commit | Line | Data |
---|---|---|
aaa2cc19 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2009, Intel Corporation. All rights reserved. <BR> \r | |
4 | This software and associated documentation (if any) is furnished\r | |
5 | under a license and may only be used or copied in accordance\r | |
6 | with the terms of the license. Except as permitted by such\r | |
7 | license, no part of this software or documentation may be\r | |
8 | reproduced, stored in a retrieval system, or transmitted in any\r | |
9 | form or by any means without the express written consent of\r | |
10 | Intel Corporation.\r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | MiscBootInformationFunction.c\r | |
16 | \r | |
17 | Abstract: \r | |
18 | \r | |
19 | boot information boot time changes.\r | |
20 | SMBIOS type 32.\r | |
21 | \r | |
22 | --*/\r | |
23 | \r | |
24 | #include "MiscSubClassDriver.h"\r | |
25 | \r | |
26 | \r | |
27 | /**\r | |
28 | This function makes boot time changes to the contents of the\r | |
29 | MiscBootInformation (Type 32).\r | |
30 | \r | |
31 | @param RecordData Pointer to copy of RecordData from the Data Table. \r | |
32 | \r | |
33 | @retval EFI_SUCCESS All parameters were valid.\r | |
34 | @retval EFI_UNSUPPORTED Unexpected RecordType value.\r | |
35 | @retval EFI_INVALID_PARAMETER Invalid parameter was found.\r | |
36 | \r | |
37 | **/\r | |
38 | \r | |
39 | MISC_SMBIOS_TABLE_FUNCTION(BootInformationStatus)\r | |
40 | {\r | |
41 | EFI_STATUS Status;\r | |
42 | EFI_SMBIOS_HANDLE SmbiosHandle;\r | |
43 | SMBIOS_TABLE_TYPE32 *SmbiosRecord;\r | |
44 | EFI_MISC_BOOT_INFORMATION_STATUS* ForType32InputData;\r | |
45 | \r | |
46 | ForType32InputData = (EFI_MISC_BOOT_INFORMATION_STATUS *)RecordData;\r | |
47 | \r | |
48 | //\r | |
49 | // First check for invalid parameters.\r | |
50 | //\r | |
51 | if (RecordData == NULL) {\r | |
52 | return EFI_INVALID_PARAMETER;\r | |
53 | }\r | |
54 | \r | |
55 | //\r | |
56 | // Two zeros following the last string.\r | |
57 | //\r | |
58 | SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r | |
59 | ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r | |
60 | \r | |
61 | SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;\r | |
62 | SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);\r | |
63 | //\r | |
64 | // Make handle chosen by smbios protocol.add automatically.\r | |
65 | //\r | |
66 | SmbiosRecord->Hdr.Handle = 0; \r | |
67 | SmbiosRecord->BootStatus = (UINT8)ForType32InputData->BootInformationStatus;\r | |
68 | \r | |
69 | //\r | |
70 | // Now we have got the full smbios record, call smbios protocol to add this record.\r | |
71 | //\r | |
72 | SmbiosHandle = 0;\r | |
73 | Status = Smbios-> Add(\r | |
74 | Smbios, \r | |
75 | NULL,\r | |
76 | &SmbiosHandle, \r | |
77 | (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord\r | |
78 | );\r | |
79 | FreePool(SmbiosRecord);\r | |
80 | return Status;\r | |
81 | }\r |