Macro bern_kernel::alloc_static_stack [−][src]
macro_rules! alloc_static_stack { ($size:tt) => { ... }; }
Expand description
Allocate a static stack with given size in bytes.
The macro checks whether the size meets the size and alignment requirements of the memory protection hardware in use. e.g.
let stack: bern_kernel::stack::Stack = alloc_static_stack!(512); // ok let stack: bern_kernel::stack::Stack = alloc_static_stack!(431); // compiler error on cortex-m as size is not feasible for memory protection
The arrays for static stacks are put in the .task_stack linker section.
Safety
This macro must no be called multiple times as new stack objects to the same static stack will be returned.