Added preliminary support for execve(). Updates to clone, fork, exit, task handling.

It turned out we used one version of kmalloc for malloc() and another for kfree()!
Now fixed.
Added parent-child relationship to tasks. Need to polish handling CLONE_PARENT and THREAD.
This commit is contained in:
Bahadir Balban
2008-11-19 12:59:52 +02:00
parent d182b5b35a
commit 46937eab88
39 changed files with 502 additions and 1192 deletions

View File

@@ -7,6 +7,7 @@
#include INC_API(syscall.h)
#include INC_SUBARCH(mm.h)
#include <l4/api/errno.h>
#include <l4/api/space.h>
/* NOTE:
* For lazy mm switching, a list of newly created mappings that are common to
@@ -58,6 +59,16 @@ int sys_unmap(syscall_context_t *regs)
else if (!(target = find_task(tid)))
return -ESRCH;
/*
* These special values mean unmap all the mappings
* from task space except the kernel mappings
*/
if (virtual == UNMAP_ALL_SPACE &&
npages == UNMAP_ALL_SPACE) {
remove_mapping_pgd_all_user(target->pgd);
return 0;
}
for (int i = 0; i < npages; i++) {
ret = remove_mapping_pgd(virtual + i * PAGE_SIZE, target->pgd);
if (ret)