Index: contrib/opensolaris/common/atomic/sparc64/atomic.S =================================================================== RCS file: contrib/opensolaris/common/atomic/sparc64/atomic.S diff -N contrib/opensolaris/common/atomic/sparc64/atomic.S --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ contrib/opensolaris/common/atomic/sparc64/atomic.S 16 Feb 2008 22:41:17 -0000 @@ -0,0 +1,115 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + .ident "%Z%%M% %I% %E% SMI" + + .file "%M%" + +#define _ASM +#include + +#include + +/* Userland needs different ASIs. */ +#ifdef _KERNEL +#define __ASI_ATOMIC ASI_N +#else +#define __ASI_ATOMIC ASI_P +#endif + + /* + * NOTE: If atomic_add_64 and atomic_add_64_nv are ever + * separated, you need to also edit the libc sparcv9 platform + * specific mapfile and remove the NODYNSORT attribute + * from atomic_add_64_nv. + */ + ENTRY(atomic_add_64) + ALTENTRY(atomic_add_64_nv) + ALTENTRY(atomic_add_ptr) + ALTENTRY(atomic_add_ptr_nv) + ALTENTRY(atomic_add_long) + ALTENTRY(atomic_add_long_nv) +add_64: + ldx [%o0], %o2 +1: + add %o2, %o1, %o3 + casxa [%o0] __ASI_ATOMIC, %o2, %o3 + cmp %o2, %o3 + bne,a,pn %xcc, 1b + mov %o3, %o2 + retl + add %o2, %o1, %o0 ! return new value + SET_SIZE(atomic_add_long_nv) + SET_SIZE(atomic_add_long) + SET_SIZE(atomic_add_ptr_nv) + SET_SIZE(atomic_add_ptr) + SET_SIZE(atomic_add_64_nv) + SET_SIZE(atomic_add_64) + + /* + * NOTE: If atomic_or_8 and atomic_or_8_nv are ever + * separated, you need to also edit the libc sparcv9 platform + * specific mapfile and remove the NODYNSORT attribute + * from atomic_or_8_nv. + */ + ENTRY(atomic_or_8) + ALTENTRY(atomic_or_8_nv) + ALTENTRY(atomic_or_uchar) + ALTENTRY(atomic_or_uchar_nv) + and %o0, 0x3, %o4 ! %o4 = byte offset, left-to-right + xor %o4, 0x3, %g1 ! %g1 = byte offset, right-to-left + sll %g1, 3, %g1 ! %g1 = bit offset, right-to-left + set 0xff, %o3 ! %o3 = mask + sll %o3, %g1, %o3 ! %o3 = shifted to bit offset + sll %o1, %g1, %o1 ! %o1 = shifted to bit offset + and %o1, %o3, %o1 ! %o1 = single byte value + andn %o0, 0x3, %o0 ! %o0 = word address + ld [%o0], %o2 ! read old value +1: + or %o2, %o1, %o5 ! or in the new value + casa [%o0] __ASI_ATOMIC, %o2, %o5 + cmp %o2, %o5 + bne,a,pn %icc, 1b + mov %o5, %o2 ! %o2 = old value + or %o2, %o1, %o5 + and %o5, %o3, %o5 + retl + srl %o5, %g1, %o0 ! %o0 = new value + SET_SIZE(atomic_or_uchar_nv) + SET_SIZE(atomic_or_uchar) + SET_SIZE(atomic_or_8_nv) + SET_SIZE(atomic_or_8) + + /* + * Spitfires and Blackbirds have a problem with membars in the + * delay slot (SF_ERRATA_51). For safety's sake, we assume + * that the whole world needs the workaround. + */ + + ENTRY(membar_producer) + membar #StoreStore + retl + nop + SET_SIZE(membar_producer) Index: contrib/opensolaris/uts/common/sys/asm_linkage.h =================================================================== RCS file: /usr/data/bsd/cvs/fbsd/src/sys/contrib/opensolaris/uts/common/sys/asm_linkage.h,v retrieving revision 1.2 diff -u -r1.2 asm_linkage.h --- contrib/opensolaris/uts/common/sys/asm_linkage.h 8 Jun 2007 12:35:46 -0000 1.2 +++ contrib/opensolaris/uts/common/sys/asm_linkage.h 12 Feb 2008 19:14:28 -0000 @@ -24,8 +24,8 @@ * Use is subject to license terms. */ -#ifndef _IA32_SYS_ASM_LINKAGE_H -#define _IA32_SYS_ASM_LINKAGE_H +#ifndef _SYS_ASM_LINKAGE_H +#define _SYS_ASM_LINKAGE_H #ifdef __cplusplus extern "C" { @@ -41,6 +41,17 @@ #define ASM_ENTRY_ALIGN 16 +#elif defined(__sparc64__) + +/* GCC uses 32-byte function alignment for UltraSPARC CPUs. */ +#define ASM_ENTRY_ALIGN 32 + +#else + +#error Unsupported architecture. + +#endif + /* * ENTRY provides the standard procedure entry code and an easy way to * insert the calls to mcount for profiling. ENTRY_NP is identical, but @@ -67,40 +78,6 @@ #define SET_SIZE(x) \ .size x, [.-x] -#elif defined(__sparc64__) - -/* - * ENTRY provides the standard procedure entry code and an easy way to - * insert the calls to mcount for profiling. ENTRY_NP is identical, but - * never calls mcount. - */ -#define ENTRY(x) \ - .section ".text"; \ - .align 4; \ - .global x; \ - .type x, @function; \ -x: - -/* - * ALTENTRY provides for additional entry points. - */ -#define ALTENTRY(x) \ - .global x; \ - .type x, @function; \ -x: - -/* - * SET_SIZE trails a function and set the size for the ELF symbol table. - */ -#define SET_SIZE(x) \ - .size x, (.-x) - -#else - -#error Unsupported architecture. - -#endif - #endif /* _ASM */ #ifdef __cplusplus Index: modules/Makefile =================================================================== RCS file: /usr/data/bsd/cvs/fbsd/src/sys/modules/Makefile,v retrieving revision 1.552 diff -u -r1.552 Makefile --- modules/Makefile 16 Dec 2007 18:45:23 -0000 1.552 +++ modules/Makefile 11 Feb 2008 21:48:38 -0000 @@ -608,6 +608,9 @@ _em= em _i2c= i2c _sound= sound +.if ${MK_ZFS} != "no" || defined(ALL_MODULES) +_zfs= zfs +.endif .endif .if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES) Index: modules/zfs/Makefile =================================================================== RCS file: /usr/data/bsd/cvs/fbsd/src/sys/modules/zfs/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- modules/zfs/Makefile 28 Nov 2007 22:58:09 -0000 1.7 +++ modules/zfs/Makefile 16 Feb 2008 22:47:39 -0000 @@ -21,7 +21,7 @@ SRCS+= opensolaris_vfs.c SRCS+= opensolaris_zone.c -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" .PATH: ${.CURDIR}/../../contrib/opensolaris/common/atomic/${MACHINE_ARCH} SRCS+= atomic.S .else