From 1e103ef9b2ad7c79ef3867a4e7bd83890cdd09fb Mon Sep 17 00:00:00 2001 From: Chris Fernald Date: Tue, 19 Sep 2023 10:54:18 -0700 Subject: [PATCH 1/3] Change IpmiBaseLibNull to BASE library type --- IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c | 4 +--- IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c b/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c index 8c6c8d1..9839c93 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c @@ -6,12 +6,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ +#include #include -#include -#include #include #include -#include /** Sends a IPMI command to the BMC and returns the response. diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf b/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf index 52f8863..d674b9f 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf +++ b/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf @@ -2,6 +2,7 @@ # # @copyright # Copyright 2011 - 2021 Intel Corporation.
+# Copyright (c) Microsoft Corporation # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -9,9 +10,9 @@ INF_VERSION = 0x00010005 BASE_NAME = IpmiBaseLibNull FILE_GUID = 3444CF4F-8B88-4579-9A95-2E7678C0E945 - MODULE_TYPE = DXE_SMM_DRIVER + MODULE_TYPE = BASE VERSION_STRING = 1.0 - LIBRARY_CLASS = IpmiBaseLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER SMM_CORE + LIBRARY_CLASS = IpmiBaseLib # # The following information is for reference only and not required by the build tools. @@ -28,8 +29,6 @@ [LibraryClasses] BaseLib - UefiBootServicesTableLib - DxeServicesLib DebugLib [Guids] From c2fef0a31e3e87b6959b8469d4f38755f9029d8a Mon Sep 17 00:00:00 2001 From: Chris Fernald Date: Tue, 19 Sep 2023 11:39:57 -0700 Subject: [PATCH 2/3] add missing EFIAPI --- IpmiFeaturePkg/Include/Library/IpmiBaseLib.h | 2 ++ IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c | 2 ++ IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c | 2 ++ IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c | 2 ++ IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c | 2 ++ IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c | 2 ++ 6 files changed, 12 insertions(+) diff --git a/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h b/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h index 03227fa..e7f8ffe 100644 --- a/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h +++ b/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h @@ -29,6 +29,7 @@ @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS IpmiSubmitCommand ( IN UINT8 NetFunction, @@ -48,6 +49,7 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS GetBmcStatus ( OUT BMC_STATUS *BmcStatus, diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c b/IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c index 19f6d72..e2d94e3 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c @@ -27,6 +27,7 @@ STATIC IPMI_TRANSPORT *mIpmiTransport = NULL; @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS IpmiSubmitCommand ( IN UINT8 NetFunction, @@ -69,6 +70,7 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS GetBmcStatus ( OUT BMC_STATUS *BmcStatus, diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c b/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c index 9839c93..6dbf36d 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c @@ -25,6 +25,7 @@ @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS IpmiSubmitCommand ( IN UINT8 NetFunction, @@ -47,6 +48,7 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS GetBmcStatus ( OUT BMC_STATUS *BmcStatus, diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c b/IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c index 880d4b8..5fbeee2 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c @@ -26,6 +26,7 @@ @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS IpmiSubmitCommand ( IN UINT8 NetFunction, @@ -67,6 +68,7 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS GetBmcStatus ( OUT BMC_STATUS *BmcStatus, diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c b/IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c index c00dc72..ed50c87 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c @@ -29,6 +29,7 @@ STATIC IPMI_TRANSPORT *mIpmiTransport = NULL; @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS IpmiSubmitCommand ( IN UINT8 NetFunction, @@ -71,6 +72,7 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS GetBmcStatus ( OUT BMC_STATUS *BmcStatus, diff --git a/IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c b/IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c index f5c716d..fcb6689 100644 --- a/IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c +++ b/IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c @@ -28,6 +28,7 @@ STATIC UINT8 ResponseBuffer[MOCK_BASE_IPMI_BUFFER_SIZE]; @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS IpmiSubmitCommand ( IN UINT8 NetFunction, @@ -81,6 +82,7 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ +EFIAPI EFI_STATUS GetBmcStatus ( OUT BMC_STATUS *BmcStatus, From 9ad2fd4806d2b6926b5d0ea8f479b2ba21df98ea Mon Sep 17 00:00:00 2001 From: Chris Fernald Date: Tue, 19 Sep 2023 16:29:54 -0700 Subject: [PATCH 3/3] Whoops.. --- IpmiFeaturePkg/Include/Library/IpmiBaseLib.h | 4 ++-- IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c | 4 ++-- IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c | 4 ++-- IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c | 4 ++-- IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c | 4 ++-- IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h b/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h index e7f8ffe..2826d66 100644 --- a/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h +++ b/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h @@ -29,8 +29,8 @@ @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI IpmiSubmitCommand ( IN UINT8 NetFunction, IN UINT8 Command, @@ -49,8 +49,8 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI GetBmcStatus ( OUT BMC_STATUS *BmcStatus, OUT SM_COM_ADDRESS *ComAddress diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c b/IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c index e2d94e3..ccf87d9 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c @@ -27,8 +27,8 @@ STATIC IPMI_TRANSPORT *mIpmiTransport = NULL; @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI IpmiSubmitCommand ( IN UINT8 NetFunction, IN UINT8 Command, @@ -70,8 +70,8 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI GetBmcStatus ( OUT BMC_STATUS *BmcStatus, OUT SM_COM_ADDRESS *ComAddress diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c b/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c index 6dbf36d..19cb7b3 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c @@ -25,8 +25,8 @@ @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI IpmiSubmitCommand ( IN UINT8 NetFunction, IN UINT8 Command, @@ -48,8 +48,8 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI GetBmcStatus ( OUT BMC_STATUS *BmcStatus, OUT SM_COM_ADDRESS *ComAddress diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c b/IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c index 5fbeee2..1e9d01a 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c @@ -26,8 +26,8 @@ @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI IpmiSubmitCommand ( IN UINT8 NetFunction, IN UINT8 Command, @@ -68,8 +68,8 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI GetBmcStatus ( OUT BMC_STATUS *BmcStatus, OUT SM_COM_ADDRESS *ComAddress diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c b/IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c index ed50c87..6680a96 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c @@ -29,8 +29,8 @@ STATIC IPMI_TRANSPORT *mIpmiTransport = NULL; @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI IpmiSubmitCommand ( IN UINT8 NetFunction, IN UINT8 Command, @@ -72,8 +72,8 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI GetBmcStatus ( OUT BMC_STATUS *BmcStatus, OUT SM_COM_ADDRESS *ComAddress diff --git a/IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c b/IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c index fcb6689..0f5aa1c 100644 --- a/IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c +++ b/IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c @@ -28,8 +28,8 @@ STATIC UINT8 ResponseBuffer[MOCK_BASE_IPMI_BUFFER_SIZE]; @retval EFI_SUCCESS Successfully send IPMI command. @retval EFI_NOT_FOUND Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI IpmiSubmitCommand ( IN UINT8 NetFunction, IN UINT8 Command, @@ -82,8 +82,8 @@ IpmiSubmitCommand ( @retval EFI_SUCCESS Successfully retrieved BMC status @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. **/ -EFIAPI EFI_STATUS +EFIAPI GetBmcStatus ( OUT BMC_STATUS *BmcStatus, OUT SM_COM_ADDRESS *ComAddress