Module Name: src
Committed By: riastradh
Date: Sat Sep 9 00:15:09 UTC 2023
Modified Files:
src/sys/sys: once.h systm.h
Log Message:
Revert "once(9): Assert sleepable in RUN_ONCE, unconditionally."
This would be nice but it'll break too many things for the moment.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/sys/once.h
cvs rdiff -u -r1.303 -r1.304 src/sys/sys/systm.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/sys/once.h
diff -u src/sys/sys/once.h:1.8 src/sys/sys/once.h:1.9
--- src/sys/sys/once.h:1.8 Fri Sep 8 23:25:39 2023
+++ src/sys/sys/once.h Sat Sep 9 00:15:09 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: once.h,v 1.8 2023/09/08 23:25:39 riastradh Exp $ */
+/* $NetBSD: once.h,v 1.9 2023/09/09 00:15:09 riastradh Exp $ */
/*-
* Copyright (c)2005 YAMAMOTO Takashi,
@@ -30,9 +30,6 @@
#ifndef _SYS_ONCE_H_
#define _SYS_ONCE_H_
-#include <sys/stdint.h>
-#include <sys/systm.h>
-
typedef struct {
int o_error;
uint16_t o_refcnt;
@@ -53,7 +50,7 @@ void _fini_once(once_t *, void (*)(void)
};
#define RUN_ONCE(o, fn) \
- (ASSERT_SLEEPABLE(), __predict_true((o)->o_status == ONCE_DONE) ? \
+ (__predict_true((o)->o_status == ONCE_DONE) ? \
((o)->o_error) : _init_once((o), (fn)))
#define INIT_ONCE(o, fn) _init_once((o), (fn))
Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.303 src/sys/sys/systm.h:1.304
--- src/sys/sys/systm.h:1.303 Fri Sep 8 23:25:39 2023
+++ src/sys/sys/systm.h Sat Sep 9 00:15:09 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: systm.h,v 1.303 2023/09/08 23:25:39 riastradh Exp $ */
+/* $NetBSD: systm.h,v 1.304 2023/09/09 00:15:09 riastradh Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@@ -762,7 +762,7 @@ void assert_sleepable(void);
#if defined(DEBUG)
#define ASSERT_SLEEPABLE() assert_sleepable()
#else /* defined(DEBUG) */
-#define ASSERT_SLEEPABLE() __nothing
+#define ASSERT_SLEEPABLE() do {} while (0)
#endif /* defined(DEBUG) */