Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/include fix _UC_MACHINE_SP() for the vm86 case...
details: https://anonhg.NetBSD.org/src/rev/ad6d2fd0bdf2
branches: trunk
changeset: 550915:ad6d2fd0bdf2
user: drochner <drochner%NetBSD.org@localhost>
date: Mon Aug 25 09:20:25 2003 +0000
description:
fix _UC_MACHINE_SP() for the vm86 case: we have to add the SS offset
diffstat:
sys/arch/i386/include/mcontext.h | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diffs (26 lines):
diff -r a63835c8bb04 -r ad6d2fd0bdf2 sys/arch/i386/include/mcontext.h
--- a/sys/arch/i386/include/mcontext.h Mon Aug 25 09:12:42 2003 +0000
+++ b/sys/arch/i386/include/mcontext.h Mon Aug 25 09:20:25 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.2 2003/01/17 23:10:28 thorpej Exp $ */
+/* $NetBSD: mcontext.h,v 1.3 2003/08/25 09:20:25 drochner Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -104,7 +104,16 @@
#define _UC_UCONTEXT_ALIGN (~0xf)
#ifdef _KERNEL
+#include "opt_vm86.h"
+#ifdef VM86
+/*#include <machine/psl.h>*/
+#define PSL_VM 0x00020000
+#define _UC_MACHINE_SP(uc) ((uc)->uc_mcontext.__gregs[_REG_UESP] + \
+ ((uc)->uc_mcontext.__gregs[_REG_EFL] & PSL_VM ? \
+ ((uc)->uc_mcontext.__gregs[_REG_SS] << 4) : 0))
+#else
#define _UC_MACHINE_SP(uc) ((uc)->uc_mcontext.__gregs[_REG_UESP])
#endif
+#endif
#endif /* !_I386_MCONTEXT_H_ */
Home |
Main Index |
Thread Index |
Old Index