]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Add Universal/Smbios/OemMiscLibNull
authorRebecca Cran <rebecca@nuviainc.com>
Mon, 8 Feb 2021 00:52:45 +0000 (17:52 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 8 Feb 2021 19:35:23 +0000 (19:35 +0000)
Add a Null implementation of OemMiscLib.

OemMiscLib provides functions that platforms implement to fill in
SMBIOS information for the SmbiosMiscDxe and ProcessSubClassDxe drivers.

Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>
Acked-by: Leif Lindholm <leif@nuviainc.com>
ArmPkg/ArmPkg.dsc
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c [new file with mode: 0644]
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf [new file with mode: 0644]

index 48059cf38ed3ef37f7c8ccffcc3f5f585872cc6d..0f77a6da448313f795ccda9dfb6bb1a9cfcdb0e9 100644 (file)
@@ -84,6 +84,8 @@
 \r
   ArmMtlLib|ArmPkg/Library/ArmMtlNullLib/ArmMtlNullLib.inf\r
 \r
+  OemMiscLib|ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf\r
+\r
 [LibraryClasses.common.PEIM]\r
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
new file mode 100644 (file)
index 0000000..767fc08
--- /dev/null
@@ -0,0 +1,144 @@
+/** @file\r
+*  OemMiscLib.c\r
+*\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
+*\r
+*  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+*\r
+**/\r
+\r
+#include <Uefi.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/HiiLib.h>\r
+\r
+#include <Library/OemMiscLib.h>\r
+\r
+\r
+/** Gets the CPU frequency of the specified processor.\r
+\r
+  @param ProcessorIndex Index of the processor to get the frequency for.\r
+\r
+  @return               CPU frequency in Hz\r
+**/\r
+EFIAPI\r
+UINTN\r
+OemGetCpuFreq (\r
+  IN UINT8 ProcessorIndex\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return 0;\r
+}\r
+\r
+/** Gets information about the specified processor and stores it in\r
+    the structures provided.\r
+\r
+  @param ProcessorIndex  Index of the processor to get the information for.\r
+  @param ProcessorStatus Processor status.\r
+  @param ProcessorCharacteristics Processor characteritics.\r
+  @param MiscProcessorData        Miscellaneous processor information.\r
+\r
+  @return  TRUE on success, FALSE on failure.\r
+**/\r
+EFIAPI\r
+BOOLEAN\r
+OemGetProcessorInformation (\r
+  IN UINTN ProcessorIndex,\r
+  IN OUT PROCESSOR_STATUS_DATA *ProcessorStatus,\r
+  IN OUT PROCESSOR_CHARACTERISTIC_FLAGS *ProcessorCharacteristics,\r
+  IN OUT OEM_MISC_PROCESSOR_DATA *MiscProcessorData\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return TRUE;\r
+}\r
+\r
+/** Gets information about the cache at the specified cache level.\r
+\r
+  @param ProcessorIndex The processor to get information for.\r
+  @param CacheLevel The cache level to get information for.\r
+  @param DataCache  Whether the cache is a data cache.\r
+  @param UnifiedCache Whether the cache is a unified cache.\r
+  @param SmbiosCacheTable The SMBIOS Type7 cache information structure.\r
+\r
+  @return TRUE on success, FALSE on failure.\r
+**/\r
+EFIAPI\r
+BOOLEAN\r
+OemGetCacheInformation (\r
+  IN UINT8   ProcessorIndex,\r
+  IN UINT8   CacheLevel,\r
+  IN BOOLEAN DataCache,\r
+  IN BOOLEAN UnifiedCache,\r
+  IN OUT SMBIOS_TABLE_TYPE7 *SmbiosCacheTable\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return TRUE;\r
+}\r
+\r
+/** Gets the maximum number of sockets supported by the platform.\r
+\r
+  @return The maximum number of sockets.\r
+**/\r
+EFIAPI\r
+UINT8\r
+OemGetProcessorMaxSockets (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return 1;\r
+}\r
+\r
+/** Gets the type of chassis for the system.\r
+\r
+  @param ChassisType The type of the chassis.\r
+\r
+  @retval EFI_SUCCESS The chassis type was fetched successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+OemGetChassisType (\r
+  UINT8 *ChassisType\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  *ChassisType = MiscChassisTypeUnknown;\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/** Returns whether the specified processor is present or not.\r
+\r
+  @param ProcessIndex The processor index to check.\r
+\r
+  @return TRUE is the processor is present, FALSE otherwise.\r
+**/\r
+EFIAPI\r
+BOOLEAN\r
+OemIsSocketPresent (\r
+  IN UINTN ProcessorIndex\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/** Updates the HII string for the specified field.\r
+\r
+  @param mHiiHandle    The HII handle.\r
+  @param TokenToUpdate The string to update.\r
+  @param Offset        The field to get information about.\r
+**/\r
+EFIAPI\r
+VOID\r
+OemUpdateSmbiosInfo (\r
+  IN EFI_HII_HANDLE mHiiHandle,\r
+  IN EFI_STRING_ID TokenToUpdate,\r
+  IN OEM_MISC_SMBIOS_HII_STRING_FIELD Offset\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+}\r
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
new file mode 100644 (file)
index 0000000..b21eead
--- /dev/null
@@ -0,0 +1,31 @@
+#/** @file\r
+#    OemMiscLib.inf\r
+#\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
+#\r
+#    SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 1.29\r
+  BASE_NAME                      = OemMiscLibNull\r
+  FILE_GUID                      = e80b8e6b-fffb-4c39-b433-41de67c9d7b8\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = OemMiscLib\r
+\r
+[Sources.common]\r
+  OemMiscLib.c\r
+\r
+[Packages]\r
+  ArmPkg/ArmPkg.dec\r
+  EmbeddedPkg/EmbeddedPkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  MdePkg/MdePkg.dec\r
+\r
+[LibraryClasses]\r
+  BaseMemoryLib\r
+\r