Module processbuffer

Source
Expand description

Data structures for passing application memory to the kernel.

A Tock process can pass read-write or read-only buffers into the kernel for it to use. The kernel checks that read-write buffers exist within a process’s RAM address space, and that read-only buffers exist either within its RAM or flash address space. These buffers are shared with the allow_read_write() and allow_read_only() system calls.

A read-write and read-only call is mapped to the high-level Rust types ReadWriteProcessBuffer and ReadOnlyProcessBuffer respectively. The memory regions can be accessed through the ReadableProcessBuffer and WriteableProcessBuffer traits, implemented on the process buffer structs.

Each access to the buffer structs requires a liveness check to ensure that the process memory is still valid. For a more traditional interface, users can convert buffers into ReadableProcessSlice or WriteableProcessSlice and use these for the lifetime of their operations. Users cannot hold live-lived references to these slices, however.

Structs§

ReadOnlyProcessBuffer
Read-only buffer shared by a userspace process.
ReadOnlyProcessBufferRef
Provides access to a ReadOnlyProcessBuffer with a restricted lifetime. This automatically dereferences into a ReadOnlyProcessBuffer
ReadWriteProcessBuffer
Read-writable buffer shared by a userspace process.
ReadWriteProcessBufferRef
Provides access to a ReadWriteProcessBuffer with a restricted lifetime. This automatically dereferences into a ReadWriteProcessBuffer
ReadableProcessByte
Read-only wrapper around a Cell
ReadableProcessSlice
Readable and accessible slice of memory of a process buffer.
WriteableProcessSlice
Read-writeable and accessible slice of memory of a process buffer

Traits§

ProcessSliceIndex
Equivalent of the Rust core library’s SliceIndex type for process slices.
ReadableProcessBuffer
A readable region of userspace process memory.
WriteableProcessBuffer
A readable and writeable region of userspace process memory.

Type Aliases§

UserspaceReadableProcessBuffer
A shareable region of userspace memory.