summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-08-12 13:38:25 +0000
committerThomas Martitz <kugel@rockbox.org>2010-08-12 13:38:25 +0000
commit0e2286f226c8ce66adb846995eb1bf0b4d92a649 (patch)
treeae47cfb8e2440b0b220e57e4c894390b6c1efd7a /firmware
parent70ebe46d74dbb10160a878cdb120c9b3e7a8e30c (diff)
downloadrockbox-0e2286f226c8ce66adb846995eb1bf0b4d92a649.tar.gz
rockbox-0e2286f226c8ce66adb846995eb1bf0b4d92a649.tar.bz2
rockbox-0e2286f226c8ce66adb846995eb1bf0b4d92a649.zip
Introduce NORETURN_ATTR wrapper for __attribute__((noreturn)), using this and a bit further cleanup in main gets rid of a warning when compiling for android.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27788 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/thread.h3
-rw-r--r--firmware/include/gcc_extensions.h7
-rw-r--r--firmware/scroll_engine.c3
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c3
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c3
-rw-r--r--firmware/target/arm/ata-sd-pp.c3
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c5
-rw-r--r--firmware/target/arm/imx31/rolo_restart_firmware.S2
-rw-r--r--firmware/target/arm/s3c2440/sd-s3c2440.c3
-rw-r--r--firmware/target/arm/system-arm.c3
-rw-r--r--firmware/target/arm/tcc780x/sd-tcc780x.c3
-rw-r--r--firmware/target/coldfire/system-coldfire.c3
-rw-r--r--firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c3
13 files changed, 31 insertions, 13 deletions
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index 2853c0b121..c778f2c074 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -25,6 +25,7 @@
#include <inttypes.h>
#include <stddef.h>
#include <stdbool.h>
+#include "gcc_extensions.h"
/* Priority scheduling (when enabled with HAVE_PRIORITY_SCHEDULING) works
* by giving high priority threads more CPU time than lower priority threads
@@ -385,7 +386,7 @@ void thread_thaw(unsigned int thread_id);
/* Wait for a thread to exit */
void thread_wait(unsigned int thread_id);
/* Exit the current thread */
-void thread_exit(void) __attribute__((noreturn));
+void thread_exit(void) NORETURN_ATTR;
#if defined(DEBUG) || defined(ROCKBOX_HAS_LOGF)
#define ALLOW_REMOVE_THREAD
/* Remove a thread from the scheduler */
diff --git a/firmware/include/gcc_extensions.h b/firmware/include/gcc_extensions.h
index a58c2e7e45..f7580f6ddc 100644
--- a/firmware/include/gcc_extensions.h
+++ b/firmware/include/gcc_extensions.h
@@ -43,4 +43,11 @@
#endif
+#if defined(__GNUC__) && (__GNUC__ >= 3 || \
+ (__GNUC__ >= 2 && __GNUC_MINOR__ >= 5))
+#define NORETURN_ATTR __attribute__((noreturn))
+#else
+#define NORETURN_ATTR
+#endif
+
#endif /* _GCC_EXTENSIONS_H_ */
diff --git a/firmware/scroll_engine.c b/firmware/scroll_engine.c
index fb1628a9c4..70bbcbeae1 100644
--- a/firmware/scroll_engine.c
+++ b/firmware/scroll_engine.c
@@ -23,6 +23,7 @@
*
****************************************************************************/
#include "config.h"
+#include "gcc_extensions.h"
#include "cpu.h"
#include "kernel.h"
#include "thread.h"
@@ -257,7 +258,7 @@ static bool scroll_process_message(int delay)
}
#endif /* HAVE_REMOTE_LCD */
-static void scroll_thread(void) __attribute__((noreturn));
+static void scroll_thread(void) NORETURN_ATTR;
#ifdef HAVE_REMOTE_LCD
static void scroll_thread(void)
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index d77c7133b6..ff41ef6215 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -32,6 +32,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "gcc_extensions.h"
#include "as3525.h"
#include "pl180.h" /* SD controller */
#include "pl081.h" /* DMA controller */
@@ -432,7 +433,7 @@ static int sd_init_card(const int drive)
return 0;
}
-static void sd_thread(void) __attribute__((noreturn));
+static void sd_thread(void) NORETURN_ATTR;
static void sd_thread(void)
{
struct queue_event ev;
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 1f8044a18b..e8a0719b11 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -23,6 +23,7 @@
#include "config.h" /* for HAVE_MULTIVOLUME */
#include "fat.h"
#include "thread.h"
+#include "gcc_extensions.h"
#include "led.h"
#include "sdmmc.h"
#include "system.h"
@@ -616,7 +617,7 @@ static int sd_init_card(const int drive)
return 0;
}
-static void sd_thread(void) __attribute__((noreturn));
+static void sd_thread(void) NORETURN_ATTR;
static void sd_thread(void)
{
struct queue_event ev;
diff --git a/firmware/target/arm/ata-sd-pp.c b/firmware/target/arm/ata-sd-pp.c
index a2dcfe518f..914858e464 100644
--- a/firmware/target/arm/ata-sd-pp.c
+++ b/firmware/target/arm/ata-sd-pp.c
@@ -21,6 +21,7 @@
#include "config.h" /* for HAVE_MULTIDRIVE */
#include "fat.h"
#include "sdmmc.h"
+#include "gcc_extensions.h"
#ifdef HAVE_HOTSWAP
#include "sd-pp-target.h"
#endif
@@ -1105,7 +1106,7 @@ sd_write_error:
}
}
-static void sd_thread(void) __attribute__((noreturn));
+static void sd_thread(void) NORETURN_ATTR;
static void sd_thread(void)
{
struct queue_event ev;
diff --git a/firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c
index f458561731..e1894ce0ac 100644
--- a/firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c
+++ b/firmware/target/arm/imx31/gigabeat-s/system-gigabeat-s.c
@@ -21,6 +21,7 @@
#include "kernel.h"
#include "system.h"
+#include "gcc_extensions.h"
#include "panic.h"
#include "avic-imx31.h"
#include "gpio-imx31.h"
@@ -219,9 +220,9 @@ void system_prepare_fw_start(void)
#ifndef BOOTLOADER
void rolo_restart_firmware(const unsigned char *source, unsigned char *dest,
- int length) __attribute__((noreturn));
+ int length) NORETURN_ATTR;
-void __attribute__((noreturn))
+void NORETURN_ATTR
rolo_restart(const unsigned char *source, unsigned char *dest, int length)
{
/* Some housekeeping tasks must be performed for a safe changeover */
diff --git a/firmware/target/arm/imx31/rolo_restart_firmware.S b/firmware/target/arm/imx31/rolo_restart_firmware.S
index 5f24f653e0..45d37d14ef 100644
--- a/firmware/target/arm/imx31/rolo_restart_firmware.S
+++ b/firmware/target/arm/imx31/rolo_restart_firmware.S
@@ -25,7 +25,7 @@
/****************************************************************************
* void rolo_restart_firmware(const unsigned char* source, unsigned char* dest,
- * int length) __attribute__((noreturn));
+ * int length) NORETURN_ATTR;
*/
.section .text, "ax", %progbits
.align 2
diff --git a/firmware/target/arm/s3c2440/sd-s3c2440.c b/firmware/target/arm/s3c2440/sd-s3c2440.c
index d42405db65..4a15835b67 100644
--- a/firmware/target/arm/s3c2440/sd-s3c2440.c
+++ b/firmware/target/arm/s3c2440/sd-s3c2440.c
@@ -24,6 +24,7 @@
#include "sd.h"
#include "system.h"
#include <string.h>
+#include "gcc_extensions.h"
#include "thread.h"
#include "panic.h"
@@ -575,7 +576,7 @@ bool sd_removable(IF_MD_NONVOID(int card_no))
#endif /* HAVE_HOTSWAP */
/*****************************************************************************/
-static void sd_thread(void) __attribute__((noreturn));
+static void sd_thread(void) NORETURN_ATTR;
static void sd_thread(void)
{
struct queue_event ev;
diff --git a/firmware/target/arm/system-arm.c b/firmware/target/arm/system-arm.c
index 01d2ba6e67..8d07347514 100644
--- a/firmware/target/arm/system-arm.c
+++ b/firmware/target/arm/system-arm.c
@@ -23,6 +23,7 @@
#include <stdio.h>
#include "lcd.h"
#include "font.h"
+#include "gcc_extensions.h"
static const char* const uiename[] = {
"Undefined instruction",
@@ -34,7 +35,7 @@ static const char* const uiename[] = {
/* Unexpected Interrupt or Exception handler. Currently only deals with
exceptions, but will deal with interrupts later.
*/
-void __attribute__((noreturn)) UIE(unsigned int pc, unsigned int num)
+void NORETURN_ATTR UIE(unsigned int pc, unsigned int num)
{
#if LCD_DEPTH > 1
lcd_set_backdrop(NULL);
diff --git a/firmware/target/arm/tcc780x/sd-tcc780x.c b/firmware/target/arm/tcc780x/sd-tcc780x.c
index 88ccf187f0..7f17e457c9 100644
--- a/firmware/target/arm/tcc780x/sd-tcc780x.c
+++ b/firmware/target/arm/tcc780x/sd-tcc780x.c
@@ -22,6 +22,7 @@
#include "sd.h"
#include "system.h"
#include <string.h>
+#include "gcc_extensions.h"
#include "sdmmc.h"
#include "storage.h"
#include "led.h"
@@ -642,7 +643,7 @@ sd_write_error:
}
}
-static void sd_thread(void) __attribute__((noreturn));
+static void sd_thread(void) NORETURN_ATTR;
static void sd_thread(void)
{
struct queue_event ev;
diff --git a/firmware/target/coldfire/system-coldfire.c b/firmware/target/coldfire/system-coldfire.c
index ba67daa3a6..75440a23bf 100644
--- a/firmware/target/coldfire/system-coldfire.c
+++ b/firmware/target/coldfire/system-coldfire.c
@@ -20,6 +20,7 @@
****************************************************************************/
#include <stdio.h>
#include "config.h"
+#include "gcc_extensions.h"
#include "adc.h"
#include "system.h"
#include "lcd.h"
@@ -200,7 +201,7 @@ static void system_display_exception_info(unsigned long format,
reliable. The system restarts, but boot often fails with ata error -42. */
}
-static void UIE(void) __attribute__ ((noreturn));
+static void UIE(void) NORETURN_ATTR;
static void UIE(void)
{
asm volatile("subq.l #4,%sp"); /* phony return address - never used */
diff --git a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
index 8fdf7d0287..023835303b 100644
--- a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
@@ -20,6 +20,7 @@
****************************************************************************/
#include "config.h"
+#include "gcc_extensions.h"
#include "jz4740.h"
#include "ata.h"
#include "ata_idle_notify.h"
@@ -47,7 +48,7 @@ static const char sd_thread_name[] = "ata/sd";
static struct event_queue sd_queue;
static struct mutex sd_mtx;
static struct wakeup sd_wakeup;
-static void sd_thread(void) __attribute__((noreturn));
+static void sd_thread(void) NORETURN_ATTR;
static int use_4bit;
static int num_6;