mirror of
https://github.com/drasko/codezero.git
synced 2026-01-25 17:23:14 +01:00
Mapping precision fixes on l4_unmap and do_munmap()
l4_unmap now returns -1 if given range was only partially unmapped. do_munmap() now only unmaps address ranges that have correspondence in the unmapped vmas. Trying to unmap regions with no correspondent vmas causes problems in corner cases, e.g. mm0 that tries to mmap its own address space during initialisation would unmap its whole address space and fail to execute.
This commit is contained in:
@@ -146,10 +146,9 @@ void *do_mmap(struct vm_file *mapfile, unsigned long file_offset,
|
||||
struct tcb *task, unsigned long map_address,
|
||||
unsigned int flags, unsigned int npages)
|
||||
{
|
||||
unsigned long map_pfn = __pfn(map_address);
|
||||
unsigned long file_npages;
|
||||
struct vm_area *new, *mapped;
|
||||
struct vm_obj_link *vmo_link, *vmo_link2;
|
||||
unsigned long file_npages;
|
||||
struct vm_area *new;
|
||||
int err;
|
||||
|
||||
/* Set up devzero if none given */
|
||||
|
||||
Reference in New Issue
Block a user