summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-19 14:55:50 +0200
committerThomas Gleixner <tglx@linutronix.de>2009-08-27 17:12:52 +0200
commit8fee697d990c54976c8dc167270633299e2515d2 (patch)
tree2236f4907bf6586892df8412224c415581311948 /arch
parentf7cf5a5b8c0e59eac8d30b62271cb0fa52e53ebc (diff)
downloadop-kernel-dev-8fee697d990c54976c8dc167270633299e2515d2.zip
op-kernel-dev-8fee697d990c54976c8dc167270633299e2515d2.tar.gz
x86: Add request_standard_resources to x86_init
The 32bit and the 64bit code are slighty different in the reservation of standard resources. Also the upcoming Moorestown support needs its own version of that. Add it to x86_init_ops and initialize it with the 64bit default. 32bit overrides it in early boot. Now moorestown can add it's own override w/o sprinkling the code with more #ifdefs Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/setup.h3
-rw-r--r--arch/x86/include/asm/x86_init.h3
-rw-r--r--arch/x86/kernel/head32.c1
-rw-r--r--arch/x86/kernel/setup.c28
-rw-r--r--arch/x86/kernel/x86_init.c3
5 files changed, 25 insertions, 13 deletions
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 741e295..19769ac 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -88,6 +88,9 @@ extern unsigned long saved_video_mode;
#define paravirt_post_allocator_init() do {} while (0)
#endif
+extern void reserve_standard_io_resources(void);
+extern void i386_reserve_resources(void);
+
#ifndef _SETUP
/*
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 75e9e68..d0d9be2 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -4,10 +4,13 @@
/**
* struct x86_init_resources - platform specific resource related ops
* @probe_roms: probe BIOS roms
+ * @reserve_resources: reserve the standard resources for the
+ * platform
*
*/
struct x86_init_resources {
void (*probe_roms)(void);
+ void (*reserve_resources)(void);
};
/**
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c
index 4049353..d91c37c 100644
--- a/arch/x86/kernel/head32.c
+++ b/arch/x86/kernel/head32.c
@@ -31,6 +31,7 @@ void __init i386_start_kernel(void)
#endif
/* Initilize 32bit specific setup functions */
x86_init.resources.probe_roms = probe_roms;
+ x86_init.resources.reserve_resources = i386_reserve_resources;
reserve_ebda_region();
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 5796eb1..c2a8090 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -171,13 +171,6 @@ static struct resource bss_resource = {
#ifdef CONFIG_X86_32
-static struct resource video_ram_resource = {
- .name = "Video RAM area",
- .start = 0xa0000,
- .end = 0xbffff,
- .flags = IORESOURCE_BUSY | IORESOURCE_MEM
-};
-
/* cpu data as detected by the assembly code in head.S */
struct cpuinfo_x86 new_cpu_data __cpuinitdata = {0, 0, 0, 0, -1, 1, 0, 0, -1};
/* common cpu data for all cpus */
@@ -605,7 +598,7 @@ static struct resource standard_io_resources[] = {
.flags = IORESOURCE_BUSY | IORESOURCE_IO }
};
-static void __init reserve_standard_io_resources(void)
+void __init reserve_standard_io_resources(void)
{
int i;
@@ -1013,10 +1006,7 @@ void __init setup_arch(char **cmdline_p)
e820_reserve_resources();
e820_mark_nosave_regions(max_low_pfn);
-#ifdef CONFIG_X86_32
- request_resource(&iomem_resource, &video_ram_resource);
-#endif
- reserve_standard_io_resources();
+ x86_init.resources.reserve_resources();
e820_setup_gap();
@@ -1102,4 +1092,18 @@ void __init x86_quirk_time_init(void)
irq0.mask = cpumask_of_cpu(0);
setup_irq(0, &irq0);
}
+
+static struct resource video_ram_resource = {
+ .name = "Video RAM area",
+ .start = 0xa0000,
+ .end = 0xbffff,
+ .flags = IORESOURCE_BUSY | IORESOURCE_MEM
+};
+
+void __init i386_reserve_resources(void)
+{
+ request_resource(&iomem_resource, &video_ram_resource);
+ reserve_standard_io_resources();
+}
+
#endif /* CONFIG_X86_32 */
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 88883f8..68c093b 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -5,7 +5,7 @@
*/
#include <linux/init.h>
-#include <asm/x86_init.h>
+#include <asm/setup.h>
void __cpuinit x86_init_noop(void) { }
@@ -17,5 +17,6 @@ struct __initdata x86_init_ops x86_init = {
.resources = {
.probe_roms = x86_init_noop,
+ .reserve_resources = reserve_standard_io_resources,
},
};
OpenPOWER on IntegriCloud