Commit 22f4bcd9 authored by Charlie Jacobsen's avatar Charlie Jacobsen Committed by Vikram Narayanan

Simple ipc documentation.

parent bee0375b
========================================
OVERVIEW
========================================
Recall that LCDs refer to capabilities in their cspace using
integer identifiers (similar to a file descriptor); these are
capability pointers, or cptr_t's.
An LCD has 8 64-bit general registers and 8 capability pointer (cptr_t)
registers. General registers are for scalar arguments. Capability pointer
registers are for granting capabilities. An LCD accesses its registers via:
u64 lcd_r0(void)
... reading general registers
u64 lcd_r8(void)
void lcd_set_r0(u64 val)
... writing to general registers
void lcd_set_r8(u64 val)
ctpr_t lcd_cr0(void)
... reading capability registers
cptr_t lcd_cr8(void)
void lcd_set_cr0(cptr_t val)
... writing to capability registers
void lcd_set_cr8(cptr_t val)
=======================================
CAPABILITY GRANT PROCESS
=======================================
I will explain by example.
Suppose LCD A has:
-- a send capability to a rendezvous point for communicating with LCD B,
referenced by cptr_t c1
-- a capability to a page referenced by cptr_t c2
and that LCD B has:
-- a receive capability on the same rendezvous point, referenced by cptr_t c3
Suppose LCD A wants to grant the page capability to LCD B, and LCD B is
expecting to be granted this capability, and wants to reference the granted
capability via cptr_t c4. A few things need to happen.
First, LCD B needs to allocate a cnode in its cspace:
c4 = lcd_cnode_alloc();
Second, LCD B needs to do a receive, and put c4 in its capability register:
lcd_set_cr0(c4);
lcd_recv(c3);
Third, LCD A needs to invoke a send:
lcd_set_cr0(c2);
lcd_send(c1);
The microkernel will match up the send and receive. It will copy the page
capability referred to in *LCD A's cspace* by c2 to cnode in *LCD B's cspace*
referred to by c4.
LCD A could also pass along scalar arguments to LCD B during the same
send invocation.
========================================
CALL/REPLY
========================================
Call/reply takes the place of two send/recv pairs. Instead of:
LCD A
-----
lcd_send( ... )
...
lcd_recv( ... )
LCD B
-----
lcd_recv( ... )
...
lcd_send( ... )
the two LCD's can do:
LCD A
-----
lcd_call( ... )
LCD B
-----
lcd_reply( ... )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment