Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 call kvm86's GPF handler



details:   https://anonhg.NetBSD.org/src/rev/1006a7462f7c
branches:  trunk
changeset: 533690:1006a7462f7c
user:      drochner <drochner%NetBSD.org@localhost>
date:      Sun Jul 07 13:24:36 2002 +0000

description:
call kvm86's GPF handler

diffstat:

 sys/arch/i386/i386/trap.c |  20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diffs (60 lines):

diff -r 6d4dac1c26c5 -r 1006a7462f7c sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Sun Jul 07 13:23:17 2002 +0000
+++ b/sys/arch/i386/i386/trap.c Sun Jul 07 13:24:36 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.166 2002/07/03 02:46:15 yamt Exp $  */
+/*     $NetBSD: trap.c,v 1.167 2002/07/07 13:24:36 drochner Exp $      */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -79,12 +79,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.166 2002/07/03 02:46:15 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.167 2002/07/07 13:24:36 drochner Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
 #include "opt_math_emulate.h"
 #include "opt_vm86.h"
+#include "opt_kvm86.h"
 #include "opt_cputype.h"
 #include "opt_kstack_dr0.h"
 
@@ -127,6 +128,13 @@
 int trapwrite __P((unsigned));
 #endif
 
+#ifdef KVM86
+#include <machine/kvm86.h>
+#define KVM86MODE (kvm86_incall)
+#else
+#define KVM86MODE (0)
+#endif
+
 const char *trap_type[] = {
        "privileged instruction fault",         /*  0 T_PRIVINFLT */
        "breakpoint trap",                      /*  1 T_BPTFLT */
@@ -193,7 +201,7 @@
        }
 #endif
 
-       if (!KERNELMODE(frame.tf_cs, frame.tf_eflags)) {
+       if (!KVM86MODE && !KERNELMODE(frame.tf_cs, frame.tf_eflags)) {
                type |= T_USER;
                p->p_md.md_regs = &frame;
                pcb->pcb_cr2 = 0;
@@ -248,6 +256,12 @@
                /*NOTREACHED*/
 
        case T_PROTFLT:
+#ifdef KVM86
+               if (KVM86MODE) {
+                       kvm86_gpfault(&frame);
+                       return;
+               }
+#endif
        case T_SEGNPFLT:
        case T_ALIGNFLT:
        case T_TSSFLT:



Home | Main Index | Thread Index | Old Index