vma_intersect() was erroneous, replaced by a nice and simple set_intersection() routine.

Still testing sys_munmap(). It now correctly spots and unmaps the overlapping vma.
The issue now is that if a split occurs, we forgot to add same objects to new vma.
This commit is contained in:
Bahadir Balban
2008-11-07 20:13:28 +02:00
parent 93ca3f88a8
commit 61751a896b
4 changed files with 24 additions and 20 deletions

View File

@@ -6,6 +6,7 @@
#include <mmap.h>
#include <file.h>
#include <l4/api/errno.h>
#include <l4/lib/math.h>
#include <l4lib/arch/syslib.h>
@@ -134,7 +135,8 @@ int do_munmap(struct tcb *task, void *vaddr, unsigned long npages)
list_for_each_entry_safe(vma, n, &task->vm_area_head->list, list) {
/* Check for intersection */
if (vma_intersect(munmap_start, munmap_end, vma)) {
if (set_intersection(munmap_start, munmap_end,
vma->pfn_start, vma->pfn_end)) {
/*
* Flush pages if vma is writable,
* dirty and file-backed.