summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorNhi Pham <nhi@os.amperecomputing.com>2022-09-19 09:19:47 +0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-09-23 14:39:10 +0000
commit130b649a8b5fdd8ed8f88816eae7ca38c6e7dfc4 (patch)
tree478c73c0884de3777d254023796978d74b494668 /ArmPkg
parent11b5093ce408bc2ecd7b87711d471296d6d77984 (diff)
downloadedk2-130b649a8b5fdd8ed8f88816eae7ca38c6e7dfc4.tar.gz
edk2-130b649a8b5fdd8ed8f88816eae7ca38c6e7dfc4.tar.bz2
edk2-130b649a8b5fdd8ed8f88816eae7ca38c6e7dfc4.zip
ArmPkg/SmbiosMiscDxe: Support fetching System UUID
This adds an API to OemMiscLib for fetching the system UUID according to the platform. Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Rebecca Cran <rebecca@quicinc.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Include/Library/OemMiscLib.h12
-rw-r--r--ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c18
-rw-r--r--ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf4
-rw-r--r--ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c3
4 files changed, 36 insertions, 1 deletions
diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 330bb4b014..d87737db9c 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -235,4 +235,16 @@ OemGetChassisNumPowerCords (
VOID
);
+/**
+ Fetches the system UUID.
+
+ @param[out] SystemUuid The pointer to the buffer to store the System UUID.
+
+**/
+VOID
+EFIAPI
+OemGetSystemUuid (
+ OUT GUID *SystemUuid
+ );
+
#endif // OEM_MISC_LIB_H_
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index 98970407a6..32f6d55c1a 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -1,6 +1,7 @@
/** @file
* OemMiscLib.c
*
+* Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
* Copyright (c) 2021, NUVIA Inc. All rights reserved.
* Copyright (c) 2018, Hisilicon Limited. All rights reserved.
* Copyright (c) 2018, Linaro Limited. All rights reserved.
@@ -10,6 +11,7 @@
**/
#include <Uefi.h>
+#include <Guid/ZeroGuid.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/HiiLib.h>
@@ -236,3 +238,19 @@ OemGetChassisNumPowerCords (
ASSERT (FALSE);
return 1;
}
+
+/**
+ Fetches the system UUID.
+
+ @param[out] SystemUuid The pointer to the buffer to store the System UUID.
+
+**/
+VOID
+EFIAPI
+OemGetSystemUuid (
+ OUT GUID *SystemUuid
+ )
+{
+ ASSERT (FALSE);
+ CopyGuid (SystemUuid, &gZeroGuid);
+}
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
index 5c4268f68b..8653f57720 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
@@ -1,6 +1,7 @@
#/** @file
# OemMiscLib.inf
#
+# Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
# Copyright (c) 2021, NUVIA Inc. All rights reserved.
# Copyright (c) 2018, Hisilicon Limited. All rights reserved.
# Copyright (c) 2018, Linaro Limited. All rights reserved.
@@ -29,3 +30,6 @@
[LibraryClasses]
BaseMemoryLib
DebugLib
+
+[Guids]
+ gZeroGuid
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
index 5cf72644d0..22fb5eccaa 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
@@ -4,6 +4,7 @@
Based on files under Nt32Pkg/MiscSubClassPlatformDxe/
+ Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
@@ -160,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);
- CopyGuid (&SmbiosRecord->Uuid, &InputData->Uuid);
+ OemGetSystemUuid (&SmbiosRecord->Uuid);
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + 1);