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>
movl %esp, %esi
/* Store EAX and EBX */
movl %esp, %esi
/* Store EAX and EBX */
movl %eax,loader_eax
movl %ebx,loader_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
/* Setup new stack. */
movl $_stack, %ebx