From 277dd8c1f5cc1689b45c5cd4dfd1b074ae77f7df Mon Sep 17 00:00:00 2001 From: Vlad-Gabriel Serbu Date: Thu, 21 May 2026 11:10:45 +0100 Subject: [PATCH 1/2] ami: use single-argument eventfd_signal on RHEL9.5+ Signed-off-by: Vlad-Gabriel Serbu --- sw/AMI/driver/ami_program.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sw/AMI/driver/ami_program.c b/sw/AMI/driver/ami_program.c index e0265c8..9f53a01 100755 --- a/sw/AMI/driver/ami_program.c +++ b/sw/AMI/driver/ami_program.c @@ -91,7 +91,8 @@ static int do_image_download(struct amc_control_ctxt *amc_ctrl_ctxt, uint8_t *bu break; if (efd_ctx) { - #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) || \ + (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 5)) eventfd_signal(efd_ctx); #else eventfd_signal(efd_ctx, bytes_to_write); @@ -150,7 +151,8 @@ static int do_image_download(struct amc_control_ctxt *amc_ctrl_ctxt, uint8_t *bu buf, (PDI_CHUNK_SIZE * PDI_CHUNK_MULTIPLIER)); if (!ret && efd_ctx) - #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) || \ + (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 5)) eventfd_signal(efd_ctx); #else eventfd_signal(efd_ctx, (PDI_CHUNK_SIZE * PDI_CHUNK_MULTIPLIER)); From 3b4dcc37417d86f942300f4fb9511926026c7fe0 Mon Sep 17 00:00:00 2001 From: Vlad-Gabriel Serbu Date: Tue, 26 May 2026 09:07:46 +0100 Subject: [PATCH 2/2] Fix RHEL eventfd_signal patch for C11 Signed-off-by: Vlad-Gabriel Serbu --- sw/AMI/driver/ami_program.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/sw/AMI/driver/ami_program.c b/sw/AMI/driver/ami_program.c index 9f53a01..892e9b8 100755 --- a/sw/AMI/driver/ami_program.c +++ b/sw/AMI/driver/ami_program.c @@ -91,11 +91,18 @@ static int do_image_download(struct amc_control_ctxt *amc_ctrl_ctxt, uint8_t *bu break; if (efd_ctx) { - #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) || \ - (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 5)) + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) eventfd_signal(efd_ctx); #else + # ifdef RHEL_RELEASE_CODE + # if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 5) + eventfd_signal(efd_ctx); + # else + eventfd_signal(efd_ctx, bytes_to_write); + # endif + # else eventfd_signal(efd_ctx, bytes_to_write); + # endif #endif } } else { @@ -151,11 +158,18 @@ static int do_image_download(struct amc_control_ctxt *amc_ctrl_ctxt, uint8_t *bu buf, (PDI_CHUNK_SIZE * PDI_CHUNK_MULTIPLIER)); if (!ret && efd_ctx) - #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) || \ - (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 5)) + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) eventfd_signal(efd_ctx); #else + # ifdef RHEL_RELEASE_CODE + # if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 5) + eventfd_signal(efd_ctx); + # else + eventfd_signal(efd_ctx, (PDI_CHUNK_SIZE * PDI_CHUNK_MULTIPLIER)); + # endif + # else eventfd_signal(efd_ctx, (PDI_CHUNK_SIZE * PDI_CHUNK_MULTIPLIER)); + # endif #endif }