From: Simon Glass Date: Fri, 10 Oct 2014 07:49:15 -0600 Subject: [U-Boot] [PATCH 3/8] dm: x86: Zero global data before board_init_f() In-Reply-To: <1412948960-11941-1-git-send-email-sjg@chromium.org> References: <1412948960-11941-1-git-send-email-sjg@chromium.org> Message-ID: <1412948960-11941-4-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de To permit information to be passed from the early U-Boot code to board_init_f() we cannot zero the global_data in board_init_f(). Instead zero it in the start-up code. Signed-off-by: Simon Glass --- arch/x86/cpu/start.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S index 329bb3a..71cab22 100644 --- a/arch/x86/cpu/start.S +++ b/arch/x86/cpu/start.S @@ -85,6 +85,12 @@ car_init_ret: /* Align global data to 16-byte boundary */ andl $0xfffffff0, %esp + /* Zero the global data since it won't happen later */ + xorl %eax, %eax + movl $GENERATED_GBL_DATA_SIZE, %ecx + movl %esp, %edi + rep stosb + /* Setup first parameter to setup_gdt */ movl %esp, %eax -- 2.1.0.rc2.206.gedb03e5