Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/matt-nb6-plus]: src/lib/libc/arch/arm Pullup EABI changes.
details: https://anonhg.NetBSD.org/src/rev/11af753daea1
branches: matt-nb6-plus
changeset: 774507:11af753daea1
user: matt <matt%NetBSD.org@localhost>
date: Wed Nov 28 02:21:41 2012 +0000
description:
Pullup EABI changes.
diffstat:
lib/libc/arch/arm/Makefile.inc | 5 +++--
lib/libc/arch/arm/gen/_lwp.c | 19 +++++++++----------
lib/libc/arch/arm/gen/makecontext.c | 10 +++++-----
lib/libc/arch/arm/gen/swapcontext.S | 11 +++++++----
lib/libc/arch/arm/genassym.cf | 36 ++++++++++++++++++++++++++++++++++++
5 files changed, 60 insertions(+), 21 deletions(-)
diffs (176 lines):
diff -r 14a788091348 -r 11af753daea1 lib/libc/arch/arm/Makefile.inc
--- a/lib/libc/arch/arm/Makefile.inc Wed Nov 28 01:53:42 2012 +0000
+++ b/lib/libc/arch/arm/Makefile.inc Wed Nov 28 02:21:41 2012 +0000
@@ -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>
diff -r 14a788091348 -r 11af753daea1 lib/libc/arch/arm/gen/_lwp.c
--- a/lib/libc/arch/arm/gen/_lwp.c Wed Nov 28 01:53:42 2012 +0000
+++ b/lib/libc/arch/arm/gen/_lwp.c Wed Nov 28 02:21:41 2012 +0000
@@ -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 @@
_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 @@
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;
}
diff -r 14a788091348 -r 11af753daea1 lib/libc/arch/arm/gen/makecontext.c
--- a/lib/libc/arch/arm/gen/makecontext.c Wed Nov 28 01:53:42 2012 +0000
+++ b/lib/libc/arch/arm/gen/makecontext.c Wed Nov 28 02:21:41 2012 +0000
@@ -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 @@
/* 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. */
diff -r 14a788091348 -r 11af753daea1 lib/libc/arch/arm/gen/swapcontext.S
--- a/lib/libc/arch/arm/gen/swapcontext.S Wed Nov 28 01:53:42 2012 +0000
+++ b/lib/libc/arch/arm/gen/swapcontext.S Wed Nov 28 02:21:41 2012 +0000
@@ -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
diff -r 14a788091348 -r 11af753daea1 lib/libc/arch/arm/genassym.cf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/arm/genassym.cf Wed Nov 28 02:21:41 2012 +0000
@@ -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])
Home |
Main Index |
Thread Index |
Old Index