summaryrefslogtreecommitdiff
path: root/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type32BootInformationFunction.c
diff options
context:
space:
mode:
authorJiewen Yao <jiewen.yao@intel.com>2018-02-15 21:59:42 +0800
committerJiewen Yao <jiewen.yao@intel.com>2018-03-02 08:36:15 +0800
commitc34762c8cf9323a8613609c116f3c78efad423b2 (patch)
treed242366239e8b7507d4fa32daf640bf44a61d477 /Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type32BootInformationFunction.c
parent78b62d1a0c3fc425107b85d8c97404a80609f752 (diff)
downloadedk2-platforms-c34762c8cf9323a8613609c116f3c78efad423b2.tar.xz
Add AdvancedFeaturePkg. We can put open source advanced feature here.
Cc: Michael A Kubacki <michael.a.kubacki@intel.com> Cc: Amy Chan <amy.chan@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Cc: Isaac W Oram <isaac.w.oram@intel.com> Cc: Brett Wang <brett.wang@intel.com> Cc: Daocheng Bu <daocheng.bu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type32BootInformationFunction.c')
-rw-r--r--Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type32BootInformationFunction.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type32BootInformationFunction.c b/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type32BootInformationFunction.c
new file mode 100644
index 0000000000..60c70e24d8
--- /dev/null
+++ b/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type32BootInformationFunction.c
@@ -0,0 +1,61 @@
+/**
+ Copyright (c) 1999 - 2016 Intel Corporation. All rights reserved.
+ This software and associated documentation (if any) is furnished
+ under a license and may only be used or copied in accordance
+ with the terms of the license. Except as permitted by such
+ license, no part of this software or documentation may be
+ reproduced, stored in a retrieval system, or transmitted in any
+ form or by any means without the express written consent of
+ Intel Corporation.
+
+**/
+
+
+#include "SmbiosBasic.h"
+
+
+/**
+ This function makes boot time changes to the contents of the
+ BootInformation (Type 32).
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+EFI_STATUS
+EFIAPI
+BootInfoStatusFunction(
+ IN EFI_SMBIOS_PROTOCOL *Smbios
+ )
+{
+ EFI_STATUS Status;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE32 *PcdSmbiosRecord;
+ SMBIOS_TABLE_TYPE32 *SmbiosRecord;
+
+ PcdSmbiosRecord = PcdGetPtr (PcdSmbiosType32SystemBootInformation);
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocateZeroPool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ CopyMem (SmbiosRecord, PcdSmbiosRecord, sizeof(SMBIOS_TABLE_TYPE32));
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);
+ SmbiosRecord->Hdr.Handle = 0;
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
+
+ FreePool(SmbiosRecord);
+ return Status;
+}