Page MenuHomeFreeBSD

D30980.id91614.diff
No OneTemporary

D30980.id91614.diff

Index: sys/compat/linuxkpi/common/include/linux/iopoll.h
===================================================================
--- /dev/null
+++ sys/compat/linuxkpi/common/include/linux/iopoll.h
@@ -0,0 +1,49 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2020 Bjoern A. Zeeb
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUXKPI_LINUX_IOPOLL_H
+#define _LINUXKPI_LINUX_IOPOLL_H
+
+/* This is not a full implementation yet. */
+#define read_poll_timeout(_readfunc, _var, _cond, _da, _db, _t, _dev, ...) \
+({ \
+ int cnt = ((_da) > 0) ? ((_db) / (_da)) : (_db); \
+ \
+ do { \
+ (_var) = _readfunc((_dev), __VA_ARGS__); \
+ if ((_da) != 0) \
+ DELAY(_da); \
+ } while ((_cond) && (--cnt > 0)); \
+ (_cond) ? 0 : (-ETIMEDOUT); \
+})
+
+#define read_poll_timeout_atomic(_a, _b, _c, _d, _e, _f, _g, _h) \
+ read_poll_timeout(_a, _b, _c, _d, _e, _f, _g, _h)
+
+#endif /* _LINUXKPI_LINUX_IOPOLL_H */

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 25, 4:59 PM (2 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26152547
Default Alt Text
D30980.id91614.diff (2 KB)

Event Timeline