Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/arch/sh3/gen Adjust _UC_MACHINE_SP(oucp) to "drop" ...
details: https://anonhg.NetBSD.org/src/rev/5656990b5350
branches: trunk
changeset: 335815:5656990b5350
user: uwe <uwe%NetBSD.org@localhost>
date: Sun Jan 25 01:32:26 2015 +0000
description:
Adjust _UC_MACHINE_SP(oucp) to "drop" values we pushed to the stack.
t_swapcontext tests pass now with gcc 4.8.
>From Yasushi Oshima in PR port-sh3/49597
diffstat:
lib/libc/arch/sh3/gen/swapcontext.S | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diffs (36 lines):
diff -r 0816b0716bdb -r 5656990b5350 lib/libc/arch/sh3/gen/swapcontext.S
--- a/lib/libc/arch/sh3/gen/swapcontext.S Sat Jan 24 20:17:22 2015 +0000
+++ b/lib/libc/arch/sh3/gen/swapcontext.S Sun Jan 25 01:32:26 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: swapcontext.S,v 1.10 2013/09/12 15:36:15 joerg Exp $ */
+/* $NetBSD: swapcontext.S,v 1.11 2015/01/25 01:32:26 uwe Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: swapcontext.S,v 1.10 2013/09/12 15:36:15 joerg Exp $")
+ RCSID("$NetBSD: swapcontext.S,v 1.11 2015/01/25 01:32:26 uwe Exp $")
#endif /* SYSLIBC_SCCS and not lint */
/*
@@ -53,6 +53,17 @@
/* Note: getcontext does _UC_MACHINE_INTRV(oucp) = 0 for us */
mov.l @sp, r0
mov.l r0, @(36 + 1 * 4, r1) /* _UC_MACHINE_SET_PC(oucp, pr) */
+
+ /* Adjust stack pointer in oucp */
+ mov sp, r2
+ mov #(36 + 21 * 4), r0 /* offset to _UC_MACHINE_SP */
+#ifdef __PIC__
+ add #12, r2 /* "drop" r12, r5, pr */
+#else
+ add #8, r2 /* "drop" r5, pr */
+#endif
+ mov.l r2, @(r0, r1) /* set _UC_MACHINE_SP(oucp) */
+
mov.l .L_setcontext, r2
2: CALL r2 /* setcontext(ucp) */
mov.l @(4, sp), r4
Home |
Main Index |
Thread Index |
Old Index