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>
This commit is contained in:
Nhi Pham 2022-09-19 09:19:47 +07:00 committed by mergify[bot]
parent 11b5093ce4
commit 130b649a8b
4 changed files with 36 additions and 1 deletions

View File

@ -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_

View File

@ -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);
}

View File

@ -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

View File

@ -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);