1 // Ping-pong a counter between two processes.
2 // Only need to start one of these -- splits into two with fork.
7 umain(int argc
, char **argv
)
11 if ((who
= fork()) != 0) {
12 // get the ball rolling
13 cprintf("send 0 from %x to %x\n", sys_getenvid(), who
);
14 ipc_send(who
, 0, 0, 0);
18 uint32_t i
= ipc_recv(&who
, 0, 0);
19 cprintf("%x got %d from %x\n", sys_getenvid(), i
, who
);
23 ipc_send(who
, i
, 0, 0);