[][src]Trait drone_cortex_m::sv::Switch

pub trait Switch<T> where
    Self: SvCall<SwitchContextService>,
    Self: SvCall<SwitchBackService>, 
{ unsafe fn switch_context(data: *mut T, stack_ptr: *mut *const u8);
unsafe fn switch_back(data: *mut *mut T); }

Extends Supervisor types with switch_context and switch_back methods.

Required methods

unsafe fn switch_context(data: *mut T, stack_ptr: *mut *const u8)

Switches to the given process stack.

Safety

  • data must be word-aligned.
  • *stack_ptr must be word-aligned.

unsafe fn switch_back(data: *mut *mut T)

Switches to the previous stack.

Safety

  • Must be called only from Process Stack.
  • T must match the previous switch_context.
  • *data must be word-aligned.
Loading content...

Implementors

impl<Sv, T> Switch<T> for Sv where
    Sv: SvCall<SwitchContextService>,
    Sv: SvCall<SwitchBackService>, 
[src]

Loading content...