@@ -208,7 +208,6 @@ endif
head-y := arch/x86/kernel/head_$(BITS).o
head-y += arch/x86/kernel/head$(BITS).o
-head-y += arch/x86/kernel/head.o
libs-y += arch/x86/lib/
@@ -38,8 +38,6 @@ static inline unsigned int get_bios_ebda_length(void)
return length;
}
-void reserve_ebda_region(void);
-
#ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
/*
* This is obviously not a great place for this, but we want to be
@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
-extra-y := head_$(BITS).o head$(BITS).o head.o vmlinux.lds
+extra-y := head_$(BITS).o head$(BITS).o vmlinux.lds
CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
@@ -22,6 +22,7 @@ KASAN_SANITIZE_dumpstack_$(BITS).o := n
CFLAGS_irq.o := -I$(src)/../include/asm/trace
+obj-y := ebda.o
obj-y := process_$(BITS).o signal.o
obj-y += init.o sort-init.o
obj-$(CONFIG_X86_DEBUG_LINKER_TABLES) += dbg-tables/
similarity index 94%
rename from arch/x86/kernel/head.c
rename to arch/x86/kernel/ebda.c
@@ -4,6 +4,7 @@
#include <asm/setup.h>
#include <asm/bios_ebda.h>
+#include <asm/x86_init.h>
/*
* The BIOS places the EBDA/XBDA at the top of conventional
@@ -26,7 +27,7 @@
#define LOWMEM_CAP 0x9f000U /* Absolute maximum */
#define INSANE_CUTOFF 0x20000U /* Less than this = insane */
-void __init reserve_ebda_region(void)
+static void __init reserve_ebda_region(void)
{
unsigned int lowmem, ebda_addr;
@@ -38,8 +39,6 @@ void __init reserve_ebda_region(void)
* that the paravirt case can handle memory setup
* correctly, without our help.
*/
- if (boot_params.hdr.hardware_subarch != X86_SUBARCH_PC)
- return;
/* end of low (conventional) memory */
lowmem = *(unsigned short *)__va(BIOS_LOWMEM_KILOBYTES);
@@ -69,3 +68,4 @@ void __init reserve_ebda_region(void)
/* reserve all memory between lowmem and the 1MB mark */
memblock_reserve(lowmem, 0x100000 - lowmem);
}
+x86_init_early_pc_simple(reserve_ebda_region);
@@ -26,8 +26,6 @@ static void __init i386_default_early_setup(void)
/* Initialize 32bit specific setup functions */
x86_init.resources.reserve_resources = i386_reserve_resources;
x86_init.mpparse.setup_ioapic_ids = setup_ioapic_ids_from_mpc;
-
- reserve_ebda_region();
}
asmlinkage __visible void __init i386_start_kernel(void)
@@ -194,8 +194,6 @@ void __init x86_64_start_reservations(char *real_mode_data)
x86_init_fn_init_tables();
x86_init_fn_early_init();
- reserve_ebda_region();
-
switch (boot_params.hdr.hardware_subarch) {
case X86_SUBARCH_INTEL_MID:
x86_intel_mid_early_setup();