VM: munmap used by VM for itself is no longer used

This commit is contained in:
Ben Gras 2012-10-11 15:15:48 +02:00
parent 9733fcdb43
commit fd4ddef49a

View file

@ -446,41 +446,3 @@ int do_munmap(message *m)
return OK; return OK;
} }
int unmap_ok = 0;
/*===========================================================================*
* munmap_lin (used for overrides for VM) *
*===========================================================================*/
static int munmap_lin(vir_bytes addr, size_t len)
{
if(addr % VM_PAGE_SIZE) {
printf("munmap_lin: offset not page aligned\n");
return EFAULT;
}
if(len % VM_PAGE_SIZE) {
printf("munmap_lin: len not page aligned\n");
return EFAULT;
}
if(pt_writemap(NULL, &vmproc[VM_PROC_NR].vm_pt, addr, MAP_NONE, len, 0,
WMF_OVERWRITE | WMF_FREE) != OK) {
printf("munmap_lin: pt_writemap failed\n");
return EFAULT;
}
return OK;
}
/*===========================================================================*
* munmap (override for VM) *
*===========================================================================*/
int minix_munmap(void *addr, size_t len)
{
vir_bytes laddr;
if(!unmap_ok)
return ENOSYS;
laddr = (vir_bytes) (vir_bytes) addr;
return munmap_lin(laddr, len);
}