1 // User-level IPC library routines
5 // Receive a value via IPC and return it.
6 // If 'pg' is nonnull, then any page sent by the sender will be mapped at
8 // If 'from_env_store' is nonnull, then store the IPC sender's envid in
10 // If 'perm_store' is nonnull, then store the IPC sender's page permission
11 // in *perm_store (this is nonzero iff a page was successfully
12 // transferred to 'pg').
13 // If the system call fails, then store 0 in *fromenv and *perm (if
14 // they're nonnull) and return the error.
15 // Otherwise, return the value sent by the sender
18 // Use 'thisenv' to discover the value and who sent it.
19 // If 'pg' is null, pass sys_ipc_recv a value that it will understand
20 // as meaning "no page". (Zero is not the right value, since that's
21 // a perfectly valid place to map a page.)
23 ipc_recv(envid_t
*from_env_store
, void *pg
, int *perm_store
)
25 // LAB 4: Your code here.
26 panic("ipc_recv not implemented");
30 // Send 'val' (and 'pg' with 'perm', if 'pg' is nonnull) to 'toenv'.
31 // This function keeps trying until it succeeds.
32 // It should panic() on any error other than -E_IPC_NOT_RECV.
35 // Use sys_yield() to be CPU-friendly.
36 // If 'pg' is null, pass sys_ipc_recv a value that it will understand
37 // as meaning "no page". (Zero is not the right value.)
39 ipc_send(envid_t to_env
, uint32_t val
, void *pg
, int perm
)
41 // LAB 4: Your code here.
42 panic("ipc_send not implemented");