diff options
author | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-07-30 10:05:49 +0000 |
---|---|---|
committer | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-07-30 10:05:49 +0000 |
commit | 2fdc7663020924cbef31dde069f3b32f101d45bb (patch) | |
tree | 572fcab67ae67d0bf91b08dacd7b93512d892336 | |
parent | b17a2f66765ea162d83e26e0f47e2fb45c314bd3 (diff) |
add definitions for likely/unlikely
git-svn-id: https://svn.openpcd.org:2342/trunk@55 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
-rw-r--r-- | openpcd/firmware/include/asm/atomic.h | 1 | ||||
-rw-r--r-- | openpcd/firmware/include/asm/compiler.h | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/openpcd/firmware/include/asm/atomic.h b/openpcd/firmware/include/asm/atomic.h index bb5a2b1..19e8ce6 100644 --- a/openpcd/firmware/include/asm/atomic.h +++ b/openpcd/firmware/include/asm/atomic.h @@ -18,6 +18,7 @@ typedef struct { volatile int counter; } atomic_t; #define atomic_read(v) ((v)->counter) #include <asm/system.h> +#include <asm/compiler.h> #define atomic_set(v,i) (((v)->counter) = (i)) diff --git a/openpcd/firmware/include/asm/compiler.h b/openpcd/firmware/include/asm/compiler.h new file mode 100644 index 0000000..de4dfaa --- /dev/null +++ b/openpcd/firmware/include/asm/compiler.h @@ -0,0 +1,7 @@ +#ifndef _ASM_COMPILER_H +#define _ASM_COMPILER_H + +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + +#endif |