summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2018-08-20 19:36:04 +0000
committerkettenis <kettenis@openbsd.org>2018-08-20 19:36:04 +0000
commit4ebb38a99107a5a9b7072a47d63d9c8e316eda71 (patch)
tree3bd09a749992957eaf3dfee640368d412abb02e8
parentAdd arm64 support. On ARM write-combining translates into the normal uncached (diff)
downloadwireguard-openbsd-4ebb38a99107a5a9b7072a47d63d9c8e316eda71.tar.xz
wireguard-openbsd-4ebb38a99107a5a9b7072a47d63d9c8e316eda71.zip
Memory barriers for arm64. These are somewhat stronger than strictly
necessary since we define the linux compat symbols in terms of a single set of macros. ok jsg@, mpi@, visa@
-rw-r--r--sys/dev/pci/drm/drmP.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index 1d9bcf534c8..2a8937a4499 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: drmP.h,v 1.218 2018/06/25 22:29:16 kettenis Exp $ */
+/* $OpenBSD: drmP.h,v 1.219 2018/08/20 19:36:04 kettenis Exp $ */
/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
*/
@@ -158,6 +158,10 @@ extern struct cfdriver drm_cd;
#define DRM_WRITEMEMORYBARRIER() __asm __volatile("" : : : "memory");
#define DRM_MEMORYBARRIER() __asm __volatile( \
"lock; addl $0,0(%%rsp)" : : : "memory");
+#elif defined(__aarch64__)
+#define DRM_READMEMORYBARRIER() __membar("dsb ld")
+#define DRM_WRITEMEMORYBARRIER() __membar("dsb st")
+#define DRM_MEMORYBARRIER() __membar("dsb sy")
#elif defined(__mips64__)
#define DRM_READMEMORYBARRIER() DRM_MEMORYBARRIER()
#define DRM_WRITEMEMORYBARRIER() DRM_MEMORYBARRIER()