3 char buf_buf
[BUF_SIZE
+ CLICK_SIZE
];
9 /*===========================================================================*
11 *===========================================================================*/
19 read_tsc(&high1
, &low1
);
20 r
= sys_safecopyfrom(ep_granter
, gid
, 0, (long)buf
, size
);
21 read_tsc(&high2
, &low2
);
23 printf("REQUESTOR: error in safecopy: %d\n", r
);
26 printf("REQUESTOR: SAFECOPY 0x%-8x - %d\n", size
, low2
- low1
);
29 if(buf
[0] != BUF_START
) {
30 printf("REQUESTOR: error in safecopy!\n");
31 printf(" size, value: %d, %d\n", size
, buf
[0]);
38 /* SEF functions and variables. */
39 static void sef_local_startup(void);
41 /*===========================================================================*
43 *===========================================================================*/
44 int main(int argc
, char **argv
)
47 int fid_send
, fid_get
;
50 /* SEF local startup. */
51 env_setargs(argc
, argv
);
55 buf
= (char*) CLICK_CEIL(buf_buf
);
56 fid_get
= open(FIFO_GRANTOR
, O_RDONLY
);
57 fid_send
= open(FIFO_REQUESTOR
, O_WRONLY
);
58 if(fid_get
< 0 || fid_send
< 0) {
59 printf("REQUESTOR: can't open fifo files.\n");
63 /* Sending the endpoint to the granter, in order to let him
66 ep_self
= getprocnr();
67 write(fid_send
, &ep_self
, sizeof(ep_self
));
68 dprint("REQUESTOR: sending my endpoint: %d\n", ep_self
);
70 /* Getting the granter's endpoint and gid. */
71 read(fid_get
, &ep_granter
, sizeof(ep_granter
));
72 read(fid_get
, &gid
, sizeof(gid
));
73 dprint("REQUESTOR: getting granter's endpoint %d and gid %d\n",
77 for(i
= 0; i
<= TEST_PAGE_SHIFT
; i
++) {
78 if(test(1 << i
) != OK
)
82 /* Notify grantor we are done. */
83 FIFO_NOTIFY(fid_send
);
88 /*===========================================================================*
90 *===========================================================================*/
91 static void sef_local_startup()
93 /* Let SEF perform startup. */