Page MenuHomeFreeBSD

D61902.1795412900.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61902.1795412900.diff

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

Mime Type
text/plain
Expires
Mon, Nov 23, 5:48 AM (23 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41924104
Default Alt Text
D61902.1795412900.diff (1 KB)

Event Timeline