1 /** @file
2 boot information boot time changes.
3 SMBIOS type 32.
4
5 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
6 Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
7 Copyright (c) 2015, Linaro Limited. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 Based on files under Nt32Pkg/MiscSubClassPlatformDxe/
17 **/
18 /* Modify list
19 DATA AUTHOR REASON
20 */
21
22 #include "SmbiosMisc.h"
23
24 /**
25 This function makes boot time changes to the contents of the
26 MiscBootInformation (Type 32).
27
28 @param RecordData Pointer to copy of RecordData from the Data Table.
29
30 @retval EFI_SUCCESS All parameters were valid.
31 @retval EFI_UNSUPPORTED Unexpected RecordType value.
32 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
33
34 **/
35
MISC_SMBIOS_TABLE_FUNCTION(MiscBootInformation)36 MISC_SMBIOS_TABLE_FUNCTION(MiscBootInformation)
37 {
38 EFI_STATUS Status;
39 EFI_SMBIOS_HANDLE SmbiosHandle;
40 SMBIOS_TABLE_TYPE32 *SmbiosRecord;
41 SMBIOS_TABLE_TYPE32 *InputData;
42
43 //
44 // First check for invalid parameters.
45 //
46 if (RecordData == NULL) {
47 return EFI_INVALID_PARAMETER;
48 }
49
50 InputData = (SMBIOS_TABLE_TYPE32 *)RecordData;
51
52 //
53 // Two zeros following the last string.
54 //
55 SmbiosRecord = AllocateZeroPool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);
56 if(NULL == SmbiosRecord) {
57 return EFI_OUT_OF_RESOURCES;
58 }
59
60 (VOID)CopyMem(SmbiosRecord, InputData, sizeof (SMBIOS_TABLE_TYPE32));
61
62 SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);
63
64 //
65 // Now we have got the full smbios record, call smbios protocol to add this record.
66 //
67 Status = LogSmbiosData( (UINT8*)SmbiosRecord, &SmbiosHandle);
68 if(EFI_ERROR(Status)) {
69 DEBUG((EFI_D_ERROR, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n", __FUNCTION__, __LINE__, Status));
70 }
71
72 FreePool(SmbiosRecord);
73 return Status;
74 }
75