svn commit: r211689 - in user/imp/tbemd/sys/modules: opensolaris zfs

Nathan Whitehorn nwhitehorn at freebsd.org
Mon Aug 23 14:11:49 UTC 2010


On 08/23/10 01:06, Warner Losh wrote:
> Author: imp
> Date: Mon Aug 23 06:06:55 2010
> New Revision: 211689
> URL: http://svn.freebsd.org/changeset/base/211689
>
> Log:
>    Vastly simplify the rats-nest of ifs for the atomic ops...
>
> Modified:
>    user/imp/tbemd/sys/modules/opensolaris/Makefile
>    user/imp/tbemd/sys/modules/zfs/Makefile
>
> Modified: user/imp/tbemd/sys/modules/opensolaris/Makefile
> ==============================================================================
> --- user/imp/tbemd/sys/modules/opensolaris/Makefile	Mon Aug 23 06:00:21 2010	(r211688)
> +++ user/imp/tbemd/sys/modules/opensolaris/Makefile	Mon Aug 23 06:06:55 2010	(r211689)
> @@ -8,11 +8,12 @@ SRCS=		opensolaris.c		\
>   		opensolaris_kmem.c	\
>   		opensolaris_misc.c
>
> -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "ia64" || ${MACHINE_CPUARCH} == "sparc64"
> -.PATH:	${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic/${MACHINE_CPUARCH}
> +_A=${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic
> +.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S)
> +.PATH:	${_A}/${MACHINE_CPUARCH}
>   SRCS+=		opensolaris_atomic.S
> -.elif ${MACHINE_ARCH} == "powerpc64"
> -.PATH:	${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
> +.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S)
> +.PATH:	${_A}/${MACHINE_ARCH}
>   SRCS+=		opensolaris_atomic.S
>   .else
>   SRCS+=		opensolaris_atomic.c
>    

Are you sure you want to prefer CPUARCH over ARCH here? Were we ever to 
grow support for these atomics on 32-bit powerpc, for instance, this 
code would pick the wrong source files on a 64-bit build.
-Nathan


More information about the svn-src-user mailing list