[edk2-devel] [PATCH 3/5] ArmPkg: Allow platforms to report their boot status via OemMiscLib call

Rebecca Cran rebecca at nuviainc.com
Wed Mar 31 02:16:17 UTC 2021


Add a new function to OemMiscLib to allow platforms to report their boot
status into the Type32 SMBIOS table.

Signed-off-by: Rebecca Cran <rebecca at nuviainc.com>
---
 ArmPkg/Include/Library/OemMiscLib.h                                        | 10 ++++++++++
 ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c                        | 14 ++++++++++++++
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c |  3 +++
 3 files changed, 27 insertions(+)

diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 25ae508ddb03..0b03fe8d4de3 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -162,6 +162,16 @@ OemUpdateSmbiosInfo (
   IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
   );
 
+/** Fetches the Type 32 boot information status.
+
+  @return Boot status.
+**/
+MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
+EFIAPI
+OemGetBootStatus (
+  VOID
+  );
+
 /** Fetches the chassis status when it was last booted.
 
  @return Chassis status.
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index e6a4793fe1c2..74101beab1cb 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -140,6 +140,20 @@ OemUpdateSmbiosInfo (
   ASSERT (FALSE);
 }
 
+/** Fetches the Type 32 boot information status.
+
+  @return Boot status.
+**/
+MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
+EFIAPI
+OemGetBootStatus (
+  VOID
+  )
+{
+  ASSERT (FALSE);
+  return BootInformationStatusNoError;
+}
+
 /** Fetches the chassis status when it was last booted.
 
  @return Chassis status.
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
index 733615bbcf1a..4be1e1cd29a9 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type32/MiscBootInformationFunction.c
@@ -16,6 +16,7 @@
 #include <Library/BaseMemoryLib.h>
 #include <Library/DebugLib.h>
 #include <Library/MemoryAllocationLib.h>
+#include <Library/OemMiscLib.h>
 #include <Library/UefiBootServicesTableLib.h>
 
 #include "SmbiosMisc.h"
@@ -59,6 +60,8 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBootInformation)
 
   SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);
 
+  SmbiosRecord->BootStatus = OemGetBootStatus ();
+
   //
   // Now we have got the full smbios record, call smbios protocol to add this record.
   //
-- 
2.26.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73566): https://edk2.groups.io/g/devel/message/73566
Mute This Topic: https://groups.io/mt/81741555/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list