diff options
author | obrien <obrien@FreeBSD.org> | 2004-03-03 06:19:03 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2004-03-03 06:19:03 +0000 |
commit | 3cba815b88ecd64e0be3671293d8f9aa48111a99 (patch) | |
tree | 8da4e082fb05fcb2168a9ea835cb98747975095a /sys/dev/drm/drm_os_freebsd.h | |
parent | 7aec91557a8c31974a0de5c2d3e90bf2579300d4 (diff) | |
download | FreeBSD-src-3cba815b88ecd64e0be3671293d8f9aa48111a99.zip FreeBSD-src-3cba815b88ecd64e0be3671293d8f9aa48111a99.tar.gz |
Add memory barrier routines for AMD64.
Diffstat (limited to 'sys/dev/drm/drm_os_freebsd.h')
-rw-r--r-- | sys/dev/drm/drm_os_freebsd.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/drm/drm_os_freebsd.h b/sys/dev/drm/drm_os_freebsd.h index 43f6309..cb4cfe0 100644 --- a/sys/dev/drm/drm_os_freebsd.h +++ b/sys/dev/drm/drm_os_freebsd.h @@ -178,7 +178,7 @@ typedef void irqreturn_t; #define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) \ do { \ - if (_filp != (DRMFILE)DRM_CURRENTPID) { \ + if (_filp != (DRMFILE)(intptr_t)DRM_CURRENTPID) { \ DRM_ERROR("filp doesn't match curproc\n"); \ return EINVAL; \ } \ @@ -291,6 +291,12 @@ for ( ret = 0 ; !ret && !(condition) ; ) { \ #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 PAGE_ALIGN(addr) round_page(addr) |