moto_sys/
caps.rs

1// Process capabilities.
2
3// Cap Manager (init) can grant any capability to any process, including
4// delegating CAP_MANAGER.
5pub const CAP_CAP_MANAGER: u64 = u64::MAX;
6
7// Memory manager (userspace).
8pub const CAP_MEM_MANAGER: u64 = 2;
9
10// CPU manager (userspace).
11pub const CAP_CPU_MANAGER: u64 = 4;
12
13// IO Manager. The IO manager has access to the serial console (COM1 port).
14pub const CAP_IO_MANAGER: u64 = 8;
15
16// The process can spawn other processes.
17pub const CAP_SPAWN: u64 = 0x10;
18
19// The process can created shared memory/handles.
20pub const CAP_SHARE: u64 = 0x20;
21
22// The process can use SysMem::OP_DEBUG and SysCtl::OP_SET_LOG_LEVEL.
23pub const CAP_LOG: u64 = 0x40;
24
25// This ENV key can be used to specify caps for the
26// process being created. The value must be formated in hex.
27// Currently works with Rust's std::process::Command.
28pub const MOTURUS_CAPS_ENV_KEY: &str = "MOTURUS_CAPS";