From ace7762b28545e0d2e122d07e81cd4c094fbb298 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 21 Jul 2017 22:32:05 +0300 Subject: [PATCH] x86: acpi: Export acpi_fill_mcfg() with __weak attribute Some platforms might require different approach when filling memory mappings configuration table. Allow them to override the common method. At the same time export acpi_create_mcfg_mmconfig(). Signed-off-by: Andy Shevchenko Reviewed-by: Bin Meng --- arch/x86/include/asm/acpi_table.h | 3 +++ arch/x86/lib/acpi_table.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/acpi_table.h b/arch/x86/include/asm/acpi_table.h index e177c441e7..80038504dd 100644 --- a/arch/x86/include/asm/acpi_table.h +++ b/arch/x86/include/asm/acpi_table.h @@ -314,6 +314,9 @@ int acpi_create_madt_irqoverride(struct acpi_madt_irqoverride *irqoverride, int acpi_create_madt_lapic_nmi(struct acpi_madt_lapic_nmi *lapic_nmi, u8 cpu, u16 flags, u8 lint); u32 acpi_fill_madt(u32 current); +int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, u32 base, + u16 seg_nr, u8 start, u8 end); +u32 acpi_fill_mcfg(u32 current); void acpi_create_gnvs(struct acpi_global_nvs *gnvs); /** * enter_acpi_mode() - enter into ACPI mode diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c index 14d10c34cd..da6014fb41 100644 --- a/arch/x86/lib/acpi_table.c +++ b/arch/x86/lib/acpi_table.c @@ -293,8 +293,8 @@ static void acpi_create_madt(struct acpi_madt *madt) header->checksum = table_compute_checksum((void *)madt, header->length); } -static int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, - u32 base, u16 seg_nr, u8 start, u8 end) +int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, u32 base, + u16 seg_nr, u8 start, u8 end) { memset(mmconfig, 0, sizeof(*mmconfig)); mmconfig->base_address_l = base; @@ -306,7 +306,7 @@ static int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, return sizeof(struct acpi_mcfg_mmconfig); } -static u32 acpi_fill_mcfg(u32 current) +__weak u32 acpi_fill_mcfg(u32 current) { current += acpi_create_mcfg_mmconfig ((struct acpi_mcfg_mmconfig *)current, -- 2.30.2