summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/start/start.s
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-02-06 13:47:09 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-02-06 13:47:09 +0000
commitf02ffcaa6a28b7d1a80e6665ab7d3eba37ff243e (patch)
tree91f77f7dac07190a87d369d35356508312a505cd /c/src/lib/libbsp/i386/pc386/start/start.s
parentAdded code to more correctly process abstract types (handle, range, etc). (diff)
downloadrtems-f02ffcaa6a28b7d1a80e6665ab7d3eba37ff243e.tar.bz2
Problem report from Brian Cuthie regarding incorrect calculation
of BSS size. The conversion from a count of u8's to a count of u32's was shifting in the wrong direction. This error had been in the start code a long time. It had not caused problems because the BSS is typically much smaller than the C heap which typically follows it in memory. Plus since this code was executed at start time, all that really happened was an extra zeroing of some memory.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/start.s3
1 files changed, 2 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/start/start.s b/c/src/lib/libbsp/i386/pc386/start/start.s
index bdf74731c6..0c44cd9e36 100644
--- a/c/src/lib/libbsp/i386/pc386/start/start.s
+++ b/c/src/lib/libbsp/i386/pc386/start/start.s
@@ -165,7 +165,8 @@ SYM (zero_bss):
movl $ SYM (_end), ecx # find end of .bss
movl $ SYM (_bss_start), edi # edi = beginning of .bss
subl edi, ecx # ecx = size of .bss in bytes
- shll ecx # size of .bss in longs
+ shrl ecx # size of .bss in longs
+ shrl ecx
xorl eax, eax # value to clear out memory
repne # while ecx != 0
stosl # clear a long in the bss