$NetBSD: patch-ad,v 1.5 2007/07/31 14:44:03 obache Exp $ --- source/vmmon/netbsd/host.c.orig 2003-02-16 21:28:36.000000000 +0900 +++ source/vmmon/netbsd/host.c @@ -60,6 +60,13 @@ lyaev Exp $ extern vm_map_t kernel_map; #endif +/* use curproc for pre-nathanw-sa world, curlwp post */ +#if __NetBSD_Version__ >= 106130000 +#define CURLWP curlwp /* new world order */ +#else +#define CURLWP curproc /* old world order */ +#endif + #include "x86.h" #include "vm_types.h" #include "vm_assert.h" @@ -272,7 +279,7 @@ HostIF_InitFP(VMDriver *vm) if (!(val & mask)) { val = val | mask; - outb(val,0xA1); + outb(0xA1,val); } #endif } @@ -635,7 +642,7 @@ HostIF_UserToDriverPtr(VMDriver *vm, voi if (vm->crossvaddr != NULL) Warning("KernelAddr already allocated\n"); - PHOLD(curproc); + PHOLD(CURLWP); uvm_vslock(curproc, addr, PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); @@ -644,7 +651,7 @@ HostIF_UserToDriverPtr(VMDriver *vm, voi pmap_extract(vm_map_pmap(&curproc->p_vmspace->vm_map), uaddr, &paddr); pmap_kenter_pa(kvaddr, paddr, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE); - PRELE(curproc); + PRELE(CURLWP); vm->crossvaddr = (void *)kvaddr; vm->crossuaddr = addr; #ifdef DEBUG