x86: Fix copying of Real-Mode code into RAM
authorGraeme Russ <graeme.russ@gmail.com>
Fri, 23 Apr 2010 14:05:45 +0000 (00:05 +1000)
committerWolfgang Denk <wd@denx.de>
Wed, 5 May 2010 22:15:58 +0000 (00:15 +0200)
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
arch/i386/lib/bios_setup.c
arch/i386/lib/realmode.c

index 6491e522ec4ef18513e1763f0434a80429175d05..a92b77ea237e912e2b692df99bca616b3d6f971d 100644 (file)
@@ -141,7 +141,7 @@ static void setvector(int vector, u16 segment, void *handler)
 
 int bios_setup(void)
 {
-       ulong i386boot_bios      = (ulong)&_i386boot_bios;
+       ulong i386boot_bios      = (ulong)&_i386boot_bios + gd->reloc_off;
        ulong i386boot_bios_size = (ulong)&_i386boot_bios_size;
 
        static int done=0;
index 3c3c1fc961f4af854fdb7fc6443a1ff8bb73a4df..b3f51230a5b4d096aef608edc6daf533c6c16fab 100644 (file)
@@ -37,7 +37,7 @@ extern char realmode_enter;
 
 int realmode_setup(void)
 {
-       ulong i386boot_realmode      = (ulong)&_i386boot_realmode;
+       ulong i386boot_realmode      = (ulong)&_i386boot_realmode + gd->reloc_off;
        ulong i386boot_realmode_size = (ulong)&_i386boot_realmode_size;
 
        /* copy the realmode switch code */