diff options
author | Vivek Goyal <vgoyal@in.ibm.com> | 2007-05-02 13:27:07 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:07 -0400 |
commit | 278c0eb7f96586c02b2bfaa8e250d951919a2e6a (patch) | |
tree | cab385f0d62fdbfebf8bc2a292465a81d40bf55d /arch/x86_64/kernel/head64.c | |
parent | 93fd755e47d7b00fa5470199cfb14cbd9ded0284 (diff) |
[PATCH] x86-64: modify copy_bootdata to use virtual addresses
Use virtual addresses instead of physical addresses
in copy bootdata. In addition fix the implementation
of the old bootloader convention. Everything is
at real_mode_data always. It is just that sometimes
real_mode_data was relocated by setup.S to not sit at
0x90000.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel/head64.c')
-rw-r--r-- | arch/x86_64/kernel/head64.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/x86_64/kernel/head64.c b/arch/x86_64/kernel/head64.c index 5f197b0a330a..5c529c1e3d6c 100644 --- a/arch/x86_64/kernel/head64.c +++ b/arch/x86_64/kernel/head64.c | |||
@@ -29,25 +29,24 @@ static void __init clear_bss(void) | |||
29 | } | 29 | } |
30 | 30 | ||
31 | #define NEW_CL_POINTER 0x228 /* Relative to real mode data */ | 31 | #define NEW_CL_POINTER 0x228 /* Relative to real mode data */ |
32 | #define OLD_CL_MAGIC_ADDR 0x90020 | 32 | #define OLD_CL_MAGIC_ADDR 0x20 |
33 | #define OLD_CL_MAGIC 0xA33F | 33 | #define OLD_CL_MAGIC 0xA33F |
34 | #define OLD_CL_BASE_ADDR 0x90000 | 34 | #define OLD_CL_OFFSET 0x22 |
35 | #define OLD_CL_OFFSET 0x90022 | ||
36 | 35 | ||
37 | static void __init copy_bootdata(char *real_mode_data) | 36 | static void __init copy_bootdata(char *real_mode_data) |
38 | { | 37 | { |
39 | int new_data; | 38 | unsigned long new_data; |
40 | char * command_line; | 39 | char * command_line; |
41 | 40 | ||
42 | memcpy(x86_boot_params, real_mode_data, BOOT_PARAM_SIZE); | 41 | memcpy(x86_boot_params, real_mode_data, BOOT_PARAM_SIZE); |
43 | new_data = *(int *) (x86_boot_params + NEW_CL_POINTER); | 42 | new_data = *(u32 *) (x86_boot_params + NEW_CL_POINTER); |
44 | if (!new_data) { | 43 | if (!new_data) { |
45 | if (OLD_CL_MAGIC != * (u16 *) OLD_CL_MAGIC_ADDR) { | 44 | if (OLD_CL_MAGIC != *(u16 *)(real_mode_data + OLD_CL_MAGIC_ADDR)) { |
46 | return; | 45 | return; |
47 | } | 46 | } |
48 | new_data = OLD_CL_BASE_ADDR + * (u16 *) OLD_CL_OFFSET; | 47 | new_data = __pa(real_mode_data) + *(u16 *)(real_mode_data + OLD_CL_OFFSET); |
49 | } | 48 | } |
50 | command_line = (char *) ((u64)(new_data)); | 49 | command_line = __va(new_data); |
51 | memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); | 50 | memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); |
52 | } | 51 | } |
53 | 52 | ||
@@ -74,7 +73,7 @@ void __init x86_64_start_kernel(char * real_mode_data) | |||
74 | cpu_pda(i) = &boot_cpu_pda[i]; | 73 | cpu_pda(i) = &boot_cpu_pda[i]; |
75 | 74 | ||
76 | pda_init(0); | 75 | pda_init(0); |
77 | copy_bootdata(real_mode_data); | 76 | copy_bootdata(__va(real_mode_data)); |
78 | #ifdef CONFIG_SMP | 77 | #ifdef CONFIG_SMP |
79 | cpu_set(0, cpu_online_map); | 78 | cpu_set(0, cpu_online_map); |
80 | #endif | 79 | #endif |