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