FREE_MEM(ABS2CLICK(phys), pages);
if(pt_writemap(&vmp->vm_pt,
vir + CLICK2ABS(vmp->vm_arch.vm_seg[D].mem_phys),
- 0, pages*I386_PAGE_SIZE, 0, WMF_OVERWRITE) != OK)
+ MAP_NONE, pages*I386_PAGE_SIZE, 0, WMF_OVERWRITE) != OK)
vm_panic("vm_freepages: pt_writemap failed",
NO_NUM);
} else {
pages = bytes / I386_PAGE_SIZE;
+ /* MAP_NONE means to clear the mapping. It doesn't matter
+ * what's actually written into the PTE if I386_VM_PRESENT
+ * isn't on, so we can just write MAP_NONE into it.
+ */
#if SANITYCHECKS
- if(physaddr && !(flags & I386_VM_PRESENT)) {
+ if(physaddr != MAP_NONE && !(flags & I386_VM_PRESENT)) {
vm_panic("pt_writemap: writing dir with !P\n", NO_NUM);
}
- if(!physaddr && flags) {
+ if(physaddr == MAP_NONE && flags) {
vm_panic("pt_writemap: writing 0 with flags\n", NO_NUM);
}
#endif
#define PHYSMAGIC 0x7b9a0590
-#define PHYS_UNMAP if(OK != pt_writemap(&vmp->vm_pt, varmap_loc, 0, \
+#define PHYS_UNMAP if(OK != pt_writemap(&vmp->vm_pt, varmap_loc, MAP_NONE,\
I386_PAGE_SIZE, 0, WMF_OVERWRITE)) { \
vm_panic("PHYS_UNMAP: pt_writemap failed", NO_NUM); }
SANITYCHECK(SCL_DETAIL);
if(pt_writemap(&vmp->vm_pt, r->vaddr,
- 0, r->length, 0, WMF_OVERWRITE) != OK) {
+ MAP_NONE, r->length, 0, WMF_OVERWRITE) != OK) {
printf("VM: map_unmap_region: pt_writemap failed\n");
return ENOMEM;
}