Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/arch/sh5 Now make these actually work.
details: https://anonhg.NetBSD.org/src/rev/71d30f206bc7
branches: trunk
changeset: 542134:71d30f206bc7
user: scw <scw%NetBSD.org@localhost>
date: Wed Jan 22 13:44:36 2003 +0000
description:
Now make these actually work.
diffstat:
lib/libc/arch/sh5/gen/makecontext.c | 6 +++---
lib/libc/arch/sh5/gen/swapcontext.S | 8 +++++---
lib/libc/arch/sh5/sys/getcontext.S | 9 +++++----
3 files changed, 13 insertions(+), 10 deletions(-)
diffs (85 lines):
diff -r 72c87eaa73bb -r 71d30f206bc7 lib/libc/arch/sh5/gen/makecontext.c
--- a/lib/libc/arch/sh5/gen/makecontext.c Wed Jan 22 13:40:57 2003 +0000
+++ b/lib/libc/arch/sh5/gen/makecontext.c Wed Jan 22 13:44:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: makecontext.c,v 1.3 2003/01/21 11:29:29 scw Exp $ */
+/* $NetBSD: makecontext.c,v 1.4 2003/01/22 13:44:36 scw Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.3 2003/01/21 11:29:29 scw Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.4 2003/01/22 13:44:36 scw Exp $");
#endif
#include <sys/types.h>
@@ -105,7 +105,7 @@
* First 8 args are passed in r2-r9
*/
for (i = 0; i < argc && i < 8; i++)
- gr[_REG_R(i)] = (register_t)va_arg(ap, long);
+ gr[_REG_R(i + 2)] = (register_t)va_arg(ap, long);
/*
* Additional args are passed on the stack as 64-bit quantities
diff -r 72c87eaa73bb -r 71d30f206bc7 lib/libc/arch/sh5/gen/swapcontext.S
--- a/lib/libc/arch/sh5/gen/swapcontext.S Wed Jan 22 13:40:57 2003 +0000
+++ b/lib/libc/arch/sh5/gen/swapcontext.S Wed Jan 22 13:44:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: swapcontext.S,v 1.1 2003/01/19 23:05:03 scw Exp $ */
+/* $NetBSD: swapcontext.S,v 1.2 2003/01/22 13:44:36 scw Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@@ -38,14 +38,16 @@
#include "SYS.h"
#if defined(LIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: swapcontext.S,v 1.1 2003/01/19 23:05:03 scw Exp $")
+ RCSID("$NetBSD: swapcontext.S,v 1.2 2003/01/22 13:44:36 scw Exp $")
#endif /* LIBC_SCCS && !lint */
ENTRY(swapcontext)
or r2, r63, r4 /* Preserve oucp in r4 across syscall */
+ or r18, r63, r5 /* Preserve return address similarly */
SYSCALL(getcontext) /* Note: preserves ucp(r3) & oucp(r4) */
+ st.q r4, 40, r5 /* Adjust saved program counter */
st.q r4, 72, r63 /* Arrange for return value of 0 */
- st.q r4, 176, r18 /* Adjust saved program counter */
or r3, r63, r2 /* Fetch 'ucp' */
SYSCALL(setcontext)
/*NOTREACHED*/
+ brk /* But just in case ... */
diff -r 72c87eaa73bb -r 71d30f206bc7 lib/libc/arch/sh5/sys/getcontext.S
--- a/lib/libc/arch/sh5/sys/getcontext.S Wed Jan 22 13:40:57 2003 +0000
+++ b/lib/libc/arch/sh5/sys/getcontext.S Wed Jan 22 13:44:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getcontext.S,v 1.1 2003/01/19 23:05:04 scw Exp $ */
+/* $NetBSD: getcontext.S,v 1.2 2003/01/22 13:44:37 scw Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
#include "SYS.h"
#if defined(SYSLIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: getcontext.S,v 1.1 2003/01/19 23:05:04 scw Exp $")
+ RCSID("$NetBSD: getcontext.S,v 1.2 2003/01/22 13:44:37 scw Exp $")
#endif /* SYSLIBC_SCCS && !lint */
#ifdef WEAK_ALIAS
@@ -47,8 +47,9 @@
ENTRY(_getcontext)
or r2, r63, r3 /* Preserve ucp in r3 across syscall */
+ or r18, r63, r4 /* Preserve return address similarly */
SYSCALL(getcontext)
- ptabs/l r18, tr0
+ ptabs/l r4, tr0
st.q r3, 72, r63 /* Arrange for return value of 0 */
- st.q r3, 176, r18 /* Adjust saved program counter */
+ st.q r3, 40, r4 /* Adjust saved program counter */
blink tr0, r63
Home |
Main Index |
Thread Index |
Old Index