diff options
author | Jeremy Fitzhardinge <jeremy@xensource.com> | 2006-06-25 08:46:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:00:55 -0400 |
commit | e75eac33b5c7f797e4b2ddcb39183cf268e26822 (patch) | |
tree | 3c87328055c5975ca9d69df56dcc4a1d9066352c /arch/i386/mach-default | |
parent | e6a1530d692d6a60cdf15dfbcfea07f5324d7b9f (diff) |
[PATCH] Clean up and refactor i386 sub-architecture setup
Clean up and refactor i386 sub-architecture setup.
This change moves all the code from the
asm-i386/mach-*/setup_arch_pre/post.h headers, into
arch/i386/mach-*/setup.c. mach-*/setup_arch_pre.h is renamed to
setup_arch.h, and contains only things which should be in header files. It
is purely code-motion; there should be no functional changes at all.
Several functions in arch/i386/kernel/setup.c needed to be made non-static
so that they're visible to the code in mach-*/setup.c. asm-i386/setup.h is
used to hold the prototypes for these functions.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Cc: Zachary Amsden <zach@vmware.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Cc: Martin Bligh <mbligh@google.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Andrey Panin <pazke@donpac.ru>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/mach-default')
-rw-r--r-- | arch/i386/mach-default/setup.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/i386/mach-default/setup.c b/arch/i386/mach-default/setup.c index b4a7455c6993..004837c58793 100644 --- a/arch/i386/mach-default/setup.c +++ b/arch/i386/mach-default/setup.c | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <linux/interrupt.h> | 8 | #include <linux/interrupt.h> |
9 | #include <asm/acpi.h> | 9 | #include <asm/acpi.h> |
10 | #include <asm/arch_hooks.h> | 10 | #include <asm/arch_hooks.h> |
11 | #include <asm/e820.h> | ||
12 | #include <asm/setup.h> | ||
11 | 13 | ||
12 | #ifdef CONFIG_HOTPLUG_CPU | 14 | #ifdef CONFIG_HOTPLUG_CPU |
13 | #define DEFAULT_SEND_IPI (1) | 15 | #define DEFAULT_SEND_IPI (1) |
@@ -130,3 +132,44 @@ static int __init print_ipi_mode(void) | |||
130 | } | 132 | } |
131 | 133 | ||
132 | late_initcall(print_ipi_mode); | 134 | late_initcall(print_ipi_mode); |
135 | |||
136 | /** | ||
137 | * machine_specific_memory_setup - Hook for machine specific memory setup. | ||
138 | * | ||
139 | * Description: | ||
140 | * This is included late in kernel/setup.c so that it can make | ||
141 | * use of all of the static functions. | ||
142 | **/ | ||
143 | |||
144 | char * __init machine_specific_memory_setup(void) | ||
145 | { | ||
146 | char *who; | ||
147 | |||
148 | |||
149 | who = "BIOS-e820"; | ||
150 | |||
151 | /* | ||
152 | * Try to copy the BIOS-supplied E820-map. | ||
153 | * | ||
154 | * Otherwise fake a memory map; one section from 0k->640k, | ||
155 | * the next section from 1mb->appropriate_mem_k | ||
156 | */ | ||
157 | sanitize_e820_map(E820_MAP, &E820_MAP_NR); | ||
158 | if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) { | ||
159 | unsigned long mem_size; | ||
160 | |||
161 | /* compare results from other methods and take the greater */ | ||
162 | if (ALT_MEM_K < EXT_MEM_K) { | ||
163 | mem_size = EXT_MEM_K; | ||
164 | who = "BIOS-88"; | ||
165 | } else { | ||
166 | mem_size = ALT_MEM_K; | ||
167 | who = "BIOS-e801"; | ||
168 | } | ||
169 | |||
170 | e820.nr_map = 0; | ||
171 | add_memory_region(0, LOWMEMSIZE(), E820_RAM); | ||
172 | add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM); | ||
173 | } | ||
174 | return who; | ||
175 | } | ||