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