Files
codezero/tasks/test0/main.c
Bahadir Balban 40e088b042 Modifications towards full ipc
- Added a full ipc send/recv test
- Removed non-zero value checking in r2 for ipc that was there
  to catch inadvertent full ipc calls.
- Added correct hanlding for read/write mrs for current status of utcb.

TODO:
- Add mapping of every utcb to every task for privileged access so that
  the kernel can access every utcb without switching spaces.
- Removal of same mappings
- Upon thread creation need to copy page tables accordingly i.e.
  each task will have its own utcb mapped with USER access, but every
  other utcb as kernel access only. Need to handle this case upon page
  table copying.
2009-05-17 20:49:13 +03:00

60 lines
907 B
C

/*
* Some tests for posix syscalls.
*
* Copyright (C) 2007 Bahadir Balban
*/
#include <stdio.h>
#include <string.h>
#include <l4lib/arch/syslib.h>
#include <l4lib/kip.h>
#include <l4lib/utcb.h>
#include <l4lib/ipcdefs.h>
#include <tests.h>
#include <unistd.h>
#include <sys/types.h>
void wait_pager(l4id_t partner)
{
// printf("%s: Syncing with pager.\n", __TASKNAME__);
for (int i = 0; i < 6; i++)
write_mr(i, i);
l4_send(partner, L4_IPC_TAG_SYNC);
printf("Pager synced with us.\n");
}
pid_t parent_of_all;
void main(void)
{
printf("\n%s: Started with thread id %d\n", __TASKNAME__, getpid());
parent_of_all = getpid();
wait_pager(0);
printf("%s: Full IPC test.\n", __TASKNAME__);
ipc_full_test();
printf("%s: Running POSIX API tests.\n", __TASKNAME__);
dirtest();
mmaptest();
shmtest();
forktest();
fileio();
clonetest();
exectest();
while (1)
wait_pager(0);
}