OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [posix/] [test0/] [main.c] - Blame information for rev 7

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Some tests for posix syscalls.
3
 *
4
 * Copyright (C) 2007 Bahadir Balban
5
 */
6
#include <pthread.h>
7
#include <stdio.h>
8
#include <string.h>
9
#include <l4lib/kip.h>
10
#include <l4lib/utcb.h>
11
#include <l4lib/ipcdefs.h>
12
#include <tests.h>
13
#include <unistd.h>
14
#include <sys/types.h>
15
#include <atoi.h>
16
#include <stdlib.h>
17
#include L4LIB_INC_ARCH(syslib.h)
18
 
19
void wait_pager(l4id_t partner)
20
{
21
        // printf("%s: Syncing with pager.\n", __TASKNAME__);
22
        for (int i = 0; i < 6; i++)
23
                write_mr(i, i);
24
        l4_send(partner, L4_IPC_TAG_SYNC);
25
        // printf("Pager synced with us.\n");
26
}
27
 
28
pid_t parent_of_all;
29
l4id_t pagerid;
30
 
31
int main(int argc, char *argv[])
32
{
33
 
34
        printf("\n%s: Started with thread id %x\n", __TASKNAME__, __raw_tid(getpid()));
35
 
36
        parent_of_all = getpid();
37
 
38
        pagerid = ascii_to_int(getenv("pagerid"));
39
 
40
        wait_pager(pagerid);
41
 
42
        printf("\n%s: Running POSIX API tests.\n", __TASKNAME__);
43
 
44
 
45
        small_io_test();
46
 
47
        dirtest();
48
 
49
        mmaptest();
50
 
51
        shmtest();
52
 
53
        fileio();
54
 
55
        forktest();
56
 
57
        clonetest();
58
 
59
        undeftest();
60
 
61
        if (parent_of_all == getpid()) {
62
                ipc_full_test();
63
                ipc_extended_test();
64
        }
65
        if (parent_of_all == getpid()) {
66
                user_mutex_test();
67
        }
68
 
69
        exectest(parent_of_all);
70
 
71
        while (1)
72
                wait_pager(pagerid);
73
 
74
        return 0;
75
}
76
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.