From owner-svn-src-head@FreeBSD.ORG Mon Apr 16 09:38:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55315106564A; Mon, 16 Apr 2012 09:38:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E4468FC08; Mon, 16 Apr 2012 09:38:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3G9cLKx026098; Mon, 16 Apr 2012 09:38:21 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3G9cLmw026093; Mon, 16 Apr 2012 09:38:21 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201204160938.q3G9cLmw026093@svn.freebsd.org> From: Andrew Turner Date: Mon, 16 Apr 2012 09:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234337 - in head: lib/libc/arm/gen sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2012 09:38:21 -0000 Author: andrew Date: Mon Apr 16 09:38:20 2012 New Revision: 234337 URL: http://svn.freebsd.org/changeset/base/234337 Log: Replace the C implementation of __aeabi_read_tp with an assembly version. This ensures we follow the ABI by preserving registers r1-r3. Reviewed by: jmallett, imp Added: head/lib/libc/arm/gen/__aeabi_read_tp.S (contents, props changed) Deleted: head/lib/libc/arm/gen/__aeabi_read_tp.c Modified: head/lib/libc/arm/gen/Makefile.inc head/sys/arm/include/armreg.h head/sys/arm/include/sysarch.h Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Mon Apr 16 08:19:43 2012 (r234336) +++ head/lib/libc/arm/gen/Makefile.inc Mon Apr 16 09:38:20 2012 (r234337) @@ -3,4 +3,4 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ getcontextx.c infinity.c ldexp.c makecontext.c \ - __aeabi_read_tp.c setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c + __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c Added: head/lib/libc/arm/gen/__aeabi_read_tp.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/__aeabi_read_tp.S Mon Apr 16 09:38:20 2012 (r234337) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +ENTRY(__aeabi_read_tp) + ldr r0, .Larm_tp_address + ldr r0, [r0] + RET + +.Larm_tp_address: + .word ARM_TP_ADDRESS + Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Mon Apr 16 08:19:43 2012 (r234336) +++ head/sys/arm/include/armreg.h Mon Apr 16 09:38:20 2012 (r234337) @@ -316,8 +316,13 @@ /* * Address of the vector page, low and high versions. */ +#ifndef __ASSEMBLER__ #define ARM_VECTORS_LOW 0x00000000U #define ARM_VECTORS_HIGH 0xffff0000U +#else +#define ARM_VECTORS_LOW 0 +#define ARM_VECTORS_HIGH 0xffff0000 +#endif /* * ARM Instructions Modified: head/sys/arm/include/sysarch.h ============================================================================== --- head/sys/arm/include/sysarch.h Mon Apr 16 08:19:43 2012 (r234336) +++ head/sys/arm/include/sysarch.h Mon Apr 16 09:38:20 2012 (r234337) @@ -55,6 +55,7 @@ #define ARM_RAS_END (ARM_TP_ADDRESS + 8) #ifndef LOCORE +#ifndef __ASSEMBLER__ #include @@ -85,6 +86,7 @@ int sysarch(int, void *); __END_DECLS #endif +#endif /* __ASSEMBLER__ */ #endif /* LOCORE */ #endif /* !_ARM_SYSARCH_H_ */