mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 01/12] make reset_cpu a __noreturn function
Date: Tue, 30 Mar 2010 13:06:44 +0200	[thread overview]
Message-ID: <1269947215-18214-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1269947215-18214-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-at91/clocksource.c      |    5 ++++-
 arch/arm/mach-ep93xx/clocksource.c    |    2 +-
 arch/arm/mach-imx/clocksource.c       |    2 +-
 arch/arm/mach-netx/generic.c          |    5 ++++-
 arch/arm/mach-omap/omap3_generic.c    |    2 +-
 arch/arm/mach-s3c24xx/generic.c       |    2 +-
 arch/blackfin/lib/cpu.c               |    5 ++++-
 arch/m68k/mach-mcfv4e/mcf_reset_cpu.c |    2 +-
 arch/ppc/mach-mpc5xxx/cpu.c           |    2 +-
 arch/sandbox/os/common.c              |    2 +-
 arch/x86/mach-i386/reset.c            |    2 +-
 include/common.h                      |    2 +-
 12 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-at91/clocksource.c b/arch/arm/mach-at91/clocksource.c
index 564b560..84df1a1 100644
--- a/arch/arm/mach-at91/clocksource.c
+++ b/arch/arm/mach-at91/clocksource.c
@@ -73,10 +73,13 @@ core_initcall(clocksource_init);
 /*
  * Reset the cpu through the reset controller
  */
-void reset_cpu (ulong ignored)
+void __noreturn reset_cpu (unsigned long ignored)
 {
 	at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY |
 				     AT91_RSTC_PROCRST |
 				     AT91_RSTC_PERRST);
+
+	/* Not reached */
+	while (1);
 }
 EXPORT_SYMBOL(reset_cpu);
diff --git a/arch/arm/mach-ep93xx/clocksource.c b/arch/arm/mach-ep93xx/clocksource.c
index 2a7d90e..3aa8e14 100644
--- a/arch/arm/mach-ep93xx/clocksource.c
+++ b/arch/arm/mach-ep93xx/clocksource.c
@@ -72,7 +72,7 @@ core_initcall(clocksource_init);
 /*
  * Reset the cpu
  */
