From: David van Moolenbroek Date: Sat, 13 Oct 2012 17:07:47 +0000 (+0200) Subject: VM: munmap fix X-Git-Tag: v3.2.1~285 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-keygen.html?a=commitdiff_plain;h=46fca8745675ca2e9d46f1cda049a5b9e40e95c0;p=minix.git VM: munmap fix --- diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index 787779675..cc63523b1 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -354,20 +354,22 @@ int do_munmap(message *m) vmp = &vmproc[n]; - if(m->m_type == VM_SHM_UNMAP) { + if(m->m_type == VM_UNMAP_PHYS) { + addr = (vir_bytes) m->VMUP_VADDR; + } else if(m->m_type == VM_SHM_UNMAP) { addr = (vir_bytes) m->VMUN_ADDR; } else addr = (vir_bytes) m->VMUM_ADDR; if(!(vr = map_lookup(vmp, addr, NULL))) { - printf("VM: unmap: virtual address %p not found in %d\n", - m->VMUM_ADDR, vmp->vm_endpoint); + printf("VM: unmap: virtual address 0x%lx not found in %d\n", + addr, target); return EFAULT; } if(addr % VM_PAGE_SIZE) return EFAULT; - if(m->m_type == VM_SHM_UNMAP) { + if(m->m_type == VM_UNMAP_PHYS || m->m_type == VM_SHM_UNMAP) { len = vr->length; } else len = roundup(m->VMUM_LEN, VM_PAGE_SIZE);