From patchwork Tue Apr 16 10:14:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 236943 X-Patchwork-Delegate: wd@denx.de 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 E74912C0118 for ; Tue, 16 Apr 2013 21:27:21 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 179A54A1E6; Tue, 16 Apr 2013 13:27:20 +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 SQlVMm1vhco9; Tue, 16 Apr 2013 13:27:19 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 314B34A1CD; Tue, 16 Apr 2013 13:27:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 76D534A1C2 for ; Tue, 16 Apr 2013 12:13:25 +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 dgeeXlioS7Do for ; Tue, 16 Apr 2013 12:13:21 +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-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by theia.denx.de (Postfix) with ESMTPS id 19E024A1BE for ; Tue, 16 Apr 2013 12:13:19 +0200 (CEST) Received: by mail-wi0-f170.google.com with SMTP id hm11so2501484wib.3 for ; Tue, 16 Apr 2013 03:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=AdczuGYZtPzZnvDmBfhkjYTwX7MCvmz7RlVxBVYiZRE=; b=JCP7o3BjBl3hYX+rv83V9CvalW0WksbQWxOFpVgkcCp3DVbDtSOwLauBTcqP+Ajdjv 7YNQQxOMuBCkQYHXpLUj7uXb61M/ZThm+bxH4BOrtETSkwl9+dzKxfyg0bwe+paQdTZb t1KGLqiMavDxAlNynzgk9fg6wvrfH+bVX4t+W0fcMzoDUZJNI4rMQeD4LEjX6Lh7ubmF IrHaUPEAVHBTR1iUraWqGaT4a9J6i2R8nZm0qTCQqLSgGmv/pl7YQMiEpO0/WQbI5UT9 XaCQVoA65hvCfMg4XDeM+nP2vORWXJT4Lmf2HMRSmlb+YsvfEjRnCFc1IKYGWQ2qNRez s66w== X-Received: by 10.180.79.227 with SMTP id m3mr2582933wix.12.1366107197955; Tue, 16 Apr 2013 03:13:17 -0700 (PDT) Received: from localhost ([2a01:198:47b:1:210:75ff:fe1a:cd1e]) by mx.google.com with ESMTPS id bq19sm1936656wib.7.2013.04.16.03.13.14 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 16 Apr 2013 03:13:16 -0700 (PDT) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: U-Boot Mailing List Date: Tue, 16 Apr 2013 12:14:09 +0200 Message-Id: <1366107249-24547-1-git-send-email-andreas.devel@googlemail.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 16 Apr 2013 13:27:12 +0200 Cc: Scott McNutt , Kim Phillips , Shinya Kuribayashi , Graeme Russ , Kumar Gala , Macpaul Lin , Andy Fleming , Stefan Roese Subject: [U-Boot] [PATCH] make hang() a weak function 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This patch also does some minor coding style cleanups. Signed-off-by: Andreas Bießmann Tested-by: Wolfgang Denk Acked-by: Wolfgang Denk Tested-by: Simon Glass Acked-by: Simon Glass --- arch/arm/lib/board.c | 3 ++- arch/avr32/lib/board.c | 3 ++- arch/blackfin/lib/board.c | 3 ++- arch/m68k/lib/board.c | 3 ++- arch/microblaze/lib/board.c | 5 +++-- arch/mips/lib/board.c | 3 ++- arch/nds32/lib/board.c | 3 ++- arch/nios2/lib/board.c | 5 +++-- arch/openrisc/lib/board.c | 3 ++- arch/powerpc/lib/board.c | 4 ++-- arch/sandbox/lib/board.c | 3 ++- arch/sh/lib/board.c | 3 ++- arch/sparc/lib/board.c | 3 ++- arch/x86/lib/board.c | 3 ++- common/board_f.c | 3 ++- common/spl/spl.c | 3 ++- drivers/mtd/nand/mxc_nand_spl.c | 3 ++- 17 files changed, 36 insertions(+), 20 deletions(-) diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 0521178..4a00e16 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -707,8 +707,9 @@ void board_init_r(gd_t *id, ulong dest_addr) /* NOTREACHED - no way out of command loop except booting */ } -void hang(void) +void __hang(void) { puts("### ERROR ### Please RESET the board ###\n"); for (;;); } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index 57e07df..7e3380a 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -120,10 +120,11 @@ static int display_banner (void) return 0; } -void hang(void) +void __hang(void) { for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); static int display_dram_config (void) { diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 75b6c46..7769962 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -433,7 +433,7 @@ void board_init_r(gd_t * id, ulong dest_addr) main_loop(); } -void hang(void) +void __hang(void) { #ifdef CONFIG_STATUS_LED status_led_set(STATUS_LED_BOOT, STATUS_LED_OFF); @@ -446,3 +446,4 @@ void hang(void) */ asm("emuexcpt;"); } +void hang(void) __attribute__((weak, alias("__hang")); diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c index adaccfe..93aeafb 100644 --- a/arch/m68k/lib/board.c +++ b/arch/m68k/lib/board.c @@ -665,8 +665,9 @@ void board_init_r (gd_t *id, ulong dest_addr) } -void hang(void) +void __hang(void) { puts ("### ERROR ### Please RESET the board ###\n"); for (;;); } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c index a7c2f76..e661704 100644 --- a/arch/microblaze/lib/board.c +++ b/arch/microblaze/lib/board.c @@ -195,8 +195,9 @@ void board_init_f(ulong not_used) } } -void hang (void) +void __hang(void) { - puts ("### ERROR ### Please RESET the board ###\n"); + puts("### ERROR ### Please RESET the board ###\n"); for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index f19f198..ad18440 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -345,9 +345,10 @@ void board_init_r(gd_t *id, ulong dest_addr) /* NOTREACHED - no way out of command loop except booting */ } -void hang(void) +void __hang(void) { puts("### ERROR ### Please RESET the board ###\n"); for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c index a7d27fc..2433d8a 100644 --- a/arch/nds32/lib/board.c +++ b/arch/nds32/lib/board.c @@ -405,9 +405,10 @@ void board_init_r(gd_t *id, ulong dest_addr) /* NOTREACHED - no way out of command loop except booting */ } -void hang(void) +void __hang(void) { puts("### ERROR ### Please RESET the board ###\n"); for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/arch/nios2/lib/board.c b/arch/nios2/lib/board.c index 1e495d4..517a3a1 100644 --- a/arch/nios2/lib/board.c +++ b/arch/nios2/lib/board.c @@ -168,9 +168,10 @@ void board_init (void) /***********************************************************************/ -void hang (void) +void __hang(void) { - disable_interrupts (); + disable_interrupts(); puts("### ERROR ### Please reset board ###\n"); for (;;); } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/arch/openrisc/lib/board.c b/arch/openrisc/lib/board.c index 85aa189..c5437db 100644 --- a/arch/openrisc/lib/board.c +++ b/arch/openrisc/lib/board.c @@ -158,7 +158,7 @@ void board_init(void) /***********************************************************************/ -void hang(void) +void __hang(void) { disable_interrupts(); puts("### ERROR ### Please reset board ###\n"); @@ -166,3 +166,4 @@ void hang(void) for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index 422b4a3..24bb948 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -1050,14 +1050,14 @@ void board_init_r(gd_t *id, ulong dest_addr) /* NOTREACHED - no way out of command loop except booting */ } -void hang(void) +void __hang(void) { puts("### ERROR ### Please RESET the board ###\n"); bootstage_error(BOOTSTAGE_ID_NEED_RESET); for (;;) ; } - +void hang(void) __attribute__((weak, alias("__hang"))); #if 0 /* We could use plain global data, but the resulting code is bigger */ /* diff --git a/arch/sandbox/lib/board.c b/arch/sandbox/lib/board.c index 3752fab..fe10e6c 100644 --- a/arch/sandbox/lib/board.c +++ b/arch/sandbox/lib/board.c @@ -277,9 +277,10 @@ void board_init_r(gd_t *id, ulong dest_addr) /* NOTREACHED - no way out of command loop except booting */ } -void hang(void) +void __hang(void) { puts("### ERROR ### Please RESET the board ###\n"); for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index 6e43acf..60be847 100644 --- a/arch/sh/lib/board.c +++ b/arch/sh/lib/board.c @@ -203,9 +203,10 @@ void sh_generic_init(void) /***********************************************************************/ -void hang(void) +void __hang(void) { puts("Board ERROR\n"); for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c index 79fb4c8..ddd735c 100644 --- a/arch/sparc/lib/board.c +++ b/arch/sparc/lib/board.c @@ -411,7 +411,7 @@ void board_init_f(ulong bootflag) } -void hang(void) +void __hang(void) { puts("### ERROR ### Please RESET the board ###\n"); #ifdef CONFIG_SHOW_BOOT_PROGRESS @@ -419,5 +419,6 @@ void hang(void) #endif for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); /************************************************************************/ diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index f372898..960f323 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -265,9 +265,10 @@ void board_init_r(gd_t *id, ulong dest_addr) /* NOTREACHED - no way out of command loop except booting */ } -void hang(void) +void __hang(void) { puts("### ERROR ### Please RESET the board ###\n"); for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/common/board_f.c b/common/board_f.c index 7698891..d811067 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -1005,8 +1005,9 @@ void board_init_f_r(void) } #endif /* CONFIG_X86 */ -void hang(void) +void __hang(void) { puts("### ERROR ### Please RESET the board ###\n"); for (;;); } +void hang(void) __attribute__((weak, alias("__hang"))); diff --git a/common/spl/spl.c b/common/spl/spl.c index 6715e0d..322b7b8 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -48,12 +48,13 @@ struct spl_image_info spl_image; /* Define board data structure */ static bd_t bdata __attribute__ ((section(".data"))); -inline void hang(void) +inline void __hang(void) { puts("### ERROR ### Please RESET the board ###\n"); for (;;) ; } +void hang(void) __attribute__((weak, alias("__hang"))); /* * Default function to determine if u-boot or the OS should diff --git a/drivers/mtd/nand/mxc_nand_spl.c b/drivers/mtd/nand/mxc_nand_spl.c index 09f23c3..9738045 100644 --- a/drivers/mtd/nand/mxc_nand_spl.c +++ b/drivers/mtd/nand/mxc_nand_spl.c @@ -359,8 +359,9 @@ void nand_boot(void) /* * Called in case of an exception. */ -void hang(void) +void __hang(void) { /* Loop forever */ while (1) ; } +void hang(void) __attribute__((weak, alias("__hang")));