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:
Bahadir Balban
2008-11-08 10:18:35 +02:00
parent 0e3f069713
commit 94daebd0c5
7 changed files with 82 additions and 39 deletions

View File

@@ -24,7 +24,7 @@
struct vm_area *vma_new(unsigned long pfn_start, unsigned long npages,
unsigned int flags, unsigned long file_offset);
int do_munmap(struct tcb *task, void *vaddr, unsigned long size);
int do_munmap(struct tcb *task, unsigned long vaddr, unsigned long size);
void *do_mmap(struct vm_file *mapfile, unsigned long f_offset, struct tcb *t,
unsigned long map_address, unsigned int flags, unsigned int pages);