COW for physically contiguous blocks in VM
This commit is contained in:
parent
7f343ed574
commit
40b4e71db2
2 changed files with 8 additions and 1 deletions
|
@ -61,6 +61,11 @@ PUBLIC int do_mmap(message *m)
|
|||
return EINVAL;
|
||||
}
|
||||
|
||||
/* Contiguous phys memory has to be preallocated. */
|
||||
if((m->VMM_FLAGS & (MAP_CONTIG|MAP_PREALLOC)) == MAP_CONTIG) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
if(m->VMM_FLAGS & MAP_PREALLOC) mfflags |= MF_PREALLOC;
|
||||
if(m->VMM_FLAGS & MAP_LOWER16M) vrflags |= VR_LOWER16MB;
|
||||
if(m->VMM_FLAGS & MAP_LOWER1M) vrflags |= VR_LOWER1MB;
|
||||
|
|
|
@ -969,6 +969,7 @@ physr_iter *iter;
|
|||
u32_t allocflags;
|
||||
phys_bytes physaddr;
|
||||
struct phys_region *newpr;
|
||||
int region_has_single_block;
|
||||
int written = 0;
|
||||
#if SANITYCHECKS
|
||||
written = ph->written;
|
||||
|
@ -1014,7 +1015,8 @@ physr_iter *iter;
|
|||
|
||||
/* Put new free memory in. */
|
||||
allocflags = vrallocflags(region->flags);
|
||||
assert(!(allocflags & PAF_CONTIG));
|
||||
region_has_single_block = (offset == 0 && length == region->length);
|
||||
assert(region_has_single_block || !(allocflags & PAF_CONTIG));
|
||||
assert(!(allocflags & PAF_CLEAR));
|
||||
|
||||
if(map_new_physblock(vmp, region, offset, length,
|
||||
|
|
Loading…
Reference in a new issue