-void reset_cpu(ulong ignored)
+void __noreturn reset_cpu(unsigned long ignored)
 {
 	struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
 	uint32_t value;
diff --git a/arch/arm/mach-imx/clocksource.c b/arch/arm/mach-imx/clocksource.c
index 09d4318..4b400a0 100644
--- a/arch/arm/mach-imx/clocksource.c
+++ b/arch/arm/mach-imx/clocksource.c
@@ -95,7 +95,7 @@ core_initcall(clocksource_init);
 /*
  * Reset the cpu by setting up the watchdog timer and let it time out
  */
-void reset_cpu (ulong ignored)
+void __noreturn reset_cpu (unsigned long ignored)
 {
 	/* Disable watchdog and set Time-Out field to 0 */
 	WCR = 0x0000;
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c
index 69cf196..de1e1b0 100644
--- a/arch/arm/mach-netx/generic.c
+++ b/arch/arm/mach-netx/generic.c
@@ -137,9 +137,12 @@ failure:
 	return COMMAND_ERROR_USAGE;
 }
 
-void reset_cpu(ulong addr)
+void __noreturn reset_cpu(unsigned long addr)
 {
 	SYSTEM_REG(SYSTEM_RES_CR) = 0x01000008;
+
+	/* Not reached */
+	while (1);
 }
 
 
diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c
index 05c5c19..9893145 100644
--- a/arch/arm/mach-omap/omap3_generic.c
+++ b/arch/arm/mach-omap/omap3_generic.c
@@ -56,7 +56,7 @@
  *
  * @return void
  */
-void reset_cpu(ulong addr)
+void __noreturn reset_cpu(ulong addr)
 {
 	/* FIXME: Enable WDT and cause reset */
 	hang();
diff --git a/arch/arm/mach-s3c24xx/generic.c b/arch/arm/mach-s3c24xx/generic.c
index 2de03ca..372904f 100644
--- a/arch/arm/mach-s3c24xx/generic.c
+++ b/arch/arm/mach-s3c24xx/generic.c
@@ -221,7 +221,7 @@ static int clocksource_init (void)
 }
 core_initcall(clocksource_init);
 
-void reset_cpu(ulong addr)
+void __noreturn reset_cpu(unsigned long addr)
 {
 	/* Disable watchdog */
 	writew(0x0000, WTCON);
diff --git a/arch/blackfin/lib/cpu.c b/arch/blackfin/lib/cpu.c
index e81fa9a..f96d22d 100644
--- a/arch/blackfin/lib/cpu.c
+++ b/arch/blackfin/lib/cpu.c
@@ -32,7 +32,7 @@
 #include <asm/cpu.h>
 #include <init.h>
 
-void reset_cpu(ulong ignored)
+void __noreturn reset_cpu(ulong ignored)
 {
 	icache_disable();
 
@@ -43,6 +43,9 @@ void reset_cpu(ulong ignored)
 	:
 	: "r" (L1_ISRAM)
 	);
+
+	/* Not reached */
+	while (1);
 }
 
 void icache_disable(void)
diff --git a/arch/m68k/mach-mcfv4e/mcf_reset_cpu.c b/arch/m68k/mach-mcfv4e/mcf_reset_cpu.c
index c7b77ab..3b1a25b 100644
--- a/arch/m68k/mach-mcfv4e/mcf_reset_cpu.c
+++ b/arch/m68k/mach-mcfv4e/mcf_reset_cpu.c
@@ -27,7 +27,7 @@
 /**
  * Reset the cpu by setting up the watchdog timer and let it time out
  */
-void reset_cpu (ulong ignored)
+void __noreturn reset_cpu (unsigned long ignored)
 {
         while ( ignored ) { ; };
 
diff --git a/arch/ppc/mach-mpc5xxx/cpu.c b/arch/ppc/mach-mpc5xxx/cpu.c
index 59b1538..7ee1954 100644
--- a/arch/ppc/mach-mpc5xxx/cpu.c
+++ b/arch/ppc/mach-mpc5xxx/cpu.c
@@ -71,7 +71,7 @@ int checkcpu (void)
 
 /* ------------------------------------------------------------------------- */
 
-void reset_cpu (ulong unused)
+void __noreturn reset_cpu (unsigned long unused)
 {
 	ulong msr;
 	/* Interrupts and MMU off */
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index d63a2f4..acfa35e 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -137,7 +137,7 @@ uint64_t linux_get_time(void)
 	return now;
 }
 
-int reset_cpu(int unused)
+void __attribute__((noreturn)) reset_cpu(int unused)
 {
 	cookmode();
 	exit(0);
diff --git a/arch/x86/mach-i386/reset.c b/arch/x86/mach-i386/reset.c
index a4eb364..cdd970e 100644
--- a/arch/x86/mach-i386/reset.c
+++ b/arch/x86/mach-i386/reset.c
@@ -25,7 +25,7 @@
 
 #include <common.h>
 
-void reset_cpu(ulong addr)
+void __noreturn reset_cpu(unsigned long addr)
 {
 	/** How to reset the machine? */
 	while(1)
diff --git a/include/common.h b/include/common.h
index 76e9be9..3b3d2de 100644
--- a/include/common.h
+++ b/include/common.h
@@ -80,7 +80,7 @@ int	readline	(const char *prompt, char *buf, int len);
 long	get_ram_size  (volatile long *, long);
 
 /* $(CPU)/cpu.c */
-void	reset_cpu     (ulong addr);
+void __noreturn reset_cpu(unsigned long addr);
 
 /* $(CPU)/interrupts.c */
 //void	timer_interrupt	   (struct pt_regs *);
-- 
1.7.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2010-03-30 11:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30 11:06 More patches for next merge window Sascha Hauer
2010-03-30 11:06 ` Sascha Hauer [this message]
2010-03-30 11:06 ` [PATCH 02/12] make panic and hang __noreturn functions Sascha Hauer
2010-03-30 11:06 ` [PATCH 03/12] introduce a arch_shutdown call and call it from shutdown_barebox Sascha Hauer
2010-03-30 11:06 ` [PATCH 04/12] blackfin: implement arch_shutdown call Sascha Hauer
2010-03-30 11:06 ` [PATCH 05/12] go command: shutdown barebox before calling an application Sascha Hauer
2010-03-30 11:06 ` [PATCH 06/12] remove now unused arch_execute Sascha Hauer
2010-03-30 11:06 ` [PATCH 07/12] ARM: replace cleanup_before_linux with the generic shutdown_barebox function Sascha Hauer
2010-03-30 11:06 ` [PATCH 08/12] pass arguments to dma_* as unsigned long as the kernel does Sascha Hauer
2010-03-30 11:06 ` [PATCH 09/12] ARM: Add a wrapper around dma_* functions Sascha Hauer
2010-03-30 11:06 ` [PATCH 10/12] add l2x0 cache support Sascha Hauer
2010-03-30 11:06 ` [PATCH 11/12] pcm043: enable l2x0 cache Sascha Hauer
2010-03-30 11:06 ` [PATCH 12/12] netx eth driver: remove local definition of ARRAY_SIZE Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1269947215-18214-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox