From 2fdc7663020924cbef31dde069f3b32f101d45bb Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Sun, 30 Jul 2006 10:05:49 +0000 Subject: add definitions for likely/unlikely git-svn-id: https://svn.openpcd.org:2342/trunk@55 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpcd/firmware/include/asm/atomic.h | 1 + openpcd/firmware/include/asm/compiler.h | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 openpcd/firmware/include/asm/compiler.h 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 +#include #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 -- cgit v1.2.3