summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/x86/ebda.c19
-rw-r--r--src/arch/x86/include/arch/ebda.h19
-rw-r--r--src/device/device.c8
3 files changed, 16 insertions, 30 deletions
diff --git a/src/arch/x86/ebda.c b/src/arch/x86/ebda.c
index 0e3465a040..e576a14791 100644
--- a/src/arch/x86/ebda.c
+++ b/src/arch/x86/ebda.c
@@ -1,9 +1,19 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <stdint.h>
#include <acpi/acpi.h>
-#include <arch/ebda.h>
+#include <bootstate.h>
#include <commonlib/endian.h>
+#include <stdint.h>
+
+#define X86_BDA_SIZE 0x200
+#define X86_BDA_BASE ((void *)0x400)
+#define X86_EBDA_SEGMENT ((void *)0x40e)
+#define X86_EBDA_LOWMEM ((void *)0x413)
+
+#define DEFAULT_EBDA_LOWMEM (1024 << 10)
+#define DEFAULT_EBDA_SEGMENT 0xF600
+#define DEFAULT_EBDA_SIZE 0x400
+
static void *get_ebda_start(void)
{
@@ -40,7 +50,7 @@ static void setup_ebda(u32 low_memory_size, u16 ebda_segment, u16 ebda_size)
write_le16(ebda, ebda_kb);
}
-void setup_default_ebda(void)
+static void setup_default_ebda(void *unused)
{
if (acpi_is_wakeup_s3())
return;
@@ -49,3 +59,6 @@ void setup_default_ebda(void)
DEFAULT_EBDA_SEGMENT,
DEFAULT_EBDA_SIZE);
}
+
+/* Ensure EBDA is prepared before Option ROMs. */
+BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_ENTRY, setup_default_ebda, NULL);
diff --git a/src/arch/x86/include/arch/ebda.h b/src/arch/x86/include/arch/ebda.h
deleted file mode 100644
index e625d4a305..0000000000
--- a/src/arch/x86/include/arch/ebda.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#ifndef __ARCH_EBDA_H
-#define __ARCH_EBDA_H
-
-#include <stddef.h>
-
-#define X86_BDA_SIZE 0x200
-#define X86_BDA_BASE ((void *)0x400)
-#define X86_EBDA_SEGMENT ((void *)0x40e)
-#define X86_EBDA_LOWMEM ((void *)0x413)
-
-#define DEFAULT_EBDA_LOWMEM (1024 << 10)
-#define DEFAULT_EBDA_SEGMENT 0xF600
-#define DEFAULT_EBDA_SIZE 0x400
-
-void setup_default_ebda(void);
-
-#endif
diff --git a/src/device/device.c b/src/device/device.c
index 8337d55300..ffda588d63 100644
--- a/src/device/device.c
+++ b/src/device/device.c
@@ -12,9 +12,6 @@
#include <stdlib.h>
#include <string.h>
#include <smp/spinlock.h>
-#if ENV_X86
-#include <arch/ebda.h>
-#endif
#include <timer.h>
/** Pointer to the last device */
@@ -566,11 +563,6 @@ void dev_initialize(void)
printk(BIOS_INFO, "Initializing devices...\n");
-#if ENV_X86
- /* Ensure EBDA is prepared before Option ROMs. */
- setup_default_ebda();
-#endif
-
/* First call the mainboard init. */
init_dev(&dev_root);