From 8cd8c801b633e2ca53f229dff7c1ea878e1cf0d8 Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 2 May 1996 13:42:56 +0000 Subject: [PATCH] sync with netbsd --- sys/arch/i386/i386/vm86.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sys/arch/i386/i386/vm86.c b/sys/arch/i386/i386/vm86.c index 9ce1c9db6da..9dda35ab6de 100644 --- a/sys/arch/i386/i386/vm86.c +++ b/sys/arch/i386/i386/vm86.c @@ -1,5 +1,5 @@ -/* $OpenBSD: vm86.c,v 1.4 1996/04/21 22:16:42 deraadt Exp $ */ -/* $NetBSD: vm86.c,v 1.9 1996/04/12 05:57:43 mycroft Exp $ */ +/* $OpenBSD: vm86.c,v 1.5 1996/05/02 13:42:56 deraadt Exp $ */ +/* $NetBSD: vm86.c,v 1.13 1996/04/25 13:50:21 mycroft Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -269,6 +269,7 @@ vm86_return(p, retval) #define CLI 0xFA #define STI 0xFB #define INTxx 0xCD +#define INTO 0xCE #define IRET 0xCF #define OPSIZ 0x66 #define INT3 0xCC /* Actually the process gets 32-bit IDT to handle it */ @@ -292,14 +293,17 @@ vm86_gpfault(p, type) * address space for checking. remember that the frame's * segment selectors are real-mode style selectors. */ - u_char tmpbyte; u_long cs, ip, ss, sp; + u_char tmpbyte; + int trace; cs = CS(tf) << 4; ip = IP(tf); ss = SS(tf) << 4; sp = SP(tf); + trace = tf->tf_eflags & PSL_T; + /* * For most of these, we must set all the registers before calling * macros/functions which might do a vm86_return. @@ -327,6 +331,11 @@ vm86_gpfault(p, type) fast_intxx(p, tmpbyte); break; + case INTO: + if (tf->tf_eflags & PSL_V) + fast_intxx(p, 4); + break; + case PUSHF: putword(ss, sp, get_vflags_short(p)); SP(tf) = sp; @@ -368,6 +377,9 @@ vm86_gpfault(p, type) IP(tf) -= 1; goto bad; } + + if (trace && tf->tf_eflags & PSL_VM) + trapsignal(p, SIGTRAP, T_TRCTRAP); return; bad: -- 2.20.1