summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-07-03 11:37:13 -0700
committerIngo Molnar <mingo@elte.hu>2008-07-09 07:43:22 +0200
commita0a0becd2da0ba0d7f0204a61d1905926cdb163d (patch)
treef16af8006d20dbc19572766d9c810c19c90c141d /arch/x86/kernel/setup.c
parent0be15526beb4c228e0477221c62ec8ab0fc7440f (diff)
downloadblackbird-op-linux-a0a0becd2da0ba0d7f0204a61d1905926cdb163d.tar.gz
blackbird-op-linux-a0a0becd2da0ba0d7f0204a61d1905926cdb163d.zip
x86: make e820_saved have update from setup_data
seperate reserve_setup_data into e820_reserved_setup_data, and reserve_early_setup_data. So could use e820_reserved_setup_data to backup e820 with setup_data. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Bernhard Walle <bwalle@suse.de> Cc: Ying Huang <ying.huang@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r--arch/x86/kernel/setup.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index cfcfbefee0b9..bea8ae77d059 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -394,11 +394,10 @@ static void __init parse_setup_data(void)
}
}
-static void __init reserve_setup_data(void)
+static void __init e820_reserve_setup_data(void)
{
struct setup_data *data;
u64 pa_data;
- char buf[32];
int found = 0;
if (boot_params.hdr.version < 0x0209)
@@ -406,8 +405,6 @@ static void __init reserve_setup_data(void)
pa_data = boot_params.hdr.setup_data;
while (pa_data) {
data = early_ioremap(pa_data, sizeof(*data));
- sprintf(buf, "setup data %x", data->type);
- reserve_early(pa_data, pa_data+sizeof(*data)+data->len, buf);
e820_update_range(pa_data, sizeof(*data)+data->len,
E820_RAM, E820_RESERVED_KERN);
found = 1;
@@ -418,10 +415,29 @@ static void __init reserve_setup_data(void)
return;
sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
+ memcpy(&e820_saved, &e820, sizeof(struct e820map));
printk(KERN_INFO "extended physical RAM map:\n");
e820_print_map("reserve setup_data");
}
+static void __init reserve_early_setup_data(void)
+{
+ struct setup_data *data;
+ u64 pa_data;
+ char buf[32];
+
+ if (boot_params.hdr.version < 0x0209)
+ return;
+ pa_data = boot_params.hdr.setup_data;
+ while (pa_data) {
+ data = early_ioremap(pa_data, sizeof(*data));
+ sprintf(buf, "setup data %x", data->type);
+ reserve_early(pa_data, pa_data+sizeof(*data)+data->len, buf);
+ pa_data = data->next;
+ early_iounmap(data, sizeof(*data));
+ }
+}
+
/*
* --------- Crashkernel reservation ------------------------------
*/
@@ -626,6 +642,8 @@ void __init setup_arch(char **cmdline_p)
setup_memory_map();
parse_setup_data();
+ /* update the e820_saved too */
+ e820_reserve_setup_data();
copy_edd();
@@ -656,7 +674,7 @@ void __init setup_arch(char **cmdline_p)
parse_early_param();
/* after early param, so could get panic from serial */
- reserve_setup_data();
+ reserve_early_setup_data();
if (acpi_mps_check()) {
#ifdef CONFIG_X86_LOCAL_APIC
OpenPOWER on IntegriCloud