summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Jones <marcj303@gmail.com>2011-06-28 14:30:05 -0600
committerMarc Jones <marcj303@gmail.com>2011-06-29 03:31:04 +0200
commit55bf2e49d66af779e3e514db1bd716b354329559 (patch)
tree69046216d35f648b62984ec2d2f5d9587359c55c
parent3e706b63c03b4d1d64a21f4c26eaa12fc88cb1f8 (diff)
Libpayload needs to clear the bss region.
Libpayload shouldn't count on coreboot or other payloads to clear memory. This fixes problems with payloads being loaded after or on top of each other. Change-Id: I30303d47e465e8921f47acab667c7998ba79fca7 Signed-off-by: Marc Jones <marcj303@gmail.com> Reviewed-on: http://review.coreboot.org/66 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r--payloads/libpayload/arch/i386/head.S9
1 files changed, 8 insertions, 1 deletions
diff --git a/payloads/libpayload/arch/i386/head.S b/payloads/libpayload/arch/i386/head.S
index db18a5195f..88db4124d5 100644
--- a/payloads/libpayload/arch/i386/head.S
+++ b/payloads/libpayload/arch/i386/head.S
@@ -70,10 +70,17 @@ _init:
movl %esp, %esi
/* Store EAX and EBX */
-
movl %eax,loader_eax
movl %ebx,loader_ebx
+ /* Clear the bss */
+ cld
+ movl $.bss, %edi
+ movl $_end, %ecx
+ subl %edi, %ecx
+ xor %ax, %ax
+ rep stosb
+
/* Setup new stack. */
movl $_stack, %ebx