Skip to content

Commit

Permalink
[POWERPC] Fix hang in start_ldr if _end or _edata is unaligned
Browse files Browse the repository at this point in the history
Quick fix for lack of memset(__bss_start, 0, _end-__bss_start) in
load_kernel().  If edata is unaligned, the loop will overwrite all
memory because r3 and r4 will never be equal.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Olaf Hering authored and Paul Mackerras committed Oct 25, 2006
1 parent aa7a32c commit fb20f65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/ppc/boot/simple/relocate.S
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ do_relocate_out:

start_ldr:
/* Clear all of BSS and set up stack for C calls */
lis r3,edata@h
ori r3,r3,edata@l
lis r3,__bss_start@h
ori r3,r3,__bss_start@l
lis r4,end@h
ori r4,r4,end@l
subi r3,r3,4
subi r4,r4,4
li r0,0
50: stwu r0,4(r3)
cmpw cr0,r3,r4
bne 50b
blt 50b
90: mr r9,r1 /* Save old stack pointer (in case it matters) */
lis r1,.stack@h
ori r1,r1,.stack@l
Expand Down

0 comments on commit fb20f65

Please sign in to comment.