Struct kernel::process::Process [] [src]

pub struct Process<'a> {
    memory: &'static mut [u8],
    kernel_memory_break: *const u8,
    app_break: *const u8,
    current_stack_pointer: *const u8,
    text: &'static [u8],
    header: TbfHeader,
    stored_regs: StoredRegs,
    yield_pc: usize,
    psr: usize,
    state: State,
    fault_response: FaultResponse,
    mpu_regions: [Cell<(*const u8, PowerOfTwo)>; 5],
    tasks: RingBuffer<'a, Task>,
    pub package_name: &'static str,
    debug: ProcessDebug,
}

Fields

[]

Application memory layout:

    ╒════════ ← memory[memory.len()]
 ╔═ │ Grant
    │   ↓
 D  │ ──────  ← kernel_memory_break
 Y  │
 N  │ ──────  ← app_break
 A  │
 M  │   ↑
    │  Heap
 ╠═ │ ──────  ← app_heap_start
    │  Data
 F  │ ──────  ← data_start_pointer
 I  │ Stack
 X  │   ↓
 E  │
 D  │ ──────  ← current_stack_pointer
    │
 ╚═ ╘════════ ← memory[0]

The process's memory.

[]

Pointer to the end of the allocated (and MPU protected) grant region.

[]

Pointer to the end of process RAM that has been sbrk'd to the process.

[]

Saved when the app switches to the kernel.

[]

Process text segment

[]

Collection of pointers to the TBF header in flash.

[]

Saved each time the app switches to the kernel.

[]

The PC to jump to when switching back to the app.

[]

Process State Register.

[]

Whether the scheduler can schedule this app.

[]

How to deal with Faults occurring in the process

[]

MPU regions are saved as a pointer-size pair.

size is encoded as X where SIZE = 2(X + 1) and X >= 4.

A null pointer represents an empty region.

Invariants

The pointer must be aligned to the size. E.g. if the size is 32 bytes, the pointer must be 32-byte aligned.

[]

Essentially a list of callbacks that want to call functions in the process.

[]

Name of the app. Public so that IPC can use it.

[]

Values kept so that we can print useful debug messages when apps fault.

Methods

impl<'a> Process<'a>
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]
[]

Context switch to the process.

[src]

[src]

[src]
[]

Context switch to the process.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]