Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177843450
D61902.1795413008.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61902.1795413008.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/kfifo.h b/sys/compat/linuxkpi/common/include/linux/kfifo.h
--- a/sys/compat/linuxkpi/common/include/linux/kfifo.h
+++ b/sys/compat/linuxkpi/common/include/linux/kfifo.h
@@ -1,6 +1,9 @@
/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
* Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG
* Copyright (c) 2022 Bjoern A. Zeeb
+ * Copyright (c) 2026 The FreeBSD Foundation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -116,6 +119,30 @@
_rc; \
})
+#define kfifo_in(_kf, _buf, _n) \
+({ \
+ const __typeof(*(_kf)->head) *_src = (_buf); \
+ size_t _i, _cnt = (_n); \
+ \
+ for (_i = 0; _i < _cnt; _i++) \
+ if (!kfifo_put(_kf, _src[_i])) \
+ break; \
+ \
+ _i; \
+})
+
+#define kfifo_out(_kf, _buf, _n) \
+({ \
+ __typeof(*(_kf)->head) *_dst = (_buf); \
+ size_t _i, _cnt = (_n); \
+ \
+ for (_i = 0; _i < _cnt; _i++) \
+ if (!kfifo_get(_kf, &_dst[_i])) \
+ break; \
+ \
+ _i; \
+})
+
#define kfifo_alloc(_kf, _s, _gfp) \
({ \
int _error; \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 23, 5:50 AM (23 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41924104
Default Alt Text
D61902.1795413008.diff (1 KB)
Attached To
Mode
D61902: LinuxKPI: Add kfifo_in() and kfifo_out()
Attached
Detach File
Event Timeline