From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.12311.1647966208934039129 for ; Tue, 22 Mar 2022 09:23:29 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=J82sPiTx; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [47.202.59.224]) by linux.microsoft.com (Postfix) with ESMTPSA id A0F2E20B4783; Tue, 22 Mar 2022 09:23:27 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A0F2E20B4783 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1647966208; bh=rNqblEm/yWwRDS2u2yJ8Sd+depR6OuAp0hxQ9pxdPUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J82sPiTxZ45FNlKi3NKQRxDkbHRTl9Y12rO04IjJhRcn9oEh2TyShCXa947rCwjOw NUfK3N6AA+dVeuVG2TVYK6GtizdLOEJsGyhrpZFYT/Hq37VzsljOqYVTcvTAE2RDtJ LDqg6yjssR7mIbixRP8lvHT6/1PwOP2TsF6Ih6NE= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Andrew Fish , Kang Gao , Michael D Kinney , Michael Kubacki , Leif Lindholm , Benjamin You , Liu Yun , Ankit Sinha , Nate DeSimone Subject: [PATCH v1 36/41] PrmPkg/Samples: Remove PrmSampleMemoryAllocationModule Date: Tue, 22 Mar 2022 12:19:42 -0400 Message-Id: <20220322161947.9319-37-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20220322161947.9319-1-mikuback@linux.microsoft.com> References: <20220322161947.9319-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki Removes PrmSampleMemoryAllocationModule since the module depends upon the deprecated concept of OS services. Cc: Andrew Fish Cc: Kang Gao Cc: Michael D Kinney Cc: Michael Kubacki Cc: Leif Lindholm Cc: Benjamin You Cc: Liu Yun Cc: Ankit Sinha Cc: Nate DeSimone Signed-off-by: Michael Kubacki --- PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAllocation= Module.c | 115 -------------------- PrmPkg/PrmPkg.dsc = | 8 -- PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAllocation= Module.inf | 43 -------- 3 files changed, 166 deletions(-) diff --git a/PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemo= ryAllocationModule.c b/PrmPkg/Samples/PrmSampleMemoryAllocationModule/Prm= SampleMemoryAllocationModule.c deleted file mode 100644 index f1245664ab9c..000000000000 --- a/PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAlloc= ationModule.c +++ /dev/null @@ -1,115 +0,0 @@ -/** @file - - A sample PRM Module implementation. This PRM Module provides 3 PRM han= dlers that simply take a DEBUG print - function from the OS and invoke it with a debug message internal the P= RM handler. - - Copyright (c) Microsoft Corporation - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include - -#include -#include -#include -#include - -// -// PRM Handler GUIDs -// - -// {149a5cb3-6a9c-403f-940a-156abf63938a} -#define PRM_HANDLER_1_GUID {0x149a5cb3, 0x6a9c, 0x403f, {0x94, 0x0a, 0x1= 5, 0x6a, 0xbf, 0x63, 0x93, 0x8a}} - -// Note: If the signature size is modified, the PRM Handler test code in= this module needs to be updated. -#define MEMORY_ALLOCATION_TEST_DATA_SIGNATURE SIGNATURE_32('T','E','= S','T') -#define MEMORY_ALLOCATION_TEST_DATA_SIZE sizeof(UINT32) -#define MEMORY_ALLOCATION_TEST_DATA_BUFFER_SIZE 256 - -/** - A sample Platform Runtime Mechanism (PRM) handler. - - This sample handler currently uses the OS_SERVICES to write a debug me= ssage - indicating this is PRM handler 1. - - @param[in] ParameterBuffer A pointer to the PRM handler parameter = buffer - @param[in] ContextBuffer A pointer to the PRM handler context bu= ffer - - @retval EFI_STATUS The PRM handler executed successfully. - @retval Others An error occurred in the PRM handler. - -**/ -EFI_STATUS -PRM_EXPORT_API -EFIAPI -PrmHandler1 ( - IN VOID *ParameterBuffer, - IN PRM_CONTEXT_BUFFER *ContextBUffer - ) -{ - EFI_STATUS Status; - UINTN Index; - VOID *NonPagedPool; - CHAR8 DebugMessage[256]; - - if (OsServices =3D=3D NULL || OsServices->DebugPrint =3D=3D NULL || Os= Services->AllocateMemory =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - OsServices->DebugPrint ("Memory Allocation PrmHandler1 entry.\n"); - OsServices->DebugPrint (" Requesting allocation of a 256 byte non-pag= ed pool...\n"); - - NonPagedPool =3D NULL; - NonPagedPool =3D OsServices->AllocateMemory (MEMORY_ALLOCATION_TEST_DA= TA_BUFFER_SIZE, FALSE); - if (NonPagedPool =3D=3D NULL) { - OsServices->DebugPrint (" NULL was returned from AllocateMemory()..= .\n"); - return EFI_OUT_OF_RESOURCES; - } - - AsciiSPrint ( - &DebugMessage[0], - ARRAY_SIZE (DebugMessage), - " Buffer address returned from AllocateMemory() =3D 0x%016lx.\n", - (UINTN) NonPagedPool - ); - OsServices->DebugPrint (&DebugMessage[0]); - - // Write the test data - OsServices->DebugPrint (" Beginning memory buffer write and read back= test...\n"); - SetMem32 (NonPagedPool, MEMORY_ALLOCATION_TEST_DATA_BUFFER_SIZE, MEMOR= Y_ALLOCATION_TEST_DATA_SIGNATURE); - - // Read back and verify the test data is valid - for (Index =3D 0, Status =3D EFI_SUCCESS; Index < (MEMORY_ALLOCATION_T= EST_DATA_BUFFER_SIZE / MEMORY_ALLOCATION_TEST_DATA_SIZE); Index++) { - if (((UINT32 *) NonPagedPool)[Index] !=3D MEMORY_ALLOCATION_TEST_DAT= A_SIGNATURE) { - Status =3D EFI_DEVICE_ERROR; - break; - } - } - if (EFI_ERROR (Status)) { - OsServices->DebugPrint (" Memory write & read test failed.\n"); - } else { - OsServices->DebugPrint (" Memory write & read test passed.\n"); - } - - OsServices->DebugPrint ("Memory Allocation PrmHandler1 exit.\n"); - - return EFI_SUCCESS; -} - -// -// Register the PRM export information for this PRM Module -// -PRM_MODULE_EXPORT ( - PRM_HANDLER_EXPORT_ENTRY (PRM_HANDLER_1_GUID, PrmHandler1) - ); - -EFI_STATUS -EFIAPI -PrmSampleMemoryAllocationModuleInit ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - return EFI_SUCCESS; -} diff --git a/PrmPkg/PrmPkg.dsc b/PrmPkg/PrmPkg.dsc index 911158302404..c6e5a151eeca 100644 --- a/PrmPkg/PrmPkg.dsc +++ b/PrmPkg/PrmPkg.dsc @@ -141,14 +141,6 @@ [Components] # $(PLATFORM_PACKAGE)/Application/PrmInfo/PrmInfo.inf =20 - # - # The SampleMemoryAllocationModule was used during a time in the POC w= hen the OS - # provided memory allocation services. This module was successful in u= sing those services. - # Since OS services have been removed (aside from debug prints), this = module is no longer - # relevant but kept around for archival purposes. - # - #$(PLATFORM_PACKAGE)/Samples/PrmSampleMemoryAllocationModule/PrmSample= MemoryAllocationModule.inf - [BuildOptions] # Force deprecated interfaces off *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES diff --git a/PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemo= ryAllocationModule.inf b/PrmPkg/Samples/PrmSampleMemoryAllocationModule/P= rmSampleMemoryAllocationModule.inf deleted file mode 100644 index 06be8f40f4ec..000000000000 --- a/PrmPkg/Samples/PrmSampleMemoryAllocationModule/PrmSampleMemoryAlloc= ationModule.inf +++ /dev/null @@ -1,43 +0,0 @@ -## @file -# Sample PRM Driver -# -# This driver simply uses an OS-provided debug message print service to= write -# a debug message. Three PRM handlers are provided that each print a un= ique -# debug message. -# -# Copyright (c) 2020, Intel Corporation. All rights reserved.
-# Copyright (c) Microsoft Corporation -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D PrmSampleMemoryAllocationModule - FILE_GUID =3D C6B3E74A-12E3-4364-8FB4-8C8B34DD153= B - MODULE_TYPE =3D DXE_RUNTIME_DRIVER - VERSION_STRING =3D 1.0 - ENTRY_POINT =3D PrmSampleMemoryAllocationModuleInit - -[Sources] - PrmSampleMemoryAllocationModule.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - PrmPkg/PrmPkg.dec - -[LibraryClasses] - BaseLib - BaseMemoryLib - PrintLib - UefiDriverEntryPoint - UefiLib - -[Depex] - TRUE - -[BuildOptions.common] - MSFT:*_*_*_DLINK_FLAGS =3D /DLL /SUBSYSTEM:CONSOLE /VERSION:1.0 - MSFT:*_*_*_GENFW_FLAGS =3D --keepoptionalheader --=20 2.28.0.windows.1