aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRoger Pau Monné <royger@FreeBSD.org>2017-03-07 09:17:48 +0000
committerRoger Pau Monné <royger@FreeBSD.org>2017-03-07 09:17:48 +0000
commit41716b8d5151d2bec72b6796ed58b6206cdb4779 (patch)
tree822473b45fe4edc7c7af5cdea032a558cc9f968c /sys
parent8dee0e9bd64849deca80da9052c806e764ef026c (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/xen/control/control.c2
-rw-r--r--sys/dev/xen/xenstore/xenstore.c17
-rw-r--r--sys/xen/xenstore/xenstorevar.h11
3 files changed, 30 insertions, 0 deletions
diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c
index d4249886332b..d5aa97e03b73 100644
--- a/sys/dev/xen/control/control.c
+++ b/sys/dev/xen/control/control.c
@@ -199,7 +199,9 @@ xctrl_suspend()
#endif
EVENTHANDLER_INVOKE(power_suspend_early);
+ xs_lock();
stop_all_proc();
+ xs_unlock();
EVENTHANDLER_INVOKE(power_suspend);
#ifdef EARLY_AP_STARTUP
diff --git a/sys/dev/xen/xenstore/xenstore.c b/sys/dev/xen/xenstore/xenstore.c
index 4f89b7457d0e..9289adfc1a79 100644
--- a/sys/dev/xen/xenstore/xenstore.c
+++ b/sys/dev/xen/xenstore/xenstore.c
@@ -1699,3 +1699,20 @@ xs_unregister_watch(struct xs_watch *watch)
sx_xunlock(&xs.xenwatch_mutex);
}
}
+
+void
+xs_lock(void)
+{
+
+ sx_xlock(&xs.request_mutex);
+ return;
+}
+
+void
+xs_unlock(void)
+{
+
+ sx_xunlock(&xs.request_mutex);
+ return;
+}
+
diff --git a/sys/xen/xenstore/xenstorevar.h b/sys/xen/xenstore/xenstorevar.h
index 208e5bf09b8e..4c612b4b6881 100644
--- a/sys/xen/xenstore/xenstorevar.h
+++ b/sys/xen/xenstore/xenstorevar.h
@@ -338,4 +338,15 @@ void xs_unregister_watch(struct xs_watch *watch);
*/
struct sbuf *xs_join(const char *, const char *);
+/**
+ * Lock the xenstore request mutex.
+ */
+void xs_lock(void);
+
+/**
+ * Unlock the xenstore request mutex.
+ */
+void xs_unlock(void);
+
#endif /* _XEN_XENSTORE_XENSTOREVAR_H */
+