kernel: print spurious interrupt message with increasing interval.
[minix.git] / test / safecopy / inc.h
blobff1277755b926e7b1dbcb1f56cf17b097d9604a5
1 #define _SYSTEM
2 #define _MINIX
3 #include <stdio.h>
4 #include <unistd.h>
5 #include <fcntl.h>
6 #include <stdlib.h>
7 #include <signal.h>
8 #include <sys/types.h>
9 #include <sys/wait.h>
11 #include <minix/config.h>
12 #include <minix/com.h>
13 #include <minix/type.h>
14 #include <minix/const.h>
15 #include <minix/endpoint.h>
16 #include <minix/safecopies.h>
17 #include <minix/syslib.h>
18 #include <minix/sysutil.h>
19 #include <errno.h>
21 /* TEST_PAGE_SHIFT =
22 * log2(CLICK_SIZE * TEST_PAGE_NUM) = CLICK_SHIFT + log2(TEST_PAGE_NUM)
24 #define TEST_PAGE_NUM 8
25 #define TEST_PAGE_SHIFT 15
27 #define BUF_SIZE (TEST_PAGE_NUM * CLICK_SIZE)
28 #define BUF_START 100
30 #define FIFO_REQUESTOR "/usr/src/test/safecopy/1fifo"
31 #define FIFO_GRANTOR "/usr/src/test/safecopy/2fifo"
33 #define FIFO_WAIT(fid) { \
34 int a; \
35 if(read(fid, &a, sizeof(a)) != sizeof(a)) \
36 panic("FIFO_WAIT failed"); \
38 #define FIFO_NOTIFY(fid) { \
39 int a = 1; \
40 if(write(fid, &a, sizeof(a)) != sizeof(a)) \
41 panic("FIFO_NOTIFY failed"); \
44 #define DEBUG 0
45 #if DEBUG
46 # define dprint printf
47 #else
48 # define dprint (void)
49 #endif