From owner-svn-src-stable@FreeBSD.ORG Wed Jan 5 12:27:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E83510657C3; Wed, 5 Jan 2011 12:27:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BCCD8FC14; Wed, 5 Jan 2011 12:27:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05CRvfm078074; Wed, 5 Jan 2011 12:27:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05CRvAF078071; Wed, 5 Jan 2011 12:27:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101051227.p05CRvAF078071@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Jan 2011 12:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217001 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 12:27:57 -0000 Author: marius Date: Wed Jan 5 12:27:57 2011 New Revision: 217001 URL: http://svn.freebsd.org/changeset/base/217001 Log: MFC: r216802 - Move the macros for generating load and store instructions to asmacros.h so they can be shared by different source files and extend them by a variant for atomic compare and swap. - Consistently use EMPTY. Modified: stable/7/sys/sparc64/include/asmacros.h stable/7/sys/sparc64/sparc64/support.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/asmacros.h ============================================================================== --- stable/7/sys/sparc64/include/asmacros.h Wed Jan 5 12:27:52 2011 (r217000) +++ stable/7/sys/sparc64/include/asmacros.h Wed Jan 5 12:27:57 2011 (r217001) @@ -33,7 +33,7 @@ /* * Normal and alternate %g6 point to the pcb of the current process. Normal, - & alternate and interrupt %g7 point to per-cpu data. + * alternate and interrupt %g7 point to per-cpu data. */ #define PCB_REG %g6 #define PCPU_REG %g7 @@ -134,6 +134,19 @@ name: #define EMPTY +/* + * Generate atomic compare and swap, load and store instructions for the + * corresponding width and ASI (or not). Note that we want to evaluate the + * macro args before concatenating, so that EMPTY really turns into nothing. + */ +#define _LD(w, a) ld ## w ## a +#define _ST(w, a) st ## w ## a +#define _CAS(w, a) cas ## w ## a + +#define LD(w, a) _LD(w, a) +#define ST(w, a) _ST(w, a) +#define CAS(w, a) _CAS(w, a) + #endif /* LOCORE */ #endif /* _KERNEL */ Modified: stable/7/sys/sparc64/sparc64/support.S ============================================================================== --- stable/7/sys/sparc64/sparc64/support.S Wed Jan 5 12:27:52 2011 (r217000) +++ stable/7/sys/sparc64/sparc64/support.S Wed Jan 5 12:27:57 2011 (r217001) @@ -44,19 +44,6 @@ __FBSDID("$FreeBSD$"); .register %g3, #ignore .register %g6, #ignore -#define E /* empty */ - -/* - * Generate load and store instructions for the corresponding width and asi - * (or not). Note that we want to evaluate the macro args before - * concatenating, so that E really turns into nothing. - */ -#define _LD(w, a) ld ## w ## a -#define _ST(w, a) st ## w ## a - -#define LD(w, a) _LD(w, a) -#define ST(w, a) _ST(w, a) - /* * Common code for copy routines. * @@ -233,7 +220,7 @@ END(ascopy) */ ENTRY(ascopyfrom) wr %o0, 0, %asi - _MEMCPY(%o2, %o1, %o3, E, E, a, %asi) + _MEMCPY(%o2, %o1, %o3, EMPTY, EMPTY, a, %asi) retl nop END(ascopyfrom) @@ -243,7 +230,7 @@ END(ascopyfrom) */ ENTRY(ascopyto) wr %o1, 0, %asi - _MEMCPY(%o2, %o0, %o3, a, %asi, E, E) + _MEMCPY(%o2, %o0, %o3, a, %asi, EMPTY, EMPTY) retl nop END(ascopyto) @@ -307,7 +294,7 @@ ENTRY(bcopy) /* * Do the fast version. */ -3: _MEMCPY(%o1, %o0, %o2, E, E, E, E) +3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) retl nop END(bcopy) @@ -316,7 +303,7 @@ END(bcopy) * void bzero(void *b, size_t len) */ ENTRY(bzero) - _MEMSET(%o0, %g0, %o1, E, E) + _MEMSET(%o0, %g0, %o1, EMPTY, EMPTY) retl nop END(bzero) @@ -325,7 +312,7 @@ END(bzero) * int copystr(const void *src, void *dst, size_t len, size_t *done) */ ENTRY(copystr) - _COPYSTR(%o0, %o1, %o2, %o3, E, E, E, E) + _COPYSTR(%o0, %o1, %o2, %o3, EMPTY, EMPTY, EMPTY, EMPTY) retl mov %g1, %o0 END(copystr) @@ -335,7 +322,7 @@ END(copystr) */ ENTRY(memcpy) mov %o0, %o3 - _MEMCPY(%o3, %o1, %o2, E, E, E, E) + _MEMCPY(%o3, %o1, %o2, EMPTY, EMPTY, EMPTY, EMPTY) retl nop END(memcpy) @@ -345,7 +332,7 @@ END(memcpy) */ ENTRY(memset) mov %o0, %o3 - _MEMSET(%o3, %o1, %o2, E, E) + _MEMSET(%o3, %o1, %o2, EMPTY, EMPTY) retl nop END(memset) @@ -359,7 +346,7 @@ copy_nofault_begin: */ ENTRY(copyin) wr %g0, ASI_AIUP, %asi - _MEMCPY(%o1, %o0, %o2, E, E, a, %asi) + _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, a, %asi) retl clr %o0 END(copyin) @@ -369,7 +356,7 @@ END(copyin) */ ENTRY(copyinstr) wr %g0, ASI_AIUP, %asi - _COPYSTR(%o0, %o1, %o2, %o3, a, %asi, E, E) + _COPYSTR(%o0, %o1, %o2, %o3, a, %asi, EMPTY, EMPTY) retl mov %g1, %o0 END(copyinstr) @@ -379,7 +366,7 @@ END(copyinstr) */ ENTRY(copyout) wr %g0, ASI_AIUP, %asi - _MEMCPY(%o1, %o0, %o2, a, %asi, E, E) + _MEMCPY(%o1, %o0, %o2, a, %asi, EMPTY, EMPTY) retl clr %o0 END(copyout)