Added new routines that map and check the validity of user buffers.

mmap uses this mechanism to get arguments. It needs to be tested.
This commit is contained in:
Bahadir Balban
2008-11-03 11:27:10 +02:00
parent 87d1b91743
commit ca8959eee0
11 changed files with 131 additions and 59 deletions

View File

@@ -22,9 +22,10 @@ void wait_pager(l4id_t partner)
// printf("Pager synced with us.\n");
}
pid_t pid;
void main(void)
{
pid_t pid;
printf("\n%s: Started with tid %d.\n", __TASKNAME__, self_tid());
/* Sync with pager */
@@ -32,12 +33,16 @@ void main(void)
dirtest();
/* Check mmap/munmap */
mmaptest();
printf("Forking...\n");
if ((pid = fork()) < 0)
printf("Error forking...\n");
if (pid == 0) {
pid = getpid();
printf("Child: file IO test 1.\n");
if (fileio() == 0)
printf("-- PASSED --\n");
@@ -56,12 +61,10 @@ void main(void)
else
printf("-- FAILED --\n");
}
while (1)
wait_pager(0);
#if 0
/* Check mmap/munmap */
mmaptest();
/* Check shmget/shmat/shmdt */
shmtest();
#endif

View File

@@ -8,6 +8,7 @@
#include <tests.h>
int global = 0;
extern pid_t pid;
int forktest(void)
{
@@ -18,6 +19,7 @@ int forktest(void)
fork();
myid = getpid();
pid = myid;
if (global != 0) {
printf("-- FAILED --\n");
goto out;