Date: Mon, 2 Nov 2009 15:57:03 +0000 (UTC) From: Robert Noland <rnoland@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r198794 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/drm dev/xen/xenpci Message-ID: <200911021557.nA2Fv3g0061546@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rnoland Date: Mon Nov 2 15:57:03 2009 New Revision: 198794 URL: http://svn.freebsd.org/changeset/base/198794 Log: MFC 198692 Use system specified memory barriers rather than rolling our own. Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/drm/drmP.h stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/drm/drmP.h ============================================================================== --- stable/8/sys/dev/drm/drmP.h Mon Nov 2 15:54:41 2009 (r198793) +++ stable/8/sys/dev/drm/drmP.h Mon Nov 2 15:57:03 2009 (r198794) @@ -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) + \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911021557.nA2Fv3g0061546>