]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/SmbiosMiscDxe: Support fetching System UUID
authorNhi Pham <nhi@os.amperecomputing.com>
Mon, 19 Sep 2022 02:19:47 +0000 (09:19 +0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 23 Sep 2022 14:39:10 +0000 (14:39 +0000)
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>
ArmPkg/Include/Library/OemMiscLib.h
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c

index 330bb4b014de87dacc486df0206cb43963139457..d87737db9c2bf92dfcc77c978c09539e28d97c6c 100644 (file)
@@ -235,4 +235,16 @@ OemGetChassisNumPowerCords (
   VOID\r
   );\r
 \r
+/**\r
+  Fetches the system UUID.\r
+\r
+  @param[out] SystemUuid     The pointer to the buffer to store the System UUID.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+OemGetSystemUuid (\r
+  OUT GUID  *SystemUuid\r
+  );\r
+\r
 #endif // OEM_MISC_LIB_H_\r
index 98970407a65e2f62c2c53e713b06021a5d4269f9..32f6d55c1a9a532e159cacdb3a18eefc16b791e1 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
 *  OemMiscLib.c\r
 *\r
+*  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.\r
 *  Copyright (c) 2021, NUVIA Inc. All rights reserved.\r
 *  Copyright (c) 2018, Hisilicon Limited. All rights reserved.\r
 *  Copyright (c) 2018, Linaro Limited. All rights reserved.\r
@@ -10,6 +11,7 @@
 **/\r
 \r
 #include <Uefi.h>\r
+#include <Guid/ZeroGuid.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/HiiLib.h>\r
@@ -236,3 +238,19 @@ OemGetChassisNumPowerCords (
   ASSERT (FALSE);\r
   return 1;\r
 }\r
+\r
+/**\r
+  Fetches the system UUID.\r
+\r
+  @param[out] SystemUuid     The pointer to the buffer to store the System UUID.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+OemGetSystemUuid (\r
+  OUT GUID  *SystemUuid\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  CopyGuid (SystemUuid, &gZeroGuid);\r
+}\r
index 5c4268f68b4a0d3e326145a50382841993f4a1f5..8653f57720d121bd041b3e51c885f000832ca05c 100644 (file)
@@ -1,6 +1,7 @@
 #/** @file\r
 #    OemMiscLib.inf\r
 #\r
+#    Copyright (c) 2022, Ampere Computing LLC. All rights reserved.\r
 #    Copyright (c) 2021, NUVIA Inc. All rights reserved.\r
 #    Copyright (c) 2018, Hisilicon Limited. All rights reserved.\r
 #    Copyright (c) 2018, Linaro Limited. All rights reserved.\r
@@ -29,3 +30,6 @@
 [LibraryClasses]\r
   BaseMemoryLib\r
   DebugLib\r
+\r
+[Guids]\r
+  gZeroGuid\r
index 5cf72644d0b2f32708559bbcc7a39d2b1779a20d..22fb5eccaa63e5d71656cdbec0b1f6dc48901e53 100644 (file)
@@ -4,6 +4,7 @@
 \r
   Based on files under Nt32Pkg/MiscSubClassPlatformDxe/\r
 \r
+  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>\r
   Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>\r
   Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>\r
@@ -160,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
 \r
   SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);\r
 \r
-  CopyGuid (&SmbiosRecord->Uuid, &InputData->Uuid);\r
+  OemGetSystemUuid (&SmbiosRecord->Uuid);\r
 \r
   OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
   UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + 1);\r