Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/sys/arch/i386/i386 Pull up revision 1.529 (requested by...
details: https://anonhg.NetBSD.org/src/rev/02bdc8142834
branches: netbsd-1-6
changeset: 530578:02bdc8142834
user: tron <tron%NetBSD.org@localhost>
date: Sat Aug 16 16:17:11 2003 +0000
description:
Pull up revision 1.529 (requested by drochner in ticket #1415):
Fix stack location for VM86 processes in the !sigaltstack case.
I doubt it makes much sense to use the VM's stack for this, but the
old code was doubtless wrong because it potentially overwrote random
user memory.
(It might be a good idea to use the process' pre-vm86()-call stack,
but atm the infrastructure for this is missing.)
diffstat:
sys/arch/i386/i386/machdep.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diffs (35 lines):
diff -r 99488d1d50ab -r 02bdc8142834 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Sat Aug 16 16:02:55 2003 +0000
+++ b/sys/arch/i386/i386/machdep.c Sat Aug 16 16:17:11 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.471.4.3 2003/02/08 06:40:59 jmc Exp $ */
+/* $NetBSD: machdep.c,v 1.471.4.4 2003/08/16 16:17:11 tron Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.471.4.3 2003/02/08 06:40:59 jmc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.471.4.4 2003/08/16 16:17:11 tron Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@@ -2032,8 +2032,14 @@
if (onstack)
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
- else
- fp = (struct sigframe *)tf->tf_esp;
+ else {
+#ifdef VM86
+ if (tf->tf_eflags & PSL_VM)
+ fp = (struct sigframe *)(tf->tf_esp + (tf->tf_ss << 4));
+ else
+#endif
+ fp = (struct sigframe *)tf->tf_esp;
+ }
fp--;
/* Build stack frame for signal trampoline. */
Home |
Main Index |
Thread Index |
Old Index