summaryrefslogtreecommitdiff
path: root/firmware/export/system.h
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-07-25 14:44:29 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-07-25 14:44:29 +0000
commita72aa856bdcc23dab64af83757830e1d2e1618c8 (patch)
tree64aa0b5dbace189447607c9522fe82883b1febe4 /firmware/export/system.h
parent1828a753a8a62a8ad94fdf32b7c4406eb43bb608 (diff)
downloadrockbox-a72aa856bdcc23dab64af83757830e1d2e1618c8.tar.gz
rockbox-a72aa856bdcc23dab64af83757830e1d2e1618c8.zip
Move some gcc extensions to new gcc_extensions.h header
- Move ATTRIBUTE_PRINTF/ATTRIBUTE_SCANF from _ansi.h They are not related at all to this file, and this broke compilation with Code Sourcery GCC which ships its own _ansi.h - Move LIKELY/UNLIKELY from system.h There is likely a lot more GCC extensions used everywhere in the source, conditionally on __GNUC__ or unconditionally git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27548 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/system.h')
-rw-r--r--firmware/export/system.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h
index bbaf5d74df..ce6277ac7a 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -25,6 +25,7 @@
25#include "cpu.h" 25#include "cpu.h"
26#include "stdbool.h" 26#include "stdbool.h"
27#include "kernel.h" 27#include "kernel.h"
28#include "gcc_extensions.h" /* for LIKELY/UNLIKELY */
28 29
29extern void system_reboot (void); 30extern void system_reboot (void);
30/* Called from any UIE handler and panicf - wait for a key and return 31/* Called from any UIE handler and panicf - wait for a key and return
@@ -198,15 +199,6 @@ int get_cpu_boost_counter(void);
198#define TYPE_FROM_MEMBER(type, memberptr, membername) \ 199#define TYPE_FROM_MEMBER(type, memberptr, membername) \
199 ((type *)((intptr_t)(memberptr) - OFFSETOF(type, membername))) 200 ((type *)((intptr_t)(memberptr) - OFFSETOF(type, membername)))
200 201
201/* Use to give gcc hints on which branch is most likely taken */
202#if defined(__GNUC__) && __GNUC__ >= 3
203#define LIKELY(x) __builtin_expect(!!(x), 1)
204#define UNLIKELY(x) __builtin_expect(!!(x), 0)
205#else
206#define LIKELY(x) (x)
207#define UNLIKELY(x) (x)
208#endif
209
210/* returns index of first set bit or 32 if no bits are set */ 202/* returns index of first set bit or 32 if no bits are set */
211int find_first_set_bit(uint32_t val); 203int find_first_set_bit(uint32_t val);
212 204