aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/module.h')
-rw-r--r--sys/sys/module.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/module.h b/sys/sys/module.h
index 5dc615183502..39f138d206b0 100644
--- a/sys/sys/module.h
+++ b/sys/sys/module.h
@@ -125,6 +125,15 @@ struct mod_metadata {
MODULE_METADATA(_##module##_version, MDT_VERSION, \
&_##module##_version, #module)
+extern struct sx modules_sx;
+
+#define MOD_XLOCK sx_xlock(&modules_sx)
+#define MOD_SLOCK sx_slock(&modules_sx)
+#define MOD_XUNLOCK sx_xunlock(&modules_sx)
+#define MOD_SUNLOCK sx_sunlock(&modules_sx)
+#define MOD_LOCK_ASSERT sx_assert(&modules_sx, SX_LOCKED)
+#define MOD_XLOCK_ASSERT sx_assert(&modules_sx, SX_XLOCKED)
+
struct linker_file;
void module_register_init(const void *);