From patchwork Thu Jul 5 14:35:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: seedshope X-Patchwork-Id: 169192 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 898352C01FA for ; Fri, 6 Jul 2012 00:35:39 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ABA68280A2; Thu, 5 Jul 2012 16:35:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6Fzj8bX+Y0wz; Thu, 5 Jul 2012 16:35:37 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2D9E02809A; Thu, 5 Jul 2012 16:35:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0026A2809A for ; Thu, 5 Jul 2012 16:35:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8MBDbArt+JYR for ; Thu, 5 Jul 2012 16:35:32 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-gh0-f172.google.com (mail-gh0-f172.google.com [209.85.160.172]) by theia.denx.de (Postfix) with ESMTPS id E7CE728096 for ; Thu, 5 Jul 2012 16:35:30 +0200 (CEST) Received: by ghbg16 with SMTP id g16so7313789ghb.3 for ; Thu, 05 Jul 2012 07:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=IDy5Doc0UB9k5tBzhQ1VK8p+owMBecpq+ULJ0uxaOHE=; b=OaNsEoaDZZkbVpDCKl/jt1FdbYuB2qKo79kLdKJmCkz/b9HqM7euvTbVR8o7Zdoa94 ZaUNQzqIt7bmIvm5N55eyW6oATAeZPlV1/xuSe8+Whxhx7XLugy1xdifGKInee8ylbuu VR14dQngDDgHsW9iyaqFf0ao14Wl8Gb+gFaziSFZu/CVjdyfpPns9M1kmXqhybj4UVUJ GWDM4CQ+36Biqr5AXHRekKBBOvO+KafS8Hiu3kQ1vk5EMuBdsFO7TAR9vAhlT+UmEsP6 glg+/HmXX0a2AyRTfEIGVQGcDLRVI+1HmjWC8tXNrnIv4Tm1oCda11xb5mGtJln4M+VF rAxg== Received: by 10.66.76.231 with SMTP id n7mr37764190paw.68.1341498927416; Thu, 05 Jul 2012 07:35:27 -0700 (PDT) Received: from localhost.localdomain ([221.221.30.132]) by mx.google.com with ESMTPS id pp2sm19117376pbb.1.2012.07.05.07.35.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Jul 2012 07:35:26 -0700 (PDT) From: Zhong Hongbo To: Albert ARIBAUD Date: Thu, 5 Jul 2012 22:35:15 +0800 Message-Id: <1341498915-19127-1-git-send-email-bocui107@gmail.com> X-Mailer: git-send-email 1.7.5.4 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] armv7: Fix to mistake clean the memory space X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Zhong Hongbo In currently, when __bss_start is equal to __bss_end__, The bss loop will clear all the things in memory space. But just only when __bss_end__ greater than __bss_start__, we do the clear bss section operation. Signed-off-by: Hongbo Zhong --- arch/arm/cpu/armv7/start.S | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index 22a3ced..2e583ee 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -259,10 +259,13 @@ clear_bss: #endif mov r2, #0x00000000 /* clear */ -clbss_l:str r2, [r0] /* clear loop... */ +clbss_l: + cmp r1, r0 + bls clbss_end + str r2, [r0] /* clear loop... */ add r0, r0, #4 - cmp r0, r1 - bne clbss_l + b clbss_l +clbss_end: /* * We are done. Do not return, instead branch to second part of board