summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drmP.h
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2009-10-30 16:59:58 +0000
committerrnoland <rnoland@FreeBSD.org>2009-10-30 16:59:58 +0000
commit352d93ce10b6cf1f8bef60bab4dcc770353360ea (patch)
treea27700d7c14f084ae3f39cbc35988821800cccb4 /sys/dev/drm/drmP.h
parent9bb26a1a591c78da6bce08484fdef077a819cfd5 (diff)
downloadFreeBSD-src-352d93ce10b6cf1f8bef60bab4dcc770353360ea.zip
FreeBSD-src-352d93ce10b6cf1f8bef60bab4dcc770353360ea.tar.gz
Use system specified memory barriers rather than rolling our own.
Diffstat (limited to 'sys/dev/drm/drmP.h')
-rw-r--r--sys/dev/drm/drmP.h20
1 files changed, 3 insertions, 17 deletions
diff --git a/sys/dev/drm/drmP.h b/sys/dev/drm/drmP.h
index cad2cee..25e272e 100644
--- a/sys/dev/drm/drmP.h
+++ b/sys/dev/drm/drmP.h
@@ -223,23 +223,9 @@ typedef u_int8_t u8;
* DRM_WRITEMEMORYBARRIER() prevents reordering of writes.
* DRM_MEMORYBARRIER() prevents reordering of reads and writes.
*/
-#if defined(__i386__)
-#define DRM_READMEMORYBARRIER() __asm __volatile( \
- "lock; addl $0,0(%%esp)" : : : "memory");
-#define DRM_WRITEMEMORYBARRIER() __asm __volatile("" : : : "memory");
-#define DRM_MEMORYBARRIER() __asm __volatile( \
- "lock; addl $0,0(%%esp)" : : : "memory");
-#elif defined(__alpha__)
-#define DRM_READMEMORYBARRIER() alpha_mb();
-#define DRM_WRITEMEMORYBARRIER() alpha_wmb();
-#define DRM_MEMORYBARRIER() alpha_mb();
-#elif defined(__amd64__)
-#define DRM_READMEMORYBARRIER() __asm __volatile( \
- "lock; addl $0,0(%%rsp)" : : : "memory");
-#define DRM_WRITEMEMORYBARRIER() __asm __volatile("" : : : "memory");
-#define DRM_MEMORYBARRIER() __asm __volatile( \
- "lock; addl $0,0(%%rsp)" : : : "memory");
-#endif
+#define DRM_READMEMORYBARRIER() rmb()
+#define DRM_WRITEMEMORYBARRIER() wmb()
+#define DRM_MEMORYBARRIER() mb()
#define DRM_READ8(map, offset) \
*(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \
OpenPOWER on IntegriCloud