From 00f779ab42468ce761d65a44f61c3e28212ef4d2 Mon Sep 17 00:00:00 2001
From: Ian Moffett <ian@osmora.org>
Date: Fri, 26 Apr 2024 22:33:32 -0400
Subject: kernel: cdefs: Add __likely() and __unlikely()

Signed-off-by: Ian Moffett <ian@osmora.org>
---
 sys/include/sys/cdefs.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/include/sys/cdefs.h b/sys/include/sys/cdefs.h
index 152765c..110205b 100644
--- a/sys/include/sys/cdefs.h
+++ b/sys/include/sys/cdefs.h
@@ -39,6 +39,9 @@
 #define __naked     __attr(naked)
 #define __noreturn  __attr(noreturn)
 
+#define __likely(x) __builtin_expect(!!(x), 1)
+#define __unlikely(x) __builtin_expect(!!(x), 0)
+
 /* Wrapper for inline asm */
 #define __ASMV __asm__ __volatile__
 
-- 
cgit v1.2.3