From bc9a63754d3ec3af3c5708501b9f3c819ffd4c77 Mon Sep 17 00:00:00 2001 From: ad Date: Thu, 21 Feb 2008 16:31:13 +0000 Subject: [PATCH] #define __HAVE_ATOMIC_AS_MEMBAR, indicating that: - atomic_cas_ni() does an implicit membar_exit() - all other atomic operations do an implicit membar_sync() While this might seem kind of arbitrary it's the basis for some important optimizations. --- sys/arch/amd64/include/types.h | 3 ++- sys/arch/i386/include/types.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/include/types.h b/sys/arch/amd64/include/types.h index a92664b02b1d..4c10af3ea640 100644 --- a/sys/arch/amd64/include/types.h +++ b/sys/arch/amd64/include/types.h @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.25 2008/01/20 18:09:04 joerg Exp $ */ +/* $NetBSD: types.h,v 1.26 2008/02/21 16:31:13 ad Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -72,6 +72,7 @@ typedef volatile unsigned char __cpu_simple_lock_t; #define __HAVE_SYSCALL_INTERN #define __HAVE_MINIMAL_EMUL #define __HAVE_ATOMIC64_OPS +#define __HAVE_ATOMIC_AS_MEMBAR #ifdef _KERNEL_OPT #include "opt_xen.h" diff --git a/sys/arch/i386/include/types.h b/sys/arch/i386/include/types.h index 4e8ef7f06587..4a0dc691dffb 100644 --- a/sys/arch/i386/include/types.h +++ b/sys/arch/i386/include/types.h @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.58 2008/01/23 19:46:44 bouyer Exp $ */ +/* $NetBSD: types.h,v 1.59 2008/02/21 16:31:13 ad Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -82,6 +82,7 @@ typedef volatile unsigned char __cpu_simple_lock_t; #define __HAVE_MINIMAL_EMUL #define __HAVE_OLD_DISKLABEL #define __HAVE_ATOMIC64_OPS +#define __HAVE_ATOMIC_AS_MEMBAR #if defined(_KERNEL) #define __HAVE_RAS