Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160035766
D56434.id176031.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56434.id176031.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h
--- a/sys/compat/linuxkpi/common/include/linux/kernel.h
+++ b/sys/compat/linuxkpi/common/include/linux/kernel.h
@@ -351,4 +351,37 @@
#define DECLARE_FLEX_ARRAY(_t, _n) \
struct { struct { } __dummy_ ## _n; _t _n[0]; }
+/*
+ * The following functions/macros are debug/diagnostics tools. They default to
+ * no-ops, except `might_sleep()` which uses `WITNESS_WARN()` on FreeBSD.
+ */
+static inline void
+__might_resched(const char *file, int line, unsigned int offsets)
+{
+}
+
+static inline void
+__might_sleep(const char *file, int line)
+{
+}
+
+static inline void
+might_fault(void)
+{
+}
+
+#define might_sleep() \
+ WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "might_sleep()")
+
+#define might_sleep_if(cond) do { \
+ if (cond) { might_sleep(); } \
+} while (0)
+
+#define might_resched() do { } while (0)
+#define cant_sleep() do { } while (0)
+#define cant_migrate() do { } while (0)
+#define sched_annotate_sleep() do { } while (0)
+#define non_block_start() do { } while (0)
+#define non_block_end() do { } while (0)
+
#endif /* _LINUXKPI_LINUX_KERNEL_H_ */
diff --git a/sys/compat/linuxkpi/common/include/linux/wait.h b/sys/compat/linuxkpi/common/include/linux/wait.h
--- a/sys/compat/linuxkpi/common/include/linux/wait.h
+++ b/sys/compat/linuxkpi/common/include/linux/wait.h
@@ -43,13 +43,6 @@
#define SKIP_SLEEP() (SCHEDULER_STOPPED() || kdb_active)
-#define might_sleep() \
- WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "might_sleep()")
-
-#define might_sleep_if(cond) do { \
- if (cond) { might_sleep(); } \
-} while (0)
-
struct wait_queue;
struct wait_queue_head;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jun 21, 7:08 PM (17 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34158966
Default Alt Text
D56434.id176031.diff (1 KB)
Attached To
Mode
D56434: linuxkpi: Define diagnostic macros like `might_resched()` or `cant_sleep()`
Attached
Detach File
Event Timeline
Log In to Comment