public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/8] x86: Fix a few recently added bugs
@ 2011-11-17  9:32 Graeme Russ
  2011-11-17  9:34 ` Graeme Russ
  2011-11-30 11:07 ` Graeme Russ
  0 siblings, 2 replies; 3+ messages in thread
From: Graeme Russ @ 2011-11-17  9:32 UTC (permalink / raw)
  To: u-boot

From: Gabe Black <gabeblack@chromium.org>

Signed-off-by: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
---
 arch/x86/cpu/cpu.c   |    1 +
 arch/x86/lib/board.c |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 48d2f7a..61d0b69 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -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
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 18e0ede..d742fec 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -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 &&
-- 
1.7.5.2.317.g391b14

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 1/8] x86: Fix a few recently added bugs
  2011-11-17  9:32 [U-Boot] [PATCH 1/8] x86: Fix a few recently added bugs Graeme Russ
@ 2011-11-17  9:34 ` Graeme Russ
  2011-11-30 11:07 ` Graeme Russ
  1 sibling, 0 replies; 3+ messages in thread
From: Graeme Russ @ 2011-11-17  9:34 UTC (permalink / raw)
  To: u-boot

Eep - This is a stand-alone patch and not part of a multi-part patch series
(forgot to edit the subject)

Regards,

Graeme

On 17/11/11 20:32, Graeme Russ wrote:
> From: Gabe Black <gabeblack@chromium.org>
> 
> Signed-off-by: Gabe Black <gabeblack@chromium.org>
> Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
> ---
>  arch/x86/cpu/cpu.c   |    1 +
>  arch/x86/lib/board.c |    6 +++++-
>  2 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
> index 48d2f7a..61d0b69 100644
> --- a/arch/x86/cpu/cpu.c
> +++ b/arch/x86/cpu/cpu.c
> @@ -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
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index 18e0ede..d742fec 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -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 &&

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 1/8] x86: Fix a few recently added bugs
  2011-11-17  9:32 [U-Boot] [PATCH 1/8] x86: Fix a few recently added bugs Graeme Russ
  2011-11-17  9:34 ` Graeme Russ
@ 2011-11-30 11:07 ` Graeme Russ
  1 sibling, 0 replies; 3+ messages in thread
From: Graeme Russ @ 2011-11-30 11:07 UTC (permalink / raw)
  To: u-boot

Hi Gabe,

On 17/11/11 20:32, Graeme Russ wrote:
> From: Gabe Black <gabeblack@chromium.org>
> 
> Signed-off-by: Gabe Black <gabeblack@chromium.org>
> Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-30 11:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17  9:32 [U-Boot] [PATCH 1/8] x86: Fix a few recently added bugs Graeme Russ
2011-11-17  9:34 ` Graeme Russ
2011-11-30 11:07 ` Graeme Russ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox