From: Ben Gras Date: Tue, 22 Sep 2009 11:51:17 +0000 (+0000) Subject: unmap VR_DIRECT mappings too (fix for X) X-Git-Tag: v3.1.5~109 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=0b713b0de5049efa9de47ad8bc6c0a6db3cea1de;p=minix.git unmap VR_DIRECT mappings too (fix for X) --- diff --git a/servers/vm/region.c b/servers/vm/region.c index d71bfe459..8fcb728a1 100644 --- a/servers/vm/region.c +++ b/servers/vm/region.c @@ -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; }