summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-04-01 15:41:13 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-04-01 15:41:13 +0000
commit01bd9640ba081f13dd8f5fe9186dbcf09843446b (patch)
treeb727a8b8c1d8f8d70c27cef3cb334cd9683830bb /sys/dev/pv
parent683512307116c8553f2310e35c6dbe86a42f5b2e (diff)
Move atomics.h include dance to an earlier stage
Otherwise proc.h & friends pick it up before we manage to perform our MULTIPROCESSOR dance. This time I've made sure we get LOCK prefixes with an objdump. Bug reported by Evgeniy Sudyr, thanks!
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/xen.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c
index be581204cc7..92fba3cd210 100644
--- a/sys/dev/pv/xen.c
+++ b/sys/dev/pv/xen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xen.c,v 1.50 2016/02/05 10:30:37 mikeb Exp $ */
+/* $OpenBSD: xen.c,v 1.51 2016/04/01 15:41:12 mikeb Exp $ */
/*
* Copyright (c) 2015 Mike Belopuhov
@@ -17,6 +17,18 @@
*/
#include <sys/param.h>
+
+/* Xen requires locked atomic operations */
+#ifndef MULTIPROCESSOR
+#define _XENMPATOMICS
+#define MULTIPROCESSOR
+#endif
+#include <sys/atomic.h>
+#ifdef _XENMPATOMICS
+#undef MULTIPROCESSOR
+#undef _XENMPATOMICS
+#endif
+
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/signal.h>
@@ -42,17 +54,6 @@
#include <dev/pv/xenreg.h>
#include <dev/pv/xenvar.h>
-/* Xen requires locked atomic operations */
-#ifndef MULTIPROCESSOR
-#define _XENMPATOMICS
-#define MULTIPROCESSOR
-#endif
-#include <sys/atomic.h>
-#ifdef _XENMPATOMICS
-#undef MULTIPROCESSOR
-#undef _XENMPATOMICS
-#endif
-
struct xen_softc *xen_sc;
int xen_init_hypercall(struct xen_softc *);