From dec4e3a176b52059315a9fa1e628f6d73062878e Mon Sep 17 00:00:00 2001 From: Pierre Gondois Date: Wed, 3 Jul 2024 11:53:40 +0200 Subject: [PATCH] DynamicTablesPkg: Add EFIAPI to generators hooks For X64 builds, the EFIAPI is replaced by '(__attribute__((ms_abi))'. This might lead to build error for some ACPI tablte generators due to function prototype mismatch. Add the EFIAPI to ACPI table generator hooks: - ACPI_TABLE_GENERATOR_BUILD_TABLEEX - ACPI_TABLE_GENERATOR_FREE_TABLEEX Signed-off-by: Pierre Gondois Reviewed-by: Sami Mujawar --- DynamicTablesPkg/Include/AcpiTableGenerator.h | 8 ++++---- .../Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c | 1 + .../Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c | 1 + .../Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c | 1 + .../Library/Acpi/Common/AcpiSratLib/SratGenerator.c | 1 + .../AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c | 1 + 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h b/DynamicTablesPkg/Include/AcpiTableGenerator.h index d0eda011c301..f5c6179be082 100644 --- a/DynamicTablesPkg/Include/AcpiTableGenerator.h +++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h @@ -214,7 +214,7 @@ typedef struct AcpiTableGenerator ACPI_TABLE_GENERATOR; @return EFI_SUCCESS If the table is generated successfully or other failure codes as returned by the generator. **/ -typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLE) ( +typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_BUILD_TABLE)( IN CONST ACPI_TABLE_GENERATOR *This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, @@ -234,7 +234,7 @@ typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLE) ( @return EFI_SUCCESS If freed successfully or other failure codes as returned by the generator. **/ -typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_FREE_TABLE) ( +typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_FREE_TABLE)( IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, @@ -257,7 +257,7 @@ typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_FREE_TABLE) ( @return EFI_SUCCESS If the table is generated successfully or other failure codes as returned by the generator. **/ -typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLEEX) ( +typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_BUILD_TABLEEX)( IN CONST ACPI_TABLE_GENERATOR *This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, @@ -280,7 +280,7 @@ typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_BUILD_TABLEEX) ( @return EFI_SUCCESS If freed successfully or other failure codes as returned by the generator. **/ -typedef EFI_STATUS (*ACPI_TABLE_GENERATOR_FREE_TABLEEX) ( +typedef EFI_STATUS (EFIAPI *ACPI_TABLE_GENERATOR_FREE_TABLEEX)( IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c index 722f9c17d541..40dea304e301 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c @@ -261,6 +261,7 @@ BuildMcfgTable ( **/ STATIC EFI_STATUS +EFIAPI FreeMcfgTableResources ( IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c index ef5d8823c223..36e6807023fb 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c @@ -1075,6 +1075,7 @@ BuildPcctTable ( **/ STATIC EFI_STATUS +EFIAPI FreePcctTableResources ( IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c index 2b8088a07f44..fd465cbab0e9 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c @@ -1342,6 +1342,7 @@ BuildPpttTable ( **/ STATIC EFI_STATUS +EFIAPI FreePpttTableResources ( IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c index dcdacc4e966e..1a9434e6bd08 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c @@ -552,6 +552,7 @@ BuildSratTable ( **/ STATIC EFI_STATUS +EFIAPI FreeSratTableResources ( IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c index 9097ac3deba6..24b06d01dc4d 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c @@ -1313,6 +1313,7 @@ BuildSsdtCpuTopologyTable ( **/ STATIC EFI_STATUS +EFIAPI FreeSsdtCpuTopologyTableResources ( IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,