From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.3341.1634333146761283299 for ; Fri, 15 Oct 2021 14:25:48 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: isaac.w.oram@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10138"; a="314187538" X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="314187538" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 14:25:47 -0700 X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="492709810" Received: from iworam-desk.amr.corp.intel.com ([10.7.150.79]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 14:25:44 -0700 From: "Oram, Isaac W" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel][edk2-platforms][PATCH V1 10/11] MinPlatformPkg/SpiFvbService: Reduce duplicate code Date: Fri, 15 Oct 2021 14:25:33 -0700 Message-Id: <9db0b794a840f862b848c99167b83f2633200ed8.1634331939.git.isaac.w.oram@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Consolidate all the entry point functions into SpiFvbServiceMm.c This reduces the number of files and makes the code easier to understand. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Isaac Oram --- Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c | 42 ++++++++++++++++++++ Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf | 1 - Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c | 32 --------------- Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf | 1 - Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c | 32 --------------- 5 files changed, 42 insertions(+), 66 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c index 1d8d55b8f2..cc9310023e 100644 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c @@ -278,3 +278,45 @@ FvbInitialize ( return EFI_SUCCESS; } + +/** + The driver Traditional MM entry point. + + @param[in] ImageHandle Image handle of this driver. + @param[in] SystemTable A pointer to the EFI system table. + + @retval EFI_SUCCESS This function always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +SpiFvbTraditionalMmInitialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + FvbInitialize (); + + return EFI_SUCCESS; +} + +/** + The driver Standalone MM entry point. + + @param[in] ImageHandle Image handle of this driver. + @param[in] MmSystemTable A pointer to the MM system table. + + @retval EFI_SUCCESS This function always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +SpiFvbStandaloneMmInitialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ) +{ + FvbInitialize (); + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf index 7b69bedcdc..600ad32d9f 100644 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf @@ -55,7 +55,6 @@ SpiFvbServiceCommon.c SpiFvbServiceMm.h SpiFvbServiceMm.c - SpiFvbServiceTraditionalMm.c [Protocols] gEfiDevicePathProtocolGuid ## PRODUCES diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c deleted file mode 100644 index 252c818d65..0000000000 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c +++ /dev/null @@ -1,32 +0,0 @@ -/** @file - MM driver source for several Serial Flash devices - which are compliant with the Intel(R) Serial Flash Interface Compatibility Specification. - - Copyright (c) Microsoft Corporation.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "SpiFvbServiceCommon.h" -#include "SpiFvbServiceMm.h" - -/** - The driver Standalone MM entry point. - - @param[in] ImageHandle Image handle of this driver. - @param[in] MmSystemTable A pointer to the MM system table. - - @retval EFI_SUCCESS This function always returns EFI_SUCCESS. - -**/ -EFI_STATUS -EFIAPI -SpiFvbStandaloneMmInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_MM_SYSTEM_TABLE *MmSystemTable - ) -{ - FvbInitialize (); - - return EFI_SUCCESS; -} diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf index 1dfb2520e7..4e056466a1 100644 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf @@ -54,7 +54,6 @@ SpiFvbServiceCommon.c SpiFvbServiceMm.h SpiFvbServiceMm.c - SpiFvbServiceStandaloneMm.c [Protocols] gEfiDevicePathProtocolGuid ## PRODUCES diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c deleted file mode 100644 index 1c2dac70e3..0000000000 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c +++ /dev/null @@ -1,32 +0,0 @@ -/** @file - MM driver source for several Serial Flash devices - which are compliant with the Intel(R) Serial Flash Interface Compatibility Specification. - - Copyright (c) Microsoft Corporation.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "SpiFvbServiceCommon.h" -#include "SpiFvbServiceMm.h" - -/** - The driver Traditional MM entry point. - - @param[in] ImageHandle Image handle of this driver. - @param[in] SystemTable A pointer to the EFI system table. - - @retval EFI_SUCCESS This function always returns EFI_SUCCESS. - -**/ -EFI_STATUS -EFIAPI -SpiFvbTraditionalMmInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - FvbInitialize (); - - return EFI_SUCCESS; -} -- 2.27.0.windows.1