Page MenuHomeFreeBSD

D54497.id169006.diff
No OneTemporary

D54497.id169006.diff

Index: sys/compat/linuxkpi/common/include/linux/kfifo.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/kfifo.h
+++ sys/compat/linuxkpi/common/include/linux/kfifo.h
@@ -33,8 +33,26 @@
#include <linux/slab.h>
#include <linux/gfp.h>
-#define INIT_KFIFO(x) 0
-#define DECLARE_KFIFO(x, y, z)
+/*
+ * INIT_KFIFO() is used to initialize the structure declared with
+ * DECLARE_KFIFO(). It doesn't work with DECLARE_KFIFO_PTR().
+ */
+#define INIT_KFIFO(_kf) \
+ ({ \
+ (_kf).total = sizeof((_kf).head) / sizeof(*(_kf).head); \
+ (_kf).count = 0; \
+ (_kf).first = 0; \
+ (_kf).last = 0; \
+ })
+
+#define DECLARE_KFIFO(_name, _type, _size) \
+ struct kfifo_ ## _name { \
+ size_t total; \
+ size_t count; \
+ size_t first; \
+ size_t last; \
+ _type head[_size]; \
+ } _name
#define DECLARE_KFIFO_PTR(_name, _type) \
struct kfifo_ ## _name { \

File Metadata

Mime Type
text/plain
Expires
Sun, Aug 23, 3:01 PM (11 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37147277
Default Alt Text
D54497.id169006.diff (986 B)

Event Timeline