diff options
author | Boris Gjenero <dreamlayers@rockbox.org> | 2011-12-09 15:33:59 +0000 |
---|---|---|
committer | Boris Gjenero <dreamlayers@rockbox.org> | 2011-12-09 15:33:59 +0000 |
commit | 59e71ee80c65426b2f569cc4c60936053cc9caa5 (patch) | |
tree | 0b4c61bbd10fbb1fd3c00a877f4a9df6338496e9 /firmware | |
parent | 9653ae364cc8b558c846d3391e3ef9eb843d2385 (diff) | |
download | rockbox-59e71ee80c65426b2f569cc4c60936053cc9caa5.tar.gz rockbox-59e71ee80c65426b2f569cc4c60936053cc9caa5.zip |
Introduce USED_ATTR wrapper for __attribute__((used)).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31188 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/include/gcc_extensions.h | 9 | ||||
-rw-r--r-- | firmware/target/arm/imx31/dvfs_dptc-imx31.c | 3 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/system-s3c2440.c | 3 | ||||
-rw-r--r-- | firmware/target/arm/thread-arm.c | 4 | ||||
-rw-r--r-- | firmware/target/arm/thread-pp.c | 4 | ||||
-rw-r--r-- | firmware/target/coldfire/system-coldfire.c | 2 | ||||
-rw-r--r-- | firmware/target/coldfire/thread-coldfire.c | 4 | ||||
-rw-r--r-- | firmware/target/hosted/thread-arm.c | 4 | ||||
-rw-r--r-- | firmware/target/mips/thread-mips32.c | 4 | ||||
-rw-r--r-- | firmware/target/sh/thread-sh.c | 4 | ||||
-rw-r--r-- | firmware/thread.c | 4 |
11 files changed, 35 insertions, 10 deletions
diff --git a/firmware/include/gcc_extensions.h b/firmware/include/gcc_extensions.h index 7109edaaf6..2735d6e7b6 100644 --- a/firmware/include/gcc_extensions.h +++ b/firmware/include/gcc_extensions.h | |||
@@ -57,4 +57,13 @@ | |||
57 | #define FORCE_INLINE inline | 57 | #define FORCE_INLINE inline |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | |||
61 | /* Version information from http://ohse.de/uwe/articles/gcc-attributes.html */ | ||
62 | #if defined(__GNUC__) && (__GNUC__ >= 4 || \ | ||
63 | (__GNUC__ >= 3 && __GNUC_MINOR__ >= 1)) | ||
64 | #define USED_ATTR __attribute__((used)) | ||
65 | #else | ||
66 | #define USED_ATTR | ||
67 | #endif | ||
68 | |||
60 | #endif /* _GCC_EXTENSIONS_H_ */ | 69 | #endif /* _GCC_EXTENSIONS_H_ */ |
diff --git a/firmware/target/arm/imx31/dvfs_dptc-imx31.c b/firmware/target/arm/imx31/dvfs_dptc-imx31.c index e8dee17416..02955a5aa4 100644 --- a/firmware/target/arm/imx31/dvfs_dptc-imx31.c +++ b/firmware/target/arm/imx31/dvfs_dptc-imx31.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "avic-imx31.h" | 29 | #include "avic-imx31.h" |
30 | #include "dvfs_dptc-imx31.h" | 30 | #include "dvfs_dptc-imx31.h" |
31 | #include "dvfs_dptc_tables-target.h" | 31 | #include "dvfs_dptc_tables-target.h" |
32 | #include "gcc_extensions.h" | ||
32 | 33 | ||
33 | /* Most of the code in here is based upon the Linux BSP provided by Freescale | 34 | /* Most of the code in here is based upon the Linux BSP provided by Freescale |
34 | * Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved. */ | 35 | * Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved. */ |
@@ -181,7 +182,7 @@ static void set_current_dvfs_level(unsigned int level) | |||
181 | } | 182 | } |
182 | 183 | ||
183 | /* DVFS Interrupt handler */ | 184 | /* DVFS Interrupt handler */ |
184 | static void __attribute__((used)) dvfs_int(void) | 185 | static void USED_ATTR dvfs_int(void) |
185 | { | 186 | { |
186 | unsigned long pmcr0 = CCM_PMCR0; | 187 | unsigned long pmcr0 = CCM_PMCR0; |
187 | unsigned long fsvai = pmcr0 & CCM_PMCR0_FSVAI; | 188 | unsigned long fsvai = pmcr0 & CCM_PMCR0_FSVAI; |
diff --git a/firmware/target/arm/s3c2440/system-s3c2440.c b/firmware/target/arm/s3c2440/system-s3c2440.c index 577b46966c..1e5613f7b6 100644 --- a/firmware/target/arm/s3c2440/system-s3c2440.c +++ b/firmware/target/arm/s3c2440/system-s3c2440.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "panic.h" | 23 | #include "panic.h" |
24 | #include "mmu-arm.h" | 24 | #include "mmu-arm.h" |
25 | #include "cpu.h" | 25 | #include "cpu.h" |
26 | #include "gcc_extensions.h" | ||
26 | 27 | ||
27 | #define default_interrupt(name) \ | 28 | #define default_interrupt(name) \ |
28 | extern __attribute__((weak,alias("UIRQ"))) void name (void) | 29 | extern __attribute__((weak,alias("UIRQ"))) void name (void) |
@@ -60,7 +61,7 @@ default_interrupt(SPI1); | |||
60 | default_interrupt(RTC); | 61 | default_interrupt(RTC); |
61 | default_interrupt(ADC); | 62 | default_interrupt(ADC); |
62 | 63 | ||
63 | static void (* const irqvector[32])(void) __attribute__((__used__)) = | 64 | static void (* const irqvector[32])(void) USED_ATTR = |
64 | { | 65 | { |
65 | EINT0, EINT1, EINT2, EINT3, | 66 | EINT0, EINT1, EINT2, EINT3, |
66 | EINT4_7, EINT8_23, CAM, nBATT_FLT, TICK, WDT_AC97, | 67 | EINT4_7, EINT8_23, CAM, nBATT_FLT, TICK, WDT_AC97, |
diff --git a/firmware/target/arm/thread-arm.c b/firmware/target/arm/thread-arm.c index 60bbefa6b6..302b1592d8 100644 --- a/firmware/target/arm/thread-arm.c +++ b/firmware/target/arm/thread-arm.c | |||
@@ -21,11 +21,13 @@ | |||
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | 23 | ||
24 | #include "gcc_extensions.h" | ||
25 | |||
24 | /*--------------------------------------------------------------------------- | 26 | /*--------------------------------------------------------------------------- |
25 | * Start the thread running and terminate it if it returns | 27 | * Start the thread running and terminate it if it returns |
26 | *--------------------------------------------------------------------------- | 28 | *--------------------------------------------------------------------------- |
27 | */ | 29 | */ |
28 | static void __attribute__((naked,used)) start_thread(void) | 30 | static void __attribute__((naked)) USED_ATTR start_thread(void) |
29 | { | 31 | { |
30 | /* r0 = context */ | 32 | /* r0 = context */ |
31 | asm volatile ( | 33 | asm volatile ( |
diff --git a/firmware/target/arm/thread-pp.c b/firmware/target/arm/thread-pp.c index 3eb7238a25..5e834bc6ad 100644 --- a/firmware/target/arm/thread-pp.c +++ b/firmware/target/arm/thread-pp.c | |||
@@ -21,6 +21,8 @@ | |||
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | 23 | ||
24 | #include "gcc_extensions.h" | ||
25 | |||
24 | #if defined(MAX_PHYS_SECTOR_SIZE) && MEMORYSIZE == 64 | 26 | #if defined(MAX_PHYS_SECTOR_SIZE) && MEMORYSIZE == 64 |
25 | /* Support a special workaround object for large-sector disks */ | 27 | /* Support a special workaround object for large-sector disks */ |
26 | #define IF_NO_SKIP_YIELD(...) __VA_ARGS__ | 28 | #define IF_NO_SKIP_YIELD(...) __VA_ARGS__ |
@@ -546,7 +548,7 @@ void core_wake(unsigned int othercore) | |||
546 | #endif /* CPU_PPxxxx */ | 548 | #endif /* CPU_PPxxxx */ |
547 | 549 | ||
548 | /* Keep constant pool in range of inline ASM */ | 550 | /* Keep constant pool in range of inline ASM */ |
549 | static void __attribute__((naked, used)) dump_ltorg(void) | 551 | static void __attribute__((naked)) USED_ATTR dump_ltorg(void) |
550 | { | 552 | { |
551 | asm volatile (".ltorg"); | 553 | asm volatile (".ltorg"); |
552 | } | 554 | } |
diff --git a/firmware/target/coldfire/system-coldfire.c b/firmware/target/coldfire/system-coldfire.c index 1fbd00825a..bc8c78b860 100644 --- a/firmware/target/coldfire/system-coldfire.c +++ b/firmware/target/coldfire/system-coldfire.c | |||
@@ -171,7 +171,7 @@ default_interrupt (ADC); /* A/D converter */ | |||
171 | #endif | 171 | #endif |
172 | 172 | ||
173 | static void system_display_exception_info(unsigned long format, | 173 | static void system_display_exception_info(unsigned long format, |
174 | unsigned long pc) __attribute__ ((noreturn, used)); | 174 | unsigned long pc) __attribute__ ((noreturn)) USED_ATTR; |
175 | static void system_display_exception_info(unsigned long format, | 175 | static void system_display_exception_info(unsigned long format, |
176 | unsigned long pc) | 176 | unsigned long pc) |
177 | { | 177 | { |
diff --git a/firmware/target/coldfire/thread-coldfire.c b/firmware/target/coldfire/thread-coldfire.c index c94580a4e7..d328e4af9a 100644 --- a/firmware/target/coldfire/thread-coldfire.c +++ b/firmware/target/coldfire/thread-coldfire.c | |||
@@ -21,12 +21,14 @@ | |||
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | 23 | ||
24 | #include "gcc_extensions.h" | ||
25 | |||
24 | /*--------------------------------------------------------------------------- | 26 | /*--------------------------------------------------------------------------- |
25 | * Start the thread running and terminate it if it returns | 27 | * Start the thread running and terminate it if it returns |
26 | *--------------------------------------------------------------------------- | 28 | *--------------------------------------------------------------------------- |
27 | */ | 29 | */ |
28 | void start_thread(void); /* Provide C access to ASM label */ | 30 | void start_thread(void); /* Provide C access to ASM label */ |
29 | static void __attribute__((used)) __start_thread(void) | 31 | static void USED_ATTR __start_thread(void) |
30 | { | 32 | { |
31 | /* a0=macsr, a1=context */ | 33 | /* a0=macsr, a1=context */ |
32 | asm volatile ( | 34 | asm volatile ( |
diff --git a/firmware/target/hosted/thread-arm.c b/firmware/target/hosted/thread-arm.c index d2fa7d1e5d..f8e58c031c 100644 --- a/firmware/target/hosted/thread-arm.c +++ b/firmware/target/hosted/thread-arm.c | |||
@@ -23,11 +23,13 @@ | |||
23 | ****************************************************************************/ | 23 | ****************************************************************************/ |
24 | 24 | ||
25 | #include <system.h> | 25 | #include <system.h> |
26 | #include "gcc_extensions.h" | ||
27 | |||
26 | /*--------------------------------------------------------------------------- | 28 | /*--------------------------------------------------------------------------- |
27 | * Start the thread running and terminate it if it returns | 29 | * Start the thread running and terminate it if it returns |
28 | *--------------------------------------------------------------------------- | 30 | *--------------------------------------------------------------------------- |
29 | */ | 31 | */ |
30 | static void __attribute__((naked,used)) start_thread(void) | 32 | static void __attribute__((naked)) USED_ATTR start_thread(void) |
31 | { | 33 | { |
32 | /* r0 = context */ | 34 | /* r0 = context */ |
33 | asm volatile ( | 35 | asm volatile ( |
diff --git a/firmware/target/mips/thread-mips32.c b/firmware/target/mips/thread-mips32.c index e2fccb8022..2b34d3ce3d 100644 --- a/firmware/target/mips/thread-mips32.c +++ b/firmware/target/mips/thread-mips32.c | |||
@@ -21,13 +21,15 @@ | |||
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | 23 | ||
24 | #include "gcc_extensions.h" | ||
25 | |||
24 | /*--------------------------------------------------------------------------- | 26 | /*--------------------------------------------------------------------------- |
25 | * Start the thread running and terminate it if it returns | 27 | * Start the thread running and terminate it if it returns |
26 | *--------------------------------------------------------------------------- | 28 | *--------------------------------------------------------------------------- |
27 | */ | 29 | */ |
28 | 30 | ||
29 | void start_thread(void); /* Provide C access to ASM label */ | 31 | void start_thread(void); /* Provide C access to ASM label */ |
30 | static void __attribute__((used)) _start_thread(void) | 32 | static void USED_ATTR _start_thread(void) |
31 | { | 33 | { |
32 | /* t1 = context */ | 34 | /* t1 = context */ |
33 | asm volatile ( | 35 | asm volatile ( |
diff --git a/firmware/target/sh/thread-sh.c b/firmware/target/sh/thread-sh.c index 25e0aadf96..36c20686b0 100644 --- a/firmware/target/sh/thread-sh.c +++ b/firmware/target/sh/thread-sh.c | |||
@@ -21,12 +21,14 @@ | |||
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | 23 | ||
24 | #include "gcc_extensions.h" | ||
25 | |||
24 | /*--------------------------------------------------------------------------- | 26 | /*--------------------------------------------------------------------------- |
25 | * Start the thread running and terminate it if it returns | 27 | * Start the thread running and terminate it if it returns |
26 | *--------------------------------------------------------------------------- | 28 | *--------------------------------------------------------------------------- |
27 | */ | 29 | */ |
28 | void start_thread(void); /* Provide C access to ASM label */ | 30 | void start_thread(void); /* Provide C access to ASM label */ |
29 | static void __attribute__((used)) __start_thread(void) | 31 | static void USED_ATTR __start_thread(void) |
30 | { | 32 | { |
31 | /* r8 = context */ | 33 | /* r8 = context */ |
32 | asm volatile ( | 34 | asm volatile ( |
diff --git a/firmware/thread.c b/firmware/thread.c index a1886cbc07..7b91f8fcbd 100644 --- a/firmware/thread.c +++ b/firmware/thread.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #ifdef RB_PROFILE | 30 | #ifdef RB_PROFILE |
31 | #include <profile.h> | 31 | #include <profile.h> |
32 | #endif | 32 | #endif |
33 | #include "gcc_extensions.h" | ||
34 | |||
33 | /**************************************************************************** | 35 | /**************************************************************************** |
34 | * ATTENTION!! * | 36 | * ATTENTION!! * |
35 | * See notes below on implementing processor-specific portions! * | 37 | * See notes below on implementing processor-specific portions! * |
@@ -163,7 +165,7 @@ static inline void load_context(const void* addr) | |||
163 | 165 | ||
164 | #if NUM_CORES > 1 | 166 | #if NUM_CORES > 1 |
165 | static void thread_final_exit_do(struct thread_entry *current) | 167 | static void thread_final_exit_do(struct thread_entry *current) |
166 | __attribute__((noinline, noreturn, used)); | 168 | __attribute__((noinline, noreturn)) USED_ATTR; |
167 | #else | 169 | #else |
168 | static inline void thread_final_exit(struct thread_entry *current) | 170 | static inline void thread_final_exit(struct thread_entry *current) |
169 | __attribute__((always_inline, noreturn)); | 171 | __attribute__((always_inline, noreturn)); |