Attribute Macro root_task
#[root_task]Expand description
Declares a function to be the root task’s main function.
For example:
#[root_task]
fn main(bootinfo: &sel4::BootInfo) -> ! {
todo!()
}The main function have a signature of the form:
fn<T: Termination>(&sel4::BootInfoPtr) -> T(See Termination)
This macro takes two optional parameters, whose values can be any expression of type usize:
#[root_task(
stack_size = <stack_size_expr: usize>,
heap_size = <heap_size_expr: usize>,
)]stack_size: Declares the size of the initial thread’s stack, in bytes. Note that this includes space for thread-local storage. If absent,DEFAULT_STACK_SIZEwill be used.heap_size: Creates a#[global_allocator], backed by a static heap of the specified size. If this parameter is not specified, no#[global_allocator]will be automatically declared, and, unless one is manually declared, heap allocations will result in a link-time error.
Note that, if both parameters are provided, they must appear in the order above.