x86: Fix a few recently added bugs
PATCH 1/8 x86: Fix a few recently added bugs
From: Gabe Black <[email protected]>
Signed-off-by Gabe Black <[email protected]>
Signed-off-by Graeme Russ <[email protected]>
--- arch/x86/cpu/cpu.c | 1 + arch/x86/lib/board.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletions(-)
arch/x86/cpu/cpu.c +1 -0
@@ -37,6 +37,7 @@#include <asm/processor.h> #include <asm/processor-flags.h> #include <asm/interrupt.h> +#include <linux/compiler.h> /* * Constructor for a conventional segment GDT (or LDT) entry
arch/x86/lib/board.c +5 -1
@@ -220,6 +220,9 @@ static int do_elf_reloc_fixups(void)Elf32_Addr *offset_ptr_rom;Elf32_Addr *offset_ptr_ram; +/* The size of the region of u-boot that runs out of RAM. */ +uintptr_t size = (uintptr_t )&__bss_end - (uintptr_t )&__text_start; + do { /* Get the location from the relocation entry */ offset_ptr_rom = (Elf32_Addr *)re_src->r_offset;
@@ -228,7 +231,8 @@ static int do_elf_reloc_fixups(void)if (offset_ptr_rom >= (Elf32_Addr *)CONFIG_SYS_TEXT_BASE ) {/* Switch to the in-RAM version */ - offset_ptr_ram = offset_ptr_rom + gd->reloc_off; + offset_ptr_ram = (Elf32_Addr *)((ulong )offset_ptr_rom + + gd->reloc_off);/* Check that the target points into .text */ if (*offset_ptr_ram >= CONFIG_SYS_TEXT_BASE &&
Signature · 1 line
1.7.5.2.317.g391b14
PATCH 1/8 x86: Fix a few recently added bugs
Eep - This is a stand-alone patch and not part of a multi-part patch series (forgot to edit the subject)
Regards,
Graeme
Quoted 45 lines · Graeme Russ
From: Gabe Black <[email protected]>
Signed-off-by Gabe Black <[email protected]>Signed-off-by Graeme Russ <[email protected]>--- arch/x86/cpu/cpu.c | 1 + arch/x86/lib/board.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletions(-)arch/x86/cpu/cpu.c +1
-0@@ -37,6 +37,7 @@#include <asm/processor.h> #include <asm/processor-flags.h> #include <asm/interrupt.h> +#include <linux/compiler.h> /* * Constructor for a conventional segment GDT (or LDT) entry arch/x86/lib/board.c +5
-1@@ -220,6 +220,9 @@ static int do_elf_reloc_fixups(void)Elf32_Addr *offset_ptr_rom;Elf32_Addr *offset_ptr_ram; +/* The size of the region of u-boot that runs out of RAM. */ +uintptr_t size = (uintptr_t )&__bss_end - (uintptr_t )&__text_start; + do { /* Get the location from the relocation entry */ offset_ptr_rom = (Elf32_Addr *)re_src->r_offset;@@ -228,7 +231,8 @@ static int do_elf_reloc_fixups(void)if (offset_ptr_rom >= (Elf32_Addr *)CONFIG_SYS_TEXT_BASE ) {/* Switch to the in-RAM version */ - offset_ptr_ram = offset_ptr_rom + gd->reloc_off; + offset_ptr_ram = (Elf32_Addr *)((ulong )offset_ptr_rom + + gd->reloc_off);/* Check that the target points into .text */ if (*offset_ptr_ram >= CONFIG_SYS_TEXT_BASE &&
PATCH 1/8 x86: Fix a few recently added bugs
In reply to Graeme RussHi Gabe,
Quoted 8 lines · Graeme Russ
From: Gabe Black <[email protected]>
Signed-off-by Gabe Black <[email protected]>Signed-off-by Graeme Russ <[email protected]>--- arch/x86/cpu/cpu.c | 1 + arch/x86/lib/board.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletions(-)
Applied to u-boot-x86/master
Thanks,
Graeme