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>
This commit is contained in:
Marc Jones
2011-06-28 14:30:05 -06:00
parent 3e706b63c0
commit 55bf2e49d6

View File

@@ -70,10 +70,17 @@ _init:
movl %esp, %esi movl %esp, %esi
/* Store EAX and EBX */ /* Store EAX and EBX */
movl %eax,loader_eax movl %eax,loader_eax
movl %ebx,loader_ebx 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. */ /* Setup new stack. */
movl $_stack, %ebx movl $_stack, %ebx