From patchwork Fri Jul 9 05:03:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 58327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id E5644B70A6 for ; Fri, 9 Jul 2010 15:10:31 +1000 (EST) Received: by ozlabs.org (Postfix, from userid 1010) id 89EEBB6F19; Fri, 9 Jul 2010 15:10:30 +1000 (EST) Message-Id: <20100709050341.715323729@samba.org> User-Agent: quilt/0.48-1 Date: Fri, 09 Jul 2010 15:03:34 +1000 From: Anton Blanchard To: yaboot-devel@lists.ozlabs.org Subject: [patch 04/14] Remove second zero of BSS References: <20100709050330.507659708@samba.org> Content-Disposition: inline; filename=remove_double_bss_clear_v2 X-BeenThere: yaboot-devel@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Errors-To: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org We zero the BSS in two places: once in _start() and then again in yaboot_start(). The second time we actually get it wrong and zero 1/4 of the BSS (since we subtract two pointers). Since this second zeroing is superfluous and buggy, remove it. While here, fix the comments in _start. It claims we aren't clearing the BSS when we are. Signed-off-by: Anton Blanchard Index: yaboot/second/yaboot.c =================================================================== --- yaboot.orig/second/yaboot.c 2010-07-08 16:17:23.000000000 +1000 +++ yaboot/second/yaboot.c 2010-07-08 16:17:43.000000000 +1000 @@ -157,11 +157,6 @@ extern unsigned char linux_logo_blue[]; #define DEFAULT_TIMEOUT -1 -/* Entry, currently called directly by crt0 (bss not inited) */ - -extern char* __bss_start; -extern char* _end; - int yaboot_start (unsigned long r3, unsigned long r4, unsigned long r5) { @@ -169,9 +164,6 @@ yaboot_start (unsigned long r3, unsigned void* malloc_base = NULL; prom_handle root; - /* OF seems to do it, but I'm not very confident */ - memset(&__bss_start, 0, &_end - &__bss_start); - /* Initialize OF interface */ prom_init ((prom_entry) r5); Index: yaboot/second/crt0.S =================================================================== --- yaboot.orig/second/crt0.S 2010-07-08 16:17:48.000000000 +1000 +++ yaboot/second/crt0.S 2010-07-08 16:18:16.000000000 +1000 @@ -2,7 +2,7 @@ #include "asm/processor.h" /* - * Main entry point. should add code to clear BSS and more ... + * Main entry point. We zero the BSS then jump to yaboot_start. */ _GLOBAL(_start) lis r10,edata@h