Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mvme68k/mvme68k On exit from syscalls, don't trash ...
details: https://anonhg.NetBSD.org/src/rev/fa8a601fd325
branches: trunk
changeset: 499948:fa8a601fd325
user: scw <scw%NetBSD.org@localhost>
date: Sat Dec 02 17:00:46 2000 +0000
description:
On exit from syscalls, don't trash %A0 if the process is
using the COMPAT_AOUT_M68K emulation package.
diffstat:
sys/arch/mvme68k/mvme68k/trap.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diffs (38 lines):
diff -r 7c38b2cd2511 -r fa8a601fd325 sys/arch/mvme68k/mvme68k/trap.c
--- a/sys/arch/mvme68k/mvme68k/trap.c Sat Dec 02 16:57:41 2000 +0000
+++ b/sys/arch/mvme68k/mvme68k/trap.c Sat Dec 02 17:00:46 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.50 2000/12/02 13:45:14 scw Exp $ */
+/* $NetBSD: trap.c,v 1.51 2000/12/02 17:00:46 scw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -93,6 +93,10 @@
extern struct emul emul_linux;
#endif
+#ifdef COMPAT_AOUT_M68K
+extern struct emul emul_netbsd_aoutm68k;
+#endif
+
int writeback __P((struct frame *fp, int docachepush));
void trap __P((int type, u_int code, u_int v, struct frame frame));
void syscall __P((register_t code, struct frame frame));
@@ -1131,8 +1135,16 @@
error = (*callp->sy_call)(p, args, rval);
switch (error) {
case 0:
- frame.f_regs[D0] = frame.f_regs[A0] = rval[0];
+ frame.f_regs[D0] = rval[0];
frame.f_regs[D1] = rval[1];
+#ifdef COMPAT_AOUT_M68K
+ /*
+ * Some pre-m68k ELF libc assembler stubs assume
+ * %a0 is preserved across system calls...
+ */
+ if (p->p_emul != &emul_netbsd_aoutm68k)
+ frame.f_regs[A0] = rval[0];
+#endif
frame.f_sr &= ~PSL_C; /* carry bit */
break;
case ERESTART:
Home |
Main Index |
Thread Index |
Old Index