aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-19 08:55:50 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-08-27 11:12:52 -0400
commit8fee697d990c54976c8dc167270633299e2515d2 (patch)
tree2236f4907bf6586892df8412224c415581311948 /arch
parentf7cf5a5b8c0e59eac8d30b62271cb0fa52e53ebc (diff)
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 741e2956f3cf..19769ac60616 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;
88#define paravirt_post_allocator_init() do {} while (0) 88#define paravirt_post_allocator_init() do {} while (0)
89#endif 89#endif
90 90
91extern void reserve_standard_io_resources(void);
92extern void i386_reserve_resources(void);
93
91#ifndef _SETUP 94#ifndef _SETUP
92 95
93/* 96/*
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 75e9e68d635f..d0d9be25ed93 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -4,10 +4,13 @@
4/** 4/**
5 * struct x86_init_resources - platform specific resource related ops 5 * struct x86_init_resources - platform specific resource related ops
6 * @probe_roms: probe BIOS roms 6 * @probe_roms: probe BIOS roms
7 * @reserve_resources: reserve the standard resources for the
8 * platform
7 * 9 *
8 */ 10 */
9struct x86_init_resources { 11struct x86_init_resources {
10 void (*probe_roms)(void); 12 void (*probe_roms)(void);
13 void (*reserve_resources)(void);
11}; 14};
12 15
13/** 16/**
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c
index 4049353152cf..d91c37c02069 100644
--- a/arch/x86/kernel/head32.c
+++ b/arch/x86/kernel/head32.c
@@ -31,6 +31,7 @@ void __init i386_start_kernel(void)
31#endif 31#endif
32 /* Initilize 32bit specific setup functions */ 32 /* Initilize 32bit specific setup functions */
33 x86_init.resources.probe_roms = probe_roms; 33 x86_init.resources.probe_roms = probe_roms;
34 x86_init.resources.reserve_resources = i386_reserve_resources;
34 35
35 reserve_ebda_region(); 36 reserve_ebda_region();
36 37
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 5796eb158d49..c2a8090e8312 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -171,13 +171,6 @@ static struct resource bss_resource = {
171 171
172 172
173#ifdef CONFIG_X86_32 173#ifdef CONFIG_X86_32
174static struct resource video_ram_resource = {
175 .name = "Video RAM area",
176 .start = 0xa0000,
177 .end = 0xbffff,
178 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
179};
180
181/* cpu data as detected by the assembly code in head.S */ 174/* cpu data as detected by the assembly code in head.S */
182struct cpuinfo_x86 new_cpu_data __cpuinitdata = {0, 0, 0, 0, -1, 1, 0, 0, -1}; 175struct cpuinfo_x86 new_cpu_data __cpuinitdata = {0, 0, 0, 0, -1, 1, 0, 0, -1};
183/* common cpu data for all cpus */ 176/* common cpu data for all cpus */
@@ -605,7 +598,7 @@ static struct resource standard_io_resources[] = {
605 .flags = IORESOURCE_BUSY | IORESOURCE_IO } 598 .flags = IORESOURCE_BUSY | IORESOURCE_IO }
606}; 599};
607 600
608static void __init reserve_standard_io_resources(void) 601void __init reserve_standard_io_resources(void)
609{ 602{
610 int i; 603 int i;
611 604
@@ -1013,10 +1006,7 @@ void __init setup_arch(char **cmdline_p)
1013 e820_reserve_resources(); 1006 e820_reserve_resources();
1014 e820_mark_nosave_regions(max_low_pfn); 1007 e820_mark_nosave_regions(max_low_pfn);
1015 1008
1016#ifdef CONFIG_X86_32 1009 x86_init.resources.reserve_resources();
1017 request_resource(&iomem_resource, &video_ram_resource);
1018#endif
1019 reserve_standard_io_resources();
1020 1010
1021 e820_setup_gap(); 1011 e820_setup_gap();
1022 1012
@@ -1102,4 +1092,18 @@ void __init x86_quirk_time_init(void)
1102 irq0.mask = cpumask_of_cpu(0); 1092 irq0.mask = cpumask_of_cpu(0);
1103 setup_irq(0, &irq0); 1093 setup_irq(0, &irq0);
1104} 1094}
1095
1096static struct resource video_ram_resource = {
1097 .name = "Video RAM area",
1098 .start = 0xa0000,
1099 .end = 0xbffff,
1100 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
1101};
1102
1103void __init i386_reserve_resources(void)
1104{
1105 request_resource(&iomem_resource, &video_ram_resource);
1106 reserve_standard_io_resources();
1107}
1108
1105#endif /* CONFIG_X86_32 */ 1109#endif /* CONFIG_X86_32 */
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 88883f8006c2..68c093b67ecf 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -5,7 +5,7 @@
5 */ 5 */
6#include <linux/init.h> 6#include <linux/init.h>
7 7
8#include <asm/x86_init.h> 8#include <asm/setup.h>
9 9
10void __cpuinit x86_init_noop(void) { } 10void __cpuinit x86_init_noop(void) { }
11 11
@@ -17,5 +17,6 @@ struct __initdata x86_init_ops x86_init = {
17 17
18 .resources = { 18 .resources = {
19 .probe_roms = x86_init_noop, 19 .probe_roms = x86_init_noop,
20 .reserve_resources = reserve_standard_io_resources,
20 }, 21 },
21}; 22};