x86: Move FADT table to a writer function
Move this table over to use a writer function, for x86 only.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c
index cff47b5..1f4b7fa 100644
--- a/arch/x86/lib/acpi_table.c
+++ b/arch/x86/lib/acpi_table.c
@@ -523,13 +523,27 @@
}
ACPI_WRITER(4gnvs, "GNVS", acpi_write_gnvs, 0);
+static int acpi_write_fadt(struct acpi_ctx *ctx,
+ const struct acpi_writer *entry)
+{
+ struct acpi_fadt *fadt;
+
+ fadt = ctx->current;
+ acpi_create_fadt(fadt, ctx->facs, ctx->dsdt);
+ acpi_add_table(ctx, fadt);
+
+ acpi_inc(ctx, sizeof(struct acpi_fadt));
+
+ return 0;
+}
+ACPI_WRITER(5fact, "FADT", acpi_write_fadt, 0);
+
/*
* QEMU's version of write_acpi_tables is defined in drivers/misc/qfw.c
*/
int write_acpi_tables_x86(struct acpi_ctx *ctx,
const struct acpi_writer *entry)
{
- struct acpi_fadt *fadt;
struct acpi_table_header *ssdt;
struct acpi_mcfg *mcfg;
struct acpi_tcpa *tcpa;
@@ -538,12 +552,6 @@
struct acpi_spcr *spcr;
int ret;
- debug("ACPI: * FADT\n");
- fadt = ctx->current;
- acpi_inc_align(ctx, sizeof(struct acpi_fadt));
- acpi_create_fadt(fadt, ctx->facs, ctx->dsdt);
- acpi_add_table(ctx, fadt);
-
debug("ACPI: * SSDT\n");
ssdt = (struct acpi_table_header *)ctx->current;
if (!acpi_create_ssdt(ctx, ssdt, OEM_TABLE_ID))