diff options
author | dyson <dyson@FreeBSD.org> | 1997-08-09 00:04:06 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1997-08-09 00:04:06 +0000 |
commit | ad0649e2b977efaa77b68c699a1f44b12e7429d1 (patch) | |
tree | 925573ddb83b4a0cf21a7d136de8f44817243b6c /sys/i386/isa | |
parent | 56b351207af0157d77bdd770e72c7ff038d57164 (diff) | |
download | FreeBSD-src-ad0649e2b977efaa77b68c699a1f44b12e7429d1.zip FreeBSD-src-ad0649e2b977efaa77b68c699a1f44b12e7429d1.tar.gz |
VM86 kernel support.
Work done by BSDI, Jonathan Lemon <jlemon@americantv.com>,
Mike Smith <msmith@gsoft.com.au>, Sean Eric Fagan <sef@kithrup.com>,
and probably alot of others.
Submitted by: Jnathan Lemon <jlemon@americantv.com>
Diffstat (limited to 'sys/i386/isa')
-rw-r--r-- | sys/i386/isa/ipl.s | 28 | ||||
-rw-r--r-- | sys/i386/isa/npx.c | 4 |
2 files changed, 29 insertions, 3 deletions
diff --git a/sys/i386/isa/ipl.s b/sys/i386/isa/ipl.s index 797aa8f..45b0de5 100644 --- a/sys/i386/isa/ipl.s +++ b/sys/i386/isa/ipl.s @@ -36,7 +36,7 @@ * * @(#)ipl.s * - * $Id: ipl.s,v 1.3 1997/07/30 22:46:49 smp Exp smp $ + * $Id: ipl.s,v 1.5 1997/07/31 05:42:06 fsmp Exp $ */ @@ -120,6 +120,23 @@ doreti_exit: movl %eax,_cpl decb _intr_nesting_level MEXITCOUNT +#ifdef VM86 + /* + * XXX + * Sometimes when attempting to return to vm86 mode, cpl is not + * being reset to 0, so here we force it to 0 before returning to + * vm86 mode. doreti_stop is a convenient place to set a breakpoint. + * When the cpl problem is solved, this code can disappear. + */ + cmpl $0,_cpl + je 1f + testl $PSL_VM,TF_EFLAGS(%esp) + je 1f +doreti_stop: + movl $0,_cpl + nop +1: +#endif /* VM86 */ #if 0 REL_MPLOCK #else @@ -198,6 +215,7 @@ swi_ast: addl $8,%esp /* discard raddr & cpl to get trap frame */ testb $SEL_RPL_MASK,TRAPF_CS_OFF(%esp) je swi_ast_phantom +swi_ast_user: movl $T_ASTFLT,(2+8+0)*4(%esp) movb $0,_intr_nesting_level /* finish becoming a trap handler */ call _trap @@ -207,6 +225,14 @@ swi_ast: ALIGN_TEXT swi_ast_phantom: +#ifdef VM86 + /* + * check for ast from vm86 mode. Placed down here so the jumps do + * not get taken for mainline code. + */ + testl $PSL_VM,TF_EFLAGS(%esp) + jne swi_ast_user +#endif /* VM86 */ /* * These happen when there is an interrupt in a trap handler before * ASTs can be masked or in an lcall handler before they can be diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index 4dd1e3c..32fa57a 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 - * $Id: npx.c,v 1.3 1997/07/20 23:30:38 smp Exp smp $ + * $Id: npx.c,v 1.49 1997/07/21 07:57:50 fsmp Exp $ */ #include "npx.h" @@ -515,7 +515,7 @@ npxintr(unit) * Pass exception to process. */ frame = (struct intrframe *)&unit; /* XXX */ - if (ISPL(frame->if_cs) == SEL_UPL) { + if ((ISPL(frame->if_cs) == SEL_UPL) || (frame->if_eflags & PSL_VM)) { /* * Interrupt is essentially a trap, so we can afford to call * the SIGFPE handler (if any) as soon as the interrupt |