summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-06-06 15:33:38 -0400
committerIan Moffett <ian@osmora.org>2024-06-06 15:33:38 -0400
commit57398708554c74a069c6a5d07c36e5576a6666fb (patch)
tree5dbd01377b95b50592d6071ff20784097acc9d54 /sys/include
parentb24d9a83b20a7cae49af41031a8e54946f7d42b6 (diff)
kernel: cdefs: Add __likely() and __unlikely()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/cdefs.h2
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_ */