]> Zhao Yanbai Git Server - minix.git/commitdiff
unmap VR_DIRECT mappings too (fix for X)
authorBen Gras <ben@minix3.org>
Tue, 22 Sep 2009 11:51:17 +0000 (11:51 +0000)
committerBen Gras <ben@minix3.org>
Tue, 22 Sep 2009 11:51:17 +0000 (11:51 +0000)
servers/vm/region.c

index d71bfe459725f6b5f8d8c21e823db8cdc91e53d6..8fcb728a179370565a28912e371ae7bf47ac7ccb 100644 (file)
@@ -499,7 +499,9 @@ PRIVATE int map_subfree(struct vmproc *vmp,
                                        return r;
                        }
                        vm_assert(pr->ph->refcount == 1);
-                       FREE_MEM(ABS2CLICK(pr->ph->phys), ABS2CLICK(sublen));
+                       if(!(region->flags & VR_DIRECT)) {
+                               FREE_MEM(ABS2CLICK(pr->ph->phys), ABS2CLICK(sublen));
+                       }
                        USE(pr, pr->offset += sublen;);
                        USE(pr->ph,
                                pr->ph->phys += sublen;
@@ -1214,8 +1216,8 @@ PUBLIC int map_unmap_region(struct vmproc *vmp, struct vir_region *region,
                return EINVAL;
        }
 
-       if(!(r->flags & VR_ANON)) {
-               printf("VM: only unmap anonymous memory\n");
+       if(!(r->flags & (VR_ANON|VR_DIRECT))) {
+               printf("VM: only unmap anonymous or direct memory\n");
                return EINVAL;
        }