diff options
-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 |