]> git.proxmox.com Git - mirror_edk2.git/commitdiff
PrmPkg/Samples: Remove PrmSampleMemoryAllocationModule
authorMichael Kubacki <michael.kubacki@microsoft.com>
Tue, 17 Nov 2020 18:36:10 +0000 (10:36 -0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 5 Apr 2022 00:42:38 +0000 (00:42 +0000)
Removes PrmSampleMemoryAllocationModule since the module depends
upon the deprecated concept of OS services.

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
PrmPkg/PrmPkg.dsc
PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAllocationModule.c [deleted file]
PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAllocationModule.inf [deleted file]

index 91115830240431a31af70d476213d2ead472eb3a..c6e5a151eecab10e4e234be8f3b3b8e9c52d017e 100644 (file)
   #\r
   $(PLATFORM_PACKAGE)/Application/PrmInfo/PrmInfo.inf\r
 \r
-  #\r
-  # The SampleMemoryAllocationModule was used during a time in the POC when the OS\r
-  # provided memory allocation services. This module was successful in using those services.\r
-  # Since OS services have been removed (aside from debug prints), this module is no longer\r
-  # relevant but kept around for archival purposes.\r
-  #\r
-  #$(PLATFORM_PACKAGE)/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAllocationModule.inf\r
-\r
 [BuildOptions]\r
 # Force deprecated interfaces off\r
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES\r
diff --git a/PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAllocationModule.c b/PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAllocationModule.c
deleted file mode 100644 (file)
index f124566..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/** @file\r
-\r
-  A sample PRM Module implementation. This PRM Module provides 3 PRM handlers that simply take a DEBUG print\r
-  function from the OS and invoke it with a debug message internal the PRM handler.\r
-\r
-  Copyright (c) Microsoft Corporation\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include <PrmModule.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/UefiLib.h>\r
-\r
-//\r
-// PRM Handler GUIDs\r
-//\r
-\r
-// {149a5cb3-6a9c-403f-940a-156abf63938a}\r
-#define PRM_HANDLER_1_GUID {0x149a5cb3, 0x6a9c, 0x403f, {0x94, 0x0a, 0x15, 0x6a, 0xbf, 0x63, 0x93, 0x8a}}\r
-\r
-// Note: If the signature size is modified, the PRM Handler test code in this module needs to be updated.\r
-#define MEMORY_ALLOCATION_TEST_DATA_SIGNATURE     SIGNATURE_32('T','E','S','T')\r
-#define MEMORY_ALLOCATION_TEST_DATA_SIZE          sizeof(UINT32)\r
-#define MEMORY_ALLOCATION_TEST_DATA_BUFFER_SIZE   256\r
-\r
-/**\r
-  A sample Platform Runtime Mechanism (PRM) handler.\r
-\r
-  This sample handler currently uses the OS_SERVICES to write a debug message\r
-  indicating this is PRM handler 1.\r
-\r
-  @param[in]  ParameterBuffer    A pointer to the PRM handler parameter buffer\r
-  @param[in]  ContextBuffer      A pointer to the PRM handler context buffer\r
-\r
-  @retval EFI_STATUS              The PRM handler executed successfully.\r
-  @retval Others                  An error occurred in the PRM handler.\r
-\r
-**/\r
-EFI_STATUS\r
-PRM_EXPORT_API\r
-EFIAPI\r
-PrmHandler1 (\r
-  IN VOID                         *ParameterBuffer,\r
-  IN PRM_CONTEXT_BUFFER           *ContextBUffer\r
-  )\r
-{\r
-  EFI_STATUS                      Status;\r
-  UINTN                           Index;\r
-  VOID                            *NonPagedPool;\r
-  CHAR8                           DebugMessage[256];\r
-\r
-  if (OsServices == NULL || OsServices->DebugPrint == NULL || OsServices->AllocateMemory == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OsServices->DebugPrint ("Memory Allocation PrmHandler1 entry.\n");\r
-  OsServices->DebugPrint ("  Requesting allocation of a 256 byte non-paged pool...\n");\r
-\r
-  NonPagedPool = NULL;\r
-  NonPagedPool = OsServices->AllocateMemory (MEMORY_ALLOCATION_TEST_DATA_BUFFER_SIZE, FALSE);\r
-  if (NonPagedPool == NULL) {\r
-    OsServices->DebugPrint ("  NULL was returned from AllocateMemory()...\n");\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  AsciiSPrint (\r
-    &DebugMessage[0],\r
-    ARRAY_SIZE (DebugMessage),\r
-    "  Buffer address returned from AllocateMemory() = 0x%016lx.\n",\r
-    (UINTN) NonPagedPool\r
-    );\r
-  OsServices->DebugPrint (&DebugMessage[0]);\r
-\r
-  // Write the test data\r
-  OsServices->DebugPrint ("  Beginning memory buffer write and read back test...\n");\r
-  SetMem32 (NonPagedPool, MEMORY_ALLOCATION_TEST_DATA_BUFFER_SIZE, MEMORY_ALLOCATION_TEST_DATA_SIGNATURE);\r
-\r
-  // Read back and verify the test data is valid\r
-  for (Index = 0, Status = EFI_SUCCESS; Index < (MEMORY_ALLOCATION_TEST_DATA_BUFFER_SIZE / MEMORY_ALLOCATION_TEST_DATA_SIZE); Index++) {\r
-    if (((UINT32 *) NonPagedPool)[Index] != MEMORY_ALLOCATION_TEST_DATA_SIGNATURE) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      break;\r
-    }\r
-  }\r
-  if (EFI_ERROR (Status)) {\r
-    OsServices->DebugPrint ("    Memory write & read test failed.\n");\r
-  } else {\r
-    OsServices->DebugPrint ("    Memory write & read test passed.\n");\r
-  }\r
-\r
-  OsServices->DebugPrint ("Memory Allocation PrmHandler1 exit.\n");\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-//\r
-// Register the PRM export information for this PRM Module\r
-//\r
-PRM_MODULE_EXPORT (\r
-  PRM_HANDLER_EXPORT_ENTRY (PRM_HANDLER_1_GUID, PrmHandler1)\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PrmSampleMemoryAllocationModuleInit (\r
-  IN  EFI_HANDLE                  ImageHandle,\r
-  IN  EFI_SYSTEM_TABLE            *SystemTable\r
-  )\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAllocationModule.inf b/PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAllocationModule.inf
deleted file mode 100644 (file)
index 06be8f4..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-## @file\r
-#  Sample PRM Driver\r
-#\r
-#  This driver simply uses an OS-provided debug message print service to write\r
-#  a debug message. Three PRM handlers are provided that each print a unique\r
-#  debug message.\r
-#\r
-#  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
-#  Copyright (c) Microsoft Corporation\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PrmSampleMemoryAllocationModule\r
-  FILE_GUID                      = C6B3E74A-12E3-4364-8FB4-8C8B34DD153B\r
-  MODULE_TYPE                    = DXE_RUNTIME_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = PrmSampleMemoryAllocationModuleInit\r
-\r
-[Sources]\r
-  PrmSampleMemoryAllocationModule.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  PrmPkg/PrmPkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  BaseMemoryLib\r
-  PrintLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-\r
-[Depex]\r
-  TRUE\r
-\r
-[BuildOptions.common]\r
-  MSFT:*_*_*_DLINK_FLAGS  = /DLL /SUBSYSTEM:CONSOLE /VERSION:1.0\r
-  MSFT:*_*_*_GENFW_FLAGS = --keepoptionalheader\r