Skip to content

Conversation

@ghbaccount
Copy link
Contributor

I'm using GCC version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.2) and it fails to compile this code with the following errors:

edk2-platforms/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Dxe/GenericElog.c: In function ‘InitializeElogLayer’:
edk2-platforms/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Dxe/GenericElog.c:500:35: error: assignment to ‘EFI_ACTIVATE_ELOG’ {aka ‘long long unsigned int (__attribute__((ms_abi)) *)(struct _EFI_SM_ELOG_PROTOCOL *, EFI_SM_ELOG_TYPE,  unsigned char *, unsigned char *)’} from incompatible pointer type ‘EFI_STATUS (*)(EFI_SM_ELOG_PROTOCOL *, EFI_SM_ELOG_TYPE,  BOOLEAN *, BOOLEAN *)’ {aka ‘long long unsigned int (*)(struct _EFI_SM_ELOG_PROTOCOL *, EFI_SM_ELOG_TYPE,  unsigned char *, unsigned char *)’} [-Werror=incompatible-pointer-types]
  500 |   ElogProtocol->ActivateEventLog  = EfiActivateElog;
      |                                   ^
edk2-platforms/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Dxe/GenericElog.c:501:35: error: assignment to ‘EFI_ERASE_ELOG_DATA’ {aka ‘long long unsigned int (__attribute__((ms_abi)) *)(struct _EFI_SM_ELOG_PROTOCOL *, EFI_SM_ELOG_TYPE,  long long unsigned int *)’} from incompatible pointer type ‘EFI_STATUS (*)(EFI_SM_ELOG_PROTOCOL *, EFI_SM_ELOG_TYPE,  UINT64 *)’ {aka ‘long long unsigned int (*)(struct _EFI_SM_ELOG_PROTOCOL *, EFI_SM_ELOG_TYPE,  long long unsigned int *)’} [-Werror=incompatible-pointer-types]
  501 |   ElogProtocol->EraseEventlogData = EfiEraseElogData;

The second patch is intended to avoid assert when trying to use SSIF library for SMM when no gEfiSmbusHcProtocolGuid for SMM installed.

if gMmst->MmLocateHandle() fails with Status not equal
to EFI_BUFFER_TOO_SMALL then NULL check is not performed
but `FreePool (HandleBuffer)` is called later.

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
Add missing EFIAPI to implementation of EFI_SM_ELOG_REDIR_PROTOCOL
functions to bypass GCC build errors.

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
@ghbaccount ghbaccount changed the title Ipmi feature pkg fix efiapi elog IpmiFeaturePkg: fix missed EFIAPI Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants