[−][src]Function sunrise_kernel::ipc::session::pass_message
fn pass_message(
from_buf: &[u8],
from_proc: Arc<ThreadStruct>,
to_buf: &mut [u8],
to_proc: Arc<ThreadStruct>,
is_reply: bool,
other_memlock: MutexGuard<ProcessMemory>,
buffers: &mut Vec<Buffer>,
c_bufs: CBufBehavior
) -> Result<(), UserspaceError>
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:
- If send_pid is enabled, write the pid of the sender in the spot reserved for this,
- Copy/Move handles are added to the receiver's Handle Table, and removed from the sender's Handle Table when appropriate. The handle numbers are rewritten to the receiver's.
- Buffers are appropriately mapped through the buf_map function, and the address are rewritten to in the receiver's address space.
This function should always be called from the context of the receiver/ server.