mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
Previously during ipc copy, only the currently active task flags were checked. This means the flags of whoever doing the actual copy was used in the ipc. Now flags are stored in the ktcb and checked by the copy routine. Current use of the flags is to determine short/full/extended ipc.
61 lines
926 B
C
61 lines
926 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);
|
|
|
|
ipc_full_test();
|
|
|
|
printf("\n%s: Running POSIX API tests.\n", __TASKNAME__);
|
|
|
|
dirtest();
|
|
|
|
mmaptest();
|
|
|
|
shmtest();
|
|
|
|
forktest();
|
|
|
|
fileio();
|
|
|
|
clonetest();
|
|
|
|
if (parent_of_all == getpid())
|
|
ipc_extended_test();
|
|
else
|
|
exectest();
|
|
|
|
while (1)
|
|
wait_pager(0);
|
|
}
|
|
|