[−][src]Module sunrise_kernel::ipc::session
IPC Sessions
A Session represents an established connection. It implements a rendez-vous
style Remote Procedure Call interface. The ClientSession has a send_request
operation, which will wait for the counterpart ServerSession's reply
. A
ServerSession can also receive
the pending requests.
Note that a single Session can only process a single request at a time - it is an inherently sequential construct. If multiple threads attempt receiving on the same handle, they will have to wait for the current request to be replied to before being able to receive the next request in line.
use kernel::ipc::session; let (server, client) = session::new();
The requests are encoded in a byte buffer under a specific format. For documentation on the format, switchbrew is your friend.
Structs
Buffer | Information about a Buffer during a Request. |
ClientSession | The client side of a Session. |
HandleDescriptorHeader | Part of an HIPC command. Sent only when
|
MsgPackedHdr | Represenens the header of an HIPC command. |
Request | An incoming IPC request. |
ServerSession | The server side of a Session. |
Session | Shared part of a Session. |
SessionRequests | Wrapper around the currently active session and the incoming request list. They are kept together so they are locked together. |
Enums
CBufBehavior | Defines how to handle X Buffer descriptors based on the C Buffer flags. |
Functions
buf_map | Send an IPC Buffer from the sender into the receiver. |
buf_unmap | Unmap an IPC Buffer from the receiver. |
find_c_descriptors | Efficiently finds C Descriptor in a message. |
new | Create a new Session pair. Those sessions are linked to each-other: The server will receive requests sent through the client. |
pass_message | Send a message from the sender to the receiver. This is more or less a memcpy, with some special case done to satisfy the various commands of the CMIF structure: |