Module Name:    src
Committed By:   matt
Date:           Wed Nov 28 02:21:41 UTC 2012

Modified Files:
        src/lib/libc/arch/arm [matt-nb6-plus]: Makefile.inc
        src/lib/libc/arch/arm/gen [matt-nb6-plus]: _lwp.c makecontext.c
            swapcontext.S
Added Files:
        src/lib/libc/arch/arm [matt-nb6-plus]: genassym.cf

Log Message:
Pullup EABI changes.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.4.1 src/lib/libc/arch/arm/Makefile.inc
cvs rdiff -u -r0 -r1.1.6.2 src/lib/libc/arch/arm/genassym.cf
cvs rdiff -u -r1.5 -r1.5.8.1 src/lib/libc/arch/arm/gen/_lwp.c
cvs rdiff -u -r1.3 -r1.3.26.1 src/lib/libc/arch/arm/gen/makecontext.c
cvs rdiff -u -r1.5.26.1 -r1.5.26.2 src/lib/libc/arch/arm/gen/swapcontext.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/arm/Makefile.inc
diff -u src/lib/libc/arch/arm/Makefile.inc:1.10 src/lib/libc/arch/arm/Makefile.inc:1.10.4.1
--- src/lib/libc/arch/arm/Makefile.inc:1.10	Fri Nov 18 16:10:02 2011
+++ src/lib/libc/arch/arm/Makefile.inc	Wed Nov 28 02:21:41 2012
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile.inc,v 1.10 2011/11/18 16:10:02 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.10.4.1 2012/11/28 02:21:41 matt Exp $
 
 .include <bsd.own.mk>
 
 SRCS+=	__aeabi_read_tp.S __sigaction14_sigtramp.c __sigtramp2.S
 
-CPPFLAGS += -DSOFTFLOAT
+CPPFLAGS += -I.
+CPPFLAGS += -DSOFTFLOAT -I.
 
 SOFTFLOAT_BITS=32
 .include <softfloat/Makefile.inc>

Index: src/lib/libc/arch/arm/gen/_lwp.c
diff -u src/lib/libc/arch/arm/gen/_lwp.c:1.5 src/lib/libc/arch/arm/gen/_lwp.c:1.5.8.1
--- src/lib/libc/arch/arm/gen/_lwp.c:1.5	Thu Feb 24 04:28:41 2011
+++ src/lib/libc/arch/arm/gen/_lwp.c	Wed Nov 28 02:21:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: _lwp.c,v 1.5 2011/02/24 04:28:41 joerg Exp $	*/
+/*	$NetBSD: _lwp.c,v 1.5.8.1 2012/11/28 02:21:41 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _lwp.c,v 1.5 2011/02/24 04:28:41 joerg Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.5.8.1 2012/11/28 02:21:41 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -50,7 +50,7 @@ void
 _lwp_makecontext(ucontext_t *u, void (*start)(void *),
     void *arg, void *private, caddr_t stack_base, size_t stack_size)
 {
-	void **sp;
+	uintptr_t sp;
 
 	getcontext(u);
 	u->uc_link = NULL;
@@ -58,16 +58,15 @@ _lwp_makecontext(ucontext_t *u, void (*s
 	u->uc_stack.ss_sp = stack_base;
 	u->uc_stack.ss_size = stack_size;
 
-	sp = (void **) (stack_base + stack_size);
-
+	sp = (uintptr_t)stack_base + stack_size;
 	/*
 	 * Note: We make sure the stack is 8-byte aligned, here.
 	 */
 
-	u->uc_mcontext.__gregs[_REG_R0] = (__greg_t) arg;
-	u->uc_mcontext.__gregs[_REG_SP] = ((__greg_t) sp) & ~7;
-	u->uc_mcontext.__gregs[_REG_LR] = (__greg_t) _lwp_exit;
-	u->uc_mcontext.__gregs[_REG_PC] = (__greg_t) start;
-	u->uc_mcontext._mc_tlsbase = (uintptr_t)private;
+	u->uc_mcontext.__gregs[_REG_R0] = (__greg_t)(uintptr_t)arg;
+	u->uc_mcontext.__gregs[_REG_SP] = ((__greg_t)sp) & ~7;
+	u->uc_mcontext.__gregs[_REG_LR] = (__greg_t)(uintptr_t)_lwp_exit;
+	u->uc_mcontext.__gregs[_REG_PC] = (__greg_t)(uintptr_t)start;
+	u->uc_mcontext._mc_tlsbase = (__greg_t)(uintptr_t)private;
 	u->uc_flags |= _UC_TLSBASE;
 }

Index: src/lib/libc/arch/arm/gen/makecontext.c
diff -u src/lib/libc/arch/arm/gen/makecontext.c:1.3 src/lib/libc/arch/arm/gen/makecontext.c:1.3.26.1
--- src/lib/libc/arch/arm/gen/makecontext.c:1.3	Mon Apr 28 20:22:55 2008
+++ src/lib/libc/arch/arm/gen/makecontext.c	Wed Nov 28 02:21:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: makecontext.c,v 1.3 2008/04/28 20:22:55 martin Exp $	*/
+/*	$NetBSD: makecontext.c,v 1.3.26.1 2012/11/28 02:21:41 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.3 2008/04/28 20:22:55 martin Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.3.26.1 2012/11/28 02:21:41 matt Exp $");
 #endif
 
 #include <stddef.h>
@@ -55,12 +55,12 @@ makecontext(ucontext_t *ucp, void (*func
 	/* Allocate necessary stack space for arguments exceeding r0-3. */
 	if (argc > 4)
 		sp -= argc - 4;
-	gr[_REG_SP] = (__greg_t)sp;
+	gr[_REG_SP] = (__greg_t)(uintptr_t)sp;
 	/* Wipe out frame pointer. */
 	gr[_REG_FP] = 0;
 	/* Arrange for return via the trampoline code. */
-	gr[_REG_LR] = (__greg_t)_resumecontext;
-	gr[_REG_PC] = (__greg_t)func;
+	gr[_REG_LR] = (__greg_t)(uintptr_t)_resumecontext;
+	gr[_REG_PC] = (__greg_t)(uintptr_t)func;
 
 	va_start(ap, argc);
 	/* Pass up to four arguments in r0-3. */

Index: src/lib/libc/arch/arm/gen/swapcontext.S
diff -u src/lib/libc/arch/arm/gen/swapcontext.S:1.5.26.1 src/lib/libc/arch/arm/gen/swapcontext.S:1.5.26.2
--- src/lib/libc/arch/arm/gen/swapcontext.S:1.5.26.1	Thu Nov  1 16:44:57 2012
+++ src/lib/libc/arch/arm/gen/swapcontext.S	Wed Nov 28 02:21:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.5.26.1 2012/11/01 16:44:57 matt Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.5.26.2 2012/11/28 02:21:41 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,19 +30,22 @@
  */
 
 #include "SYS.h"
+#include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-        RCSID("$NetBSD: swapcontext.S,v 1.5.26.1 2012/11/01 16:44:57 matt Exp $")
+        RCSID("$NetBSD: swapcontext.S,v 1.5.26.2 2012/11/28 02:21:41 matt Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 ENTRY(swapcontext)
 	stmfd	sp!, {r0-r1, lr}	/* Must save oucp, ucp, lr. */
+	sub	sp, sp, #4
 	bl	PIC_SYM(_C_LABEL(_getcontext), PLT)  /* getcontext(oucp) */
 	cmp	r0, #0
+	add	sp, sp, #4
 	ldmfd	sp!, {r0-r1, lr}
 	RETc(ne)
-	str	sp, [r0, #(36 + 13*4)]	/* Adjust saved SP. */
-	str	lr, [r0, #(36 + 15*4)]	/* Adjust saved PC. */
+	str	sp, [r0, #_UC_REGS_SP]	/* Adjust saved SP. */
+	str	lr, [r0, #_UC_REGS_PC]	/* Adjust saved PC. */
 #ifdef SOFTFLOAT
 	/* Ahem. */
 #endif

Added files:

Index: src/lib/libc/arch/arm/genassym.cf
diff -u /dev/null src/lib/libc/arch/arm/genassym.cf:1.1.6.2
--- /dev/null	Wed Nov 28 02:21:42 2012
+++ src/lib/libc/arch/arm/genassym.cf	Wed Nov 28 02:21:41 2012
@@ -0,0 +1,36 @@
+#	$NetBSD: genassym.cf,v 1.1.6.2 2012/11/28 02:21:41 matt Exp $
+
+#
+# Copyright (c) 2012 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Nick Hudson
+#
+# 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <sys/types.h>
+include <ucontext.h>
+
+define _UC_REGS_SP	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP])
+define _UC_REGS_PC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])

Reply via email to