[−][src]Function sunrise_kernel::ipc::session::buf_map
fn buf_map(
from_buf: &[u8],
to_buf: &mut [u8],
curoff: &mut usize,
from_mem: &mut ProcessMemory,
to_mem: &mut ProcessMemory,
flags: MappingAccessRights,
buffers: &mut Vec<Buffer>
) -> Result<(), UserspaceError>
Send an IPC Buffer from the sender into the receiver.
There are two "families" of IPC buffers:
- Buffers, also known as IPC type A, B and W, are going to remap the Page from the sender's address space to the receiver's. As a result, those buffers are required to be page-aligned.
- Pointers, also known as IPC type X and C, involve the kernel copying the data from the type X Pointer to the associated type C pointer. This results in much more flexibility for the userspace, at the cost of a bit of performance.
In practice, the performance lost by memcpying the data can be made up by not requiring to flush the page table cache, so care must be taken when chosing between Buffer or Pointer family of IPC.
Should be called from the receiver process.