summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2011-12-16 23:40:56 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2011-12-16 23:40:56 +0000
commitbbbfdb636703946f63e5c4da8868e33f48430762 (patch)
tree5f9c5feb3d8a959cf6c5a26d29cafd676207fd1e /sys/powerpc/aim
parentb0fe51d1899e8dcb3afd54d45e57f4cb5874d3da (diff)
downloadFreeBSD-src-bbbfdb636703946f63e5c4da8868e33f48430762.zip
FreeBSD-src-bbbfdb636703946f63e5c4da8868e33f48430762.tar.gz
Zero BSS on start, in case the ELF loader that started the kernel did not
do this for us. This can happen on some embedded systems. Submitted by: rpaulo
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r--sys/powerpc/aim/locore32.S11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/powerpc/aim/locore32.S b/sys/powerpc/aim/locore32.S
index 020d22d..9ad74fa 100644
--- a/sys/powerpc/aim/locore32.S
+++ b/sys/powerpc/aim/locore32.S
@@ -128,6 +128,17 @@ __start:
sync
isync
+ /* Zero bss, in case we were started by something unhelpful */
+ li 0,0
+ lis 8,_edata@ha
+ addi 8,8,_edata@l
+ lis 9,_end@ha
+ addi 9,9,_end@l
+2: stw 0,0(8)
+ addi 8,8,4
+ cmplw 8,9
+ blt 2b
+
/* Save the argument pointer and length */
mr 20,6
mr 21,7
OpenPOWER on IntegriCloud