Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11725
b: refs/heads/master
c: 9b0cbe9
h: refs/heads/master
i:
  11723: 4edd04b
v: v3
  • Loading branch information
Olaf Hering authored and Paul Mackerras committed Oct 29, 2005
1 parent 77d22b4 commit 91cd93f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06cf26beffc54bb43aebbefa60f84e0dffde3141
refs/heads/master: 9b0cbe97566dd7123eee0462d91703434fe61090
19 changes: 0 additions & 19 deletions trunk/arch/ppc64/boot/crt0.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,5 @@ _start:
sync
isync

## Clear out the BSS as per ANSI C requirements

lis r7,_end@ha
addi r7,r7,_end@l # r7 = &_end
lis r8,__bss_start@ha #
addi r8,r8,__bss_start@l # r8 = &_bss_start

## Determine how large an area, in number of words, to clear

subf r7,r8,r7 # r7 = &_end - &_bss_start + 1
addi r7,r7,3 # r7 += 3
srwi. r7,r7,2 # r7 = size in words.
beq 3f # If the size is zero, don't bother
addi r8,r8,-4 # r8 -= 4
mtctr r7 # SPRN_CTR = number of words to clear
li r0,0 # r0 = 0
2: stwu r0,4(r8) # Clear out a word
bdnz 2b # Keep clearing until done
3:
b start

3 changes: 3 additions & 0 deletions trunk/arch/ppc64/boot/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern void flush_cache(void *, unsigned long);
#define ONE_MB 0x100000

extern char _start[];
extern char __bss_start[];
extern char _end[];
extern char _vmlinux_start[];
extern char _vmlinux_end[];
Expand Down Expand Up @@ -138,6 +139,8 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
Elf64_Ehdr *elf64;
Elf64_Phdr *elf64ph;

memset(__bss_start, 0, _end - __bss_start);

prom = (int (*)(void *)) promptr;
chosen_handle = finddevice("/chosen");
if (chosen_handle == (void *) -1)
Expand Down

0 comments on commit 91cd93f

Please sign in to comment.