summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2016-04-01 15:41:12 +0000
committermikeb <mikeb@openbsd.org>2016-04-01 15:41:12 +0000
commitd732de307045ea79c9d7430f7801f4036ff175fd (patch)
tree1585af2c0438ed282093ca50b08179ad52426563
parentRevert the clone bitmap enlargement change (diff)
downloadwireguard-openbsd-d732de307045ea79c9d7430f7801f4036ff175fd.tar.xz
wireguard-openbsd-d732de307045ea79c9d7430f7801f4036ff175fd.zip
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!
-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 *);