]> Zhao Yanbai Git Server - minix.git/commitdiff
VM: munmap fix
authorDavid van Moolenbroek <david@minix3.org>
Sat, 13 Oct 2012 17:07:47 +0000 (19:07 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Sat, 13 Oct 2012 17:08:28 +0000 (19:08 +0200)
servers/vm/mmap.c

index 787779675ac7851fe5d1a9d7b768a04de21a6618..cc63523b11c70bab4da542936553ebf5199e360d 100644 (file)
@@ -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);