Hi Nhi,

These change look good to me.

Reviewed-by: Sami Mujawar <sami.muja...@arm.com>

Regards,

Sami Mujawar

On 23/08/2022 11:59 am, Nhi Pham wrote:
This adds an API to OemMiscLib for fetching the system UUID according to
the platform.

Signed-off-by: Nhi Pham <n...@os.amperecomputing.com>
---
  ArmPkg/Include/Library/OemMiscLib.h                                           
| 12 ++++++++++++
  ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c                           
| 18 ++++++++++++++++++
  ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c 
|  3 ++-
  3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Include/Library/OemMiscLib.h 
b/ArmPkg/Include/Library/OemMiscLib.h
index 330bb4b014de..d87737db9c2b 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 98970407a65e..32f6d55c1a9a 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/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c 
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
index 5cf72644d0b2..22fb5eccaa63 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);



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92709): https://edk2.groups.io/g/devel/message/92709
Mute This Topic: https://groups.io/mt/93201506/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to