diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/kvm86.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/kvm86.c b/sys/arch/i386/i386/kvm86.c index 7cf1df582a0..2ccea3bcd8b 100644 --- a/sys/arch/i386/i386/kvm86.c +++ b/sys/arch/i386/i386/kvm86.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm86.c,v 1.1 2006/06/13 03:01:04 gwk Exp $ */ +/* $OpenBSD: kvm86.c,v 1.2 2006/11/27 16:00:19 gwk Exp $ */ /* $NetBSD: kvm86.c,v 1.10 2005/12/26 19:23:59 perry Exp $ */ /* * Copyright (c) 2002 @@ -32,6 +32,8 @@ #include <sys/proc.h> #include <sys/user.h> #include <sys/malloc.h> +#include <sys/mutex.h> +#include <sys/simplelock.h> #include <uvm/uvm_extern.h> #include <uvm/uvm.h> #include <machine/pcb.h> @@ -72,6 +74,8 @@ void *bioscallscratchpage; /* a virtual page to map in vm86 memory temporarily */ vaddr_t bioscalltmpva; +struct mutex kvm86_mp_mutex; + #define KVM86_IOPL3 /* not strictly necessary, saves a lot of traps */ void @@ -122,6 +126,7 @@ kvm86_init() kvm86_map(vmd, pa, BIOSCALLSCRATCHPAGE_VMVA); bioscallvmd = vmd; bioscalltmpva = uvm_km_alloc(kernel_map, PAGE_SIZE); + mtx_init(&kvm86_mp_mutex, IPL_IPI); } /* @@ -260,8 +265,10 @@ kvm86_simplecall(int no, struct kvm86regs *regs) tf.tf_edi = regs->edi; tf.tf_vm86_es = regs->es; + mtx_enter(&kvm86_mp_mutex); res = kvm86_bioscall(no, &tf); - + mtx_leave(&kvm86_mp_mutex); + regs->eax = tf.tf_eax; regs->ebx = tf.tf_ebx; regs->ecx = tf.tf_ecx; |