Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2012 09:38:20 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234337 - in head: lib/libc/arm/gen sys/arm/include
Message-ID:  <201204160938.q3G9cLmw026093@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include <machine/sysarch.h>
+
+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 <sys/cdefs.h>
 
@@ -85,6 +86,7 @@ int	sysarch(int, void *);
 __END_DECLS
 #endif
 
+#endif /* __ASSEMBLER__ */
 #endif /* LOCORE */
 
 #endif /* !_ARM_SYSARCH_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204160938.q3G9cLmw026093>