From 57398708554c74a069c6a5d07c36e5576a6666fb Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 6 Jun 2024 15:33:38 -0400 Subject: kernel: cdefs: Add __likely() and __unlikely() Signed-off-by: Ian Moffett --- sys/include/sys/cdefs.h | 2 ++ 1 file changed, 2 insertions(+) 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_ */ -- cgit v1.2.3