hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/tools/include/linux/kernel.h
....@@ -5,6 +5,7 @@
55 #include <stdarg.h>
66 #include <stddef.h>
77 #include <assert.h>
8
+#include <linux/build_bug.h>
89 #include <linux/compiler.h>
910 #include <endian.h>
1011 #include <byteswap.h>
....@@ -34,9 +35,6 @@
3435 const typeof(((type *)0)->member) * __mptr = (ptr); \
3536 (type *)((char *)__mptr - offsetof(type, member)); })
3637 #endif
37
-
38
-#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
39
-#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
4038
4139 #ifndef max
4240 #define max(x, y) ({ \
....@@ -70,6 +68,7 @@
7068 #define BUG_ON(cond) assert(!(cond))
7169 #endif
7270 #endif
71
+#define BUG() BUG_ON(1)
7372
7473 #if __BYTE_ORDER == __BIG_ENDIAN
7574 #define cpu_to_le16 bswap_16
....@@ -101,6 +100,7 @@
101100
102101 int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
103102 int scnprintf(char * buf, size_t size, const char * fmt, ...);
103
+int scnprintf_pad(char * buf, size_t size, const char * fmt, ...);
104104
105105 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
106106
....@@ -115,6 +115,6 @@
115115 #define round_down(x, y) ((x) & ~__round_mask(x, y))
116116
117117 #define current_gfp_context(k) 0
118
-#define synchronize_sched()
118
+#define synchronize_rcu()
119119
120120 #endif