Make acpi_fill_hest into parameter
This avoids the need to supply weak function and avoids associated risks of
forgetting to link in relevant files.
Change-Id: Ie96475babb4aa4ea8db49023af5b31bfa63b21dc
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/7373
Tested-by: build bot (Jenkins)
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index bc2a0cc..bb994e2 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -554,11 +554,6 @@
rsdp->ext_checksum = acpi_checksum((void *)rsdp, sizeof(acpi_rsdp_t));
}
-unsigned long __attribute__((weak)) acpi_fill_hest(acpi_hest_t *hest)
-{
- return (unsigned long)hest;
-}
-
unsigned long acpi_create_hest_error_source(acpi_hest_t *hest, acpi_hest_esd_t *esd, u16 type, void *data, u16 data_len)
{
acpi_header_t *header = &(hest->header);
@@ -618,7 +613,8 @@
}
/* ACPI 4.0 */
-void acpi_write_hest(acpi_hest_t *hest)
+void acpi_write_hest(acpi_hest_t *hest,
+ unsigned long (*acpi_fill_hest)(acpi_hest_t *hest))
{
acpi_header_t *header = &(hest->header);
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index eab125c..245599f 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -546,10 +546,10 @@
void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current);
unsigned long acpi_create_dmar_drhd_ds_pci(unsigned long current, u8 segment,
u8 dev, u8 fn);
+void acpi_write_hest(acpi_hest_t *hest,
+ unsigned long (*acpi_fill_hest)(acpi_hest_t *hest));
-void acpi_write_hest(acpi_hest_t *hest);
unsigned long acpi_create_hest_error_source(acpi_hest_t *hest, acpi_hest_esd_t *esd, u16 type, void *data, u16 len);
-unsigned long acpi_fill_hest(acpi_hest_t *hest);
void acpi_save_gnvs(u32 gnvs_address);
diff --git a/src/northbridge/amd/agesa/family12/northbridge.c b/src/northbridge/amd/agesa/family12/northbridge.c
index 70536ac..935e137 100644
--- a/src/northbridge/amd/agesa/family12/northbridge.c
+++ b/src/northbridge/amd/agesa/family12/northbridge.c
@@ -793,7 +793,7 @@
/* North Bridge Structures */
-unsigned long acpi_fill_hest(acpi_hest_t *hest)
+static unsigned long acpi_fill_hest(acpi_hest_t *hest)
{
void *addr, *current;
@@ -843,7 +843,7 @@
/* HEST */
current = ALIGN(current, 8);
hest = (acpi_hest_t *)current;
- acpi_write_hest((void *)current);
+ acpi_write_hest((void *)current, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index 3ff1515..355a458 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -815,7 +815,7 @@
acpigen_pop_len();
}
-unsigned long acpi_fill_hest(acpi_hest_t *hest)
+static unsigned long acpi_fill_hest(acpi_hest_t *hest)
{
void *addr, *current;
@@ -845,7 +845,7 @@
/* HEST */
current = ALIGN(current, 8);
hest = (acpi_hest_t *)current;
- acpi_write_hest((void *)current);
+ acpi_write_hest((void *)current, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
diff --git a/src/northbridge/amd/agesa/family15/northbridge.c b/src/northbridge/amd/agesa/family15/northbridge.c
index b251fc1..b2d8abd 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.c
+++ b/src/northbridge/amd/agesa/family15/northbridge.c
@@ -483,7 +483,7 @@
}
-unsigned long acpi_fill_hest(acpi_hest_t *hest)
+static unsigned long acpi_fill_hest(acpi_hest_t *hest)
{
void *addr, *current;
@@ -534,7 +534,7 @@
/* HEST */
current = ALIGN(current, 8);
hest = (acpi_hest_t *)current;
- acpi_write_hest((void *)current);
+ acpi_write_hest((void *)current, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
diff --git a/src/northbridge/amd/agesa/family15rl/northbridge.c b/src/northbridge/amd/agesa/family15rl/northbridge.c
index 33fa927..1f11f1d 100644
--- a/src/northbridge/amd/agesa/family15rl/northbridge.c
+++ b/src/northbridge/amd/agesa/family15rl/northbridge.c
@@ -459,7 +459,7 @@
}
}
-unsigned long acpi_fill_hest(acpi_hest_t *hest)
+static unsigned long acpi_fill_hest(acpi_hest_t *hest)
{
void *addr, *current;
@@ -511,7 +511,7 @@
/* HEST */
current = ALIGN(current, 8);
hest = (acpi_hest_t *)current;
- acpi_write_hest((void *)current);
+ acpi_write_hest((void *)current, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
diff --git a/src/northbridge/amd/agesa/family15tn/northbridge.c b/src/northbridge/amd/agesa/family15tn/northbridge.c
index 1d2bd59..c39ebd1 100644
--- a/src/northbridge/amd/agesa/family15tn/northbridge.c
+++ b/src/northbridge/amd/agesa/family15tn/northbridge.c
@@ -458,7 +458,8 @@
}
}
-unsigned long acpi_fill_hest(acpi_hest_t *hest)
+
+static unsigned long acpi_fill_hest(acpi_hest_t *hest)
{
void *addr, *current;
@@ -510,7 +511,7 @@
/* HEST */
current = ALIGN(current, 8);
hest = (acpi_hest_t *)current;
- acpi_write_hest((void *)current);
+ acpi_write_hest((void *)current, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
diff --git a/src/northbridge/amd/agesa/family16kb/northbridge.c b/src/northbridge/amd/agesa/family16kb/northbridge.c
index 2fa42ff..d1b06ec 100644
--- a/src/northbridge/amd/agesa/family16kb/northbridge.c
+++ b/src/northbridge/amd/agesa/family16kb/northbridge.c
@@ -459,7 +459,7 @@
}
-unsigned long acpi_fill_hest(acpi_hest_t *hest)
+static unsigned long acpi_fill_hest(acpi_hest_t *hest)
{
void *addr, *current;
@@ -511,7 +511,7 @@
/* HEST */
current = ALIGN(current, 8);
hest = (acpi_hest_t *)current;
- acpi_write_hest((void *)current);
+ acpi_write_hest((void *)current, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
diff --git a/src/northbridge/amd/pi/00630F01/northbridge.c b/src/northbridge/amd/pi/00630F01/northbridge.c
index bfdfcb1..15892c6 100644
--- a/src/northbridge/amd/pi/00630F01/northbridge.c
+++ b/src/northbridge/amd/pi/00630F01/northbridge.c
@@ -453,7 +453,7 @@
}
}
-unsigned long acpi_fill_hest(acpi_hest_t *hest)
+static unsigned long acpi_fill_hest(acpi_hest_t *hest)
{
void *addr, *current;
@@ -505,7 +505,7 @@
/* HEST */
current = ALIGN(current, 8);
hest = (acpi_hest_t *)current;
- acpi_write_hest((void *)current);
+ acpi_write_hest((void *)current, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c
index 14c7e10..c44c189 100644
--- a/src/northbridge/amd/pi/00730F01/northbridge.c
+++ b/src/northbridge/amd/pi/00730F01/northbridge.c
@@ -447,7 +447,7 @@
{
}
-unsigned long acpi_fill_hest(acpi_hest_t *hest)
+static unsigned long acpi_fill_hest(acpi_hest_t *hest)
{
void *addr, *current;
@@ -499,7 +499,7 @@
/* HEST */
current = ALIGN(current, 8);
hest = (acpi_hest_t *)current;
- acpi_write_hest((void *)current);
+ acpi_write_hest((void *)current, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;