]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] x86-64: modify copy_bootdata to use virtual addresses
authorVivek Goyal <vgoyal@in.ibm.com>
Wed, 2 May 2007 17:27:07 +0000 (19:27 +0200)
committerAndi Kleen <andi@basil.nowhere.org>
Wed, 2 May 2007 17:27:07 +0000 (19:27 +0200)
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>
arch/x86_64/kernel/head64.c

index 5f197b0a330ab4d3393325afbdf30f6ec70cff3c..5c529c1e3d6c9c3954691cccdb7ec7c72e5e8d32 100644 (file)
@@ -29,25 +29,24 @@ static void __init clear_bss(void)
 }
 
 #define NEW_CL_POINTER         0x228   /* Relative to real mode data */
-#define OLD_CL_MAGIC_ADDR      0x90020
+#define OLD_CL_MAGIC_ADDR      0x20
 #define OLD_CL_MAGIC            0xA33F
-#define OLD_CL_BASE_ADDR        0x90000
-#define OLD_CL_OFFSET           0x90022
+#define OLD_CL_OFFSET           0x22
 
 static void __init copy_bootdata(char *real_mode_data)
 {
-       int new_data;
+       unsigned long new_data;
        char * command_line;
 
        memcpy(x86_boot_params, real_mode_data, BOOT_PARAM_SIZE);
-       new_data = *(int *) (x86_boot_params + NEW_CL_POINTER);
+       new_data = *(u32 *) (x86_boot_params + NEW_CL_POINTER);
        if (!new_data) {
-               if (OLD_CL_MAGIC != * (u16 *) OLD_CL_MAGIC_ADDR) {
+               if (OLD_CL_MAGIC != *(u16 *)(real_mode_data + OLD_CL_MAGIC_ADDR)) {
                        return;
                }
-               new_data = OLD_CL_BASE_ADDR + * (u16 *) OLD_CL_OFFSET;
+               new_data = __pa(real_mode_data) + *(u16 *)(real_mode_data + OLD_CL_OFFSET);
        }
-       command_line = (char *) ((u64)(new_data));
+       command_line = __va(new_data);
        memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
 }
 
@@ -74,7 +73,7 @@ void __init x86_64_start_kernel(char * real_mode_data)
                cpu_pda(i) = &boot_cpu_pda[i];
 
        pda_init(0);
-       copy_bootdata(real_mode_data);
+       copy_bootdata(__va(real_mode_data));
 #ifdef CONFIG_SMP
        cpu_set(0, cpu_online_map);
 #endif