summaryrefslogtreecommitdiffstats
path: root/sys/boot/powerpc
diff options
context:
space:
mode:
authorandreast <andreast@FreeBSD.org>2010-11-17 19:28:48 +0000
committerandreast <andreast@FreeBSD.org>2010-11-17 19:28:48 +0000
commite7675da8d7a7ffb411fc9b1fbdd398e5ee268e8c (patch)
treebbfe066e9793dc2bc6bb9a5973daf19569d3937c /sys/boot/powerpc
parent567f54688569eed4fa86cd6942f566e7c7e050c9 (diff)
downloadFreeBSD-src-e7675da8d7a7ffb411fc9b1fbdd398e5ee268e8c.zip
FreeBSD-src-e7675da8d7a7ffb411fc9b1fbdd398e5ee268e8c.tar.gz
Make sure the .bss is cleared at the beginning. The pSeries OF ELF loader does
not clear .bss automatically. Approved by: nwhitehorn (mentor)
Diffstat (limited to 'sys/boot/powerpc')
-rw-r--r--sys/boot/powerpc/ofw/start.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/boot/powerpc/ofw/start.c b/sys/boot/powerpc/ofw/start.c
index 60c5db7..8637e1f 100644
--- a/sys/boot/powerpc/ofw/start.c
+++ b/sys/boot/powerpc/ofw/start.c
@@ -50,7 +50,20 @@ _start: \n\
addi %r1,%r1,stack@l \n\
addi %r1,%r1,16384 \n\
\n\
- b startup \n\
+ /* Clear the .bss!!! */ \n\
+ li %r0,0 \n\
+ lis %r8,_edata@ha \n\
+ addi %r8,%r8,_edata@l\n\
+ lis %r9,_end@ha \n\
+ addi %r9,%r9,_end@l \n\
+ \n\
+1: cmpw 0,%r8,%r9 \n\
+ bge 2f \n\
+ stw %r0,0(%r8) \n\
+ addi %r8,%r8,4 \n\
+ b 1b \n\
+ \n\
+2: b startup \n\
");
void
OpenPOWER on IntegriCloud