diff options
author | Ian Moffett <ian@osmora.org> | 2024-06-06 15:33:38 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-06-06 15:33:38 -0400 |
commit | 57398708554c74a069c6a5d07c36e5576a6666fb (patch) | |
tree | 5dbd01377b95b50592d6071ff20784097acc9d54 | |
parent | b24d9a83b20a7cae49af41031a8e54946f7d42b6 (diff) |
kernel: cdefs: Add __likely() and __unlikely()
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | sys/include/sys/cdefs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/include/sys/cdefs.h b/sys/include/sys/cdefs.h index 9c1a466..fc21750 100644 --- a/sys/include/sys/cdefs.h +++ b/sys/include/sys/cdefs.h @@ -33,5 +33,7 @@ #define __ASMV __asm__ __volatile__ #define __always_inline __attribute__((__always_inline__)) #define __packed __attribute__((__packed__)) +#define __likely(exp) __builtin_expect(((exp) != 0), 1) +#define __unlikely(exp) __builtin_expect(((exp) != 0), 0) #endif /* !_SYS_CDEFS_H_ */ |