diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-03-30 10:16:47 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-03-30 14:15:03 +0200 |
commit | e11c07c33994383052f041dd5551b80bee4fb6f3 (patch) | |
tree | 2e8e7c4f7e90f7268b0153baea8fede139e6309a | |
parent | 6eb741a2e1e8a956097ea59dfe573727ff11160f (diff) | |
download | barebox-e11c07c33994383052f041dd5551b80bee4fb6f3.tar.gz barebox-e11c07c33994383052f041dd5551b80bee4fb6f3.tar.xz |
make reset_cpu a __noreturn function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-at91/clocksource.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/clocksource.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/clocksource.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-netx/generic.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap/omap3_generic.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/generic.c | 2 | ||||
-rw-r--r-- | arch/blackfin/lib/cpu.c | 5 | ||||
-rw-r--r-- | arch/m68k/mach-mcfv4e/mcf_reset_cpu.c | 2 | ||||
-rw-r--r-- | arch/ppc/mach-mpc5xxx/cpu.c | 2 | ||||
-rw-r--r-- | arch/sandbox/os/common.c | 2 | ||||
-rw-r--r-- | arch/x86/mach-i386/reset.c | 2 | ||||
-rw-r--r-- | 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 564b5600..84df1a13 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 2a7d90e4..3aa8e14a 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 09d43183..4b400a0c 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 69cf196c..de1e1b04 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 05c5c198..98931457 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 2de03ca8..372904f8 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 e81fa9a6..f96d22da 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 c7b77abc..3b1a25b2 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 59b1538c..7ee1954b 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 d63a2f40..acfa35e0 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 a4eb3648..cdd970e5 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 76e9be9c..3b3d2de8 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 *); |