pub struct System<Traits>(_);
Expand description
Wraps a provided trait type Traits
to instantiate a kernel. This type
implements the traits from r3_core::kernel::raw
, making it usable as a
kernel, if Traits
implements some appropriate traits, which consequently
make it implement KernelTraits
.
Trait Implementations
sourceimpl<Traits: KernelStatic<System<Traits>>> DelegateKernelStatic<System<Traits>> for System<Traits>
impl<Traits: KernelStatic<System<Traits>>> DelegateKernelStatic<System<Traits>> for System<Traits>
Implement KernelStatic<System<Traits>>
on System<Traits>
if the same
trait is implemented on Traits
.
type Target = Traits
sourceimpl<Traits: KernelTraits> KernelAdjustTime for System<Traits>
impl<Traits: KernelTraits> KernelAdjustTime for System<Traits>
sourceconst RAW_TIME_USER_HEADROOM: Duration
const RAW_TIME_USER_HEADROOM: Duration
Implements Kernel::time_user_headroom
. Read more
sourcefn raw_adjust_time(delta: Duration) -> Result<(), AdjustTimeError>
fn raw_adjust_time(delta: Duration) -> Result<(), AdjustTimeError>
Implements Kernel::adjust_time
. Read more
sourceimpl<Traits: KernelTraits> KernelBase for System<Traits>
impl<Traits: KernelTraits> KernelBase for System<Traits>
sourcefn raw_debug() -> Self::RawDebugPrinter
fn raw_debug() -> Self::RawDebugPrinter
Get an object that implements Debug
for dumping the
current kernel state.
Note that printing this object might consume a large amount of stack space.
sourceconst RAW_SUPPORTED_QUEUE_ORDERS: &'static [Option<QueueOrderKind>]
const RAW_SUPPORTED_QUEUE_ORDERS: &'static [Option<QueueOrderKind>]
Used by QueueOrder::is_supported
. Read more
sourcefn raw_acquire_cpu_lock() -> Result<(), CpuLockError>
fn raw_acquire_cpu_lock() -> Result<(), CpuLockError>
Implements Kernel::acquire_cpu_lock
. Read more
sourceunsafe fn raw_release_cpu_lock() -> Result<(), CpuLockError>
unsafe fn raw_release_cpu_lock() -> Result<(), CpuLockError>
Implements Kernel::release_cpu_lock
. Read more
sourcefn raw_has_cpu_lock() -> bool
fn raw_has_cpu_lock() -> bool
Return a flag indicating whether CPU Lock is currently active.
sourceunsafe fn raw_unboost_priority() -> Result<(), BoostPriorityError>
unsafe fn raw_unboost_priority() -> Result<(), BoostPriorityError>
Implements Kernel::unboost_priority
. Read more
sourcefn raw_is_priority_boost_active() -> bool
fn raw_is_priority_boost_active() -> bool
Implements Kernel::is_priority_boost_active
. Read more
sourcefn raw_is_task_context() -> bool
fn raw_is_task_context() -> bool
Implements Kernel::is_task_context
. Read more
sourcefn raw_is_interrupt_context() -> bool
fn raw_is_interrupt_context() -> bool
Implements Kernel::is_interrupt_context
. Read more
sourcefn raw_is_boot_complete() -> bool
fn raw_is_boot_complete() -> bool
Implements Kernel::is_boot_complete
. Read more
sourcefn raw_set_time(time: Time) -> Result<(), TimeError>
fn raw_set_time(time: Time) -> Result<(), TimeError>
Implements Kernel::set_time
. Read more
sourceunsafe fn raw_exit_task() -> Result<!, ExitTaskError>
unsafe fn raw_exit_task() -> Result<!, ExitTaskError>
Implements Kernel::exit_task
. Read more
sourcefn raw_park_timeout(timeout: Duration) -> Result<(), ParkTimeoutError>
fn raw_park_timeout(timeout: Duration) -> Result<(), ParkTimeoutError>
Implements Kernel::park_timeout
. Read more
sourcefn raw_sleep(timeout: Duration) -> Result<(), SleepError>
fn raw_sleep(timeout: Duration) -> Result<(), SleepError>
Implements Kernel::sleep
. Read more
type RawDebugPrinter = KernelDebugPrinter<Traits>
sourcefn raw_task_current() -> Result<Self::RawTaskId, GetCurrentTaskError>
fn raw_task_current() -> Result<Self::RawTaskId, GetCurrentTaskError>
Get the current task.
sourceunsafe fn raw_task_activate(
this: Self::RawTaskId
) -> Result<(), ActivateTaskError>
unsafe fn raw_task_activate(
this: Self::RawTaskId
) -> Result<(), ActivateTaskError>
Implements Task::activate
. Read more
sourceunsafe fn raw_task_interrupt(
this: Self::RawTaskId
) -> Result<(), InterruptTaskError>
unsafe fn raw_task_interrupt(
this: Self::RawTaskId
) -> Result<(), InterruptTaskError>
Implements Task::interrupt
. Read more
sourceunsafe fn raw_task_unpark_exact(
this: Self::RawTaskId
) -> Result<(), UnparkExactError>
unsafe fn raw_task_unpark_exact(
this: Self::RawTaskId
) -> Result<(), UnparkExactError>
Implements Task::unpark_exact
. Read more
sourceunsafe fn raw_task_priority(
this: Self::RawTaskId
) -> Result<usize, GetTaskPriorityError>
unsafe fn raw_task_priority(
this: Self::RawTaskId
) -> Result<usize, GetTaskPriorityError>
Implements Task::priority
. Read more
sourceunsafe fn raw_task_effective_priority(
this: Self::RawTaskId
) -> Result<usize, GetTaskPriorityError>
unsafe fn raw_task_effective_priority(
this: Self::RawTaskId
) -> Result<usize, GetTaskPriorityError>
Implements Task::effective_priority
. Read more
sourceimpl<Traits: KernelTraits> KernelBoostPriority for System<Traits>
This is supported on crate feature priority_boost
only.
impl<Traits: KernelTraits> KernelBoostPriority for System<Traits>
priority_boost
only.sourcefn raw_boost_priority() -> Result<(), BoostPriorityError>
fn raw_boost_priority() -> Result<(), BoostPriorityError>
Implements Kernel::boost_priority
. Read more
sourceimpl<Traits: KernelTraits> KernelEventGroup for System<Traits>
impl<Traits: KernelTraits> KernelEventGroup for System<Traits>
type RawEventGroupId = Id
type RawEventGroupId = Id
The type to identify event groups.
sourceunsafe fn raw_event_group_set(
this: Id,
bits: EventGroupBits
) -> Result<(), UpdateEventGroupError>
unsafe fn raw_event_group_set(
this: Id,
bits: EventGroupBits
) -> Result<(), UpdateEventGroupError>
Implements EventGroup::set
. Read more
sourceunsafe fn raw_event_group_clear(
this: Id,
bits: EventGroupBits
) -> Result<(), UpdateEventGroupError>
unsafe fn raw_event_group_clear(
this: Id,
bits: EventGroupBits
) -> Result<(), UpdateEventGroupError>
Implements EventGroup::clear
. Read more
sourceunsafe fn raw_event_group_get(
this: Id
) -> Result<EventGroupBits, GetEventGroupError>
unsafe fn raw_event_group_get(
this: Id
) -> Result<EventGroupBits, GetEventGroupError>
Implements EventGroup::get
. Read more
sourceunsafe fn raw_event_group_wait(
this: Id,
bits: EventGroupBits,
flags: EventGroupWaitFlags
) -> Result<EventGroupBits, WaitEventGroupError>
unsafe fn raw_event_group_wait(
this: Id,
bits: EventGroupBits,
flags: EventGroupWaitFlags
) -> Result<EventGroupBits, WaitEventGroupError>
Implements EventGroup::wait
. Read more
sourceunsafe fn raw_event_group_wait_timeout(
this: Id,
bits: EventGroupBits,
flags: EventGroupWaitFlags,
timeout: Duration
) -> Result<EventGroupBits, WaitEventGroupTimeoutError>
unsafe fn raw_event_group_wait_timeout(
this: Id,
bits: EventGroupBits,
flags: EventGroupWaitFlags,
timeout: Duration
) -> Result<EventGroupBits, WaitEventGroupTimeoutError>
Implements EventGroup::wait_timeout
. Read more
sourceunsafe fn raw_event_group_poll(
this: Id,
bits: EventGroupBits,
flags: EventGroupWaitFlags
) -> Result<EventGroupBits, PollEventGroupError>
unsafe fn raw_event_group_poll(
this: Id,
bits: EventGroupBits,
flags: EventGroupWaitFlags
) -> Result<EventGroupBits, PollEventGroupError>
Implements EventGroup::poll
. Read more
sourceimpl<Traits: KernelTraits> KernelInterruptLine for System<Traits>
impl<Traits: KernelTraits> KernelInterruptLine for System<Traits>
sourceunsafe fn raw_interrupt_line_set_priority(
this: InterruptNum,
value: InterruptPriority
) -> Result<(), SetInterruptLinePriorityError>
unsafe fn raw_interrupt_line_set_priority(
this: InterruptNum,
value: InterruptPriority
) -> Result<(), SetInterruptLinePriorityError>
Implements InterruptLine::set_priority
. Read more
sourceunsafe fn raw_interrupt_line_enable(
this: InterruptNum
) -> Result<(), EnableInterruptLineError>
unsafe fn raw_interrupt_line_enable(
this: InterruptNum
) -> Result<(), EnableInterruptLineError>
Implements InterruptLine::enable
. Read more
sourceunsafe fn raw_interrupt_line_disable(
this: InterruptNum
) -> Result<(), EnableInterruptLineError>
unsafe fn raw_interrupt_line_disable(
this: InterruptNum
) -> Result<(), EnableInterruptLineError>
Implements InterruptLine::disable
. Read more
sourceunsafe fn raw_interrupt_line_pend(
this: InterruptNum
) -> Result<(), PendInterruptLineError>
unsafe fn raw_interrupt_line_pend(
this: InterruptNum
) -> Result<(), PendInterruptLineError>
Implements InterruptLine::pend
. Read more
sourceunsafe fn raw_interrupt_line_clear(
this: InterruptNum
) -> Result<(), ClearInterruptLineError>
unsafe fn raw_interrupt_line_clear(
this: InterruptNum
) -> Result<(), ClearInterruptLineError>
Implements InterruptLine::clear
. Read more
sourceunsafe fn raw_interrupt_line_is_pending(
this: InterruptNum
) -> Result<bool, QueryInterruptLineError>
unsafe fn raw_interrupt_line_is_pending(
this: InterruptNum
) -> Result<bool, QueryInterruptLineError>
Implements InterruptLine::is_pending
. Read more
sourceimpl<Traits: KernelTraits> KernelMutex for System<Traits>
impl<Traits: KernelTraits> KernelMutex for System<Traits>
type RawMutexId = Id
type RawMutexId = Id
The type to identify mutexes.
sourceconst RAW_SUPPORTED_MUTEX_PROTOCOLS: &'static [Option<MutexProtocolKind>]
const RAW_SUPPORTED_MUTEX_PROTOCOLS: &'static [Option<MutexProtocolKind>]
Used by MutexProtocol::is_supported
. Read more
sourceunsafe fn raw_mutex_is_locked(this: Id) -> Result<bool, QueryMutexError>
unsafe fn raw_mutex_is_locked(this: Id) -> Result<bool, QueryMutexError>
Implements Mutex::is_locked
. Read more
sourceunsafe fn raw_mutex_unlock(this: Id) -> Result<(), UnlockMutexError>
unsafe fn raw_mutex_unlock(this: Id) -> Result<(), UnlockMutexError>
Implements Mutex::unlock
. Read more
sourceunsafe fn raw_mutex_lock(this: Id) -> Result<(), LockMutexError>
unsafe fn raw_mutex_lock(this: Id) -> Result<(), LockMutexError>
Implements Mutex::lock
. Read more
sourceunsafe fn raw_mutex_lock_timeout(
this: Id,
timeout: Duration
) -> Result<(), LockMutexTimeoutError>
unsafe fn raw_mutex_lock_timeout(
this: Id,
timeout: Duration
) -> Result<(), LockMutexTimeoutError>
Implements Mutex::lock_timeout
. Read more
sourceunsafe fn raw_mutex_try_lock(this: Id) -> Result<(), TryLockMutexError>
unsafe fn raw_mutex_try_lock(this: Id) -> Result<(), TryLockMutexError>
Implements Mutex::try_lock
. Read more
sourceunsafe fn raw_mutex_mark_consistent(
this: Id
) -> Result<(), MarkConsistentMutexError>
unsafe fn raw_mutex_mark_consistent(
this: Id
) -> Result<(), MarkConsistentMutexError>
Implements Mutex::mark_consistent
. Read more
sourceimpl<Traits: KernelTraits> KernelSemaphore for System<Traits>
impl<Traits: KernelTraits> KernelSemaphore for System<Traits>
type RawSemaphoreId = Id
type RawSemaphoreId = Id
The type to identify semaphores.
sourceunsafe fn raw_semaphore_drain(this: Id) -> Result<(), DrainSemaphoreError>
unsafe fn raw_semaphore_drain(this: Id) -> Result<(), DrainSemaphoreError>
Implements Semaphore::drain
. Read more
sourceunsafe fn raw_semaphore_get(
this: Id
) -> Result<SemaphoreValue, GetSemaphoreError>
unsafe fn raw_semaphore_get(
this: Id
) -> Result<SemaphoreValue, GetSemaphoreError>
Implements Semaphore::get
. Read more
sourceunsafe fn raw_semaphore_signal(
this: Id,
count: SemaphoreValue
) -> Result<(), SignalSemaphoreError>
unsafe fn raw_semaphore_signal(
this: Id,
count: SemaphoreValue
) -> Result<(), SignalSemaphoreError>
Implements Semaphore::signal
. Read more
sourceunsafe fn raw_semaphore_signal_one(this: Id) -> Result<(), SignalSemaphoreError>
unsafe fn raw_semaphore_signal_one(this: Id) -> Result<(), SignalSemaphoreError>
Implements Semaphore::signal_one
. Read more
sourceunsafe fn raw_semaphore_wait_one(this: Id) -> Result<(), WaitSemaphoreError>
unsafe fn raw_semaphore_wait_one(this: Id) -> Result<(), WaitSemaphoreError>
Implements Semaphore::wait_one
. Read more
sourceunsafe fn raw_semaphore_wait_one_timeout(
this: Id,
timeout: Duration
) -> Result<(), WaitSemaphoreTimeoutError>
unsafe fn raw_semaphore_wait_one_timeout(
this: Id,
timeout: Duration
) -> Result<(), WaitSemaphoreTimeoutError>
Implements Semaphore::wait_one_timeout
. Read more
sourceunsafe fn raw_semaphore_poll_one(this: Id) -> Result<(), PollSemaphoreError>
unsafe fn raw_semaphore_poll_one(this: Id) -> Result<(), PollSemaphoreError>
Implements Semaphore::poll_one
. Read more
sourceimpl<Traits: KernelTraits> KernelTaskSetPriority for System<Traits>
impl<Traits: KernelTraits> KernelTaskSetPriority for System<Traits>
sourceunsafe fn raw_task_set_priority(
this: Self::RawTaskId,
priority: usize
) -> Result<(), SetTaskPriorityError>
unsafe fn raw_task_set_priority(
this: Self::RawTaskId,
priority: usize
) -> Result<(), SetTaskPriorityError>
Implements Task::set_priority
. Read more
sourceimpl<Traits: KernelTraits> KernelTime for System<Traits>
This is supported on crate feature system_time
only.
impl<Traits: KernelTraits> KernelTime for System<Traits>
system_time
only.sourceimpl<Traits: KernelTraits> KernelTimer for System<Traits>
impl<Traits: KernelTraits> KernelTimer for System<Traits>
type RawTimerId = Id
type RawTimerId = Id
The type to identify timers.
sourceunsafe fn raw_timer_start(this: Id) -> Result<(), StartTimerError>
unsafe fn raw_timer_start(this: Id) -> Result<(), StartTimerError>
Implements Timer::start
. Read more
sourceunsafe fn raw_timer_stop(this: Id) -> Result<(), StopTimerError>
unsafe fn raw_timer_stop(this: Id) -> Result<(), StopTimerError>
Implements Timer::stop
. Read more
sourceunsafe fn raw_timer_set_delay(
this: Id,
delay: Option<Duration>
) -> Result<(), SetTimerDelayError>
unsafe fn raw_timer_set_delay(
this: Id,
delay: Option<Duration>
) -> Result<(), SetTimerDelayError>
Implements Timer::set_delay
. Read more
sourceunsafe fn raw_timer_set_period(
this: Id,
period: Option<Duration>
) -> Result<(), SetTimerPeriodError>
unsafe fn raw_timer_set_period(
this: Id,
period: Option<Duration>
) -> Result<(), SetTimerPeriodError>
Implements Timer::set_period
. Read more
impl<Traits> Copy for System<Traits>
Auto Trait Implementations
impl<Traits> RefUnwindSafe for System<Traits> where
Traits: RefUnwindSafe,
impl<Traits> Send for System<Traits> where
Traits: Send,
impl<Traits> Sync for System<Traits> where
Traits: Sync,
impl<Traits> Unpin for System<Traits> where
Traits: Unpin,
impl<Traits> UnwindSafe for System<Traits> where
Traits: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, System> CfgPhase1<System> for T where
T: DelegateKernelStatic<System>,
<T as DelegateKernelStatic<System>>::Target: CfgPhase1<System>,
impl<T, System> CfgPhase1<System> for T where
T: DelegateKernelStatic<System>,
<T as DelegateKernelStatic<System>>::Target: CfgPhase1<System>,
const CFG_STARTUP_HOOKS: &'static [StartupHookAttr]
const CFG_INTERRUPT_HANDLERS: &'static [Option<unsafe extern "C" fn()>]
fn cfg_hunk_pool_ptr() -> *mut u8
sourceimpl<T> Kernel for T where
T: KernelBase,
impl<T> Kernel for T where
T: KernelBase,
type DebugPrinter = <T as KernelBase>::RawDebugPrinter
sourcefn debug() -> <T as Kernel>::DebugPrinter
fn debug() -> <T as Kernel>::DebugPrinter
sourcefn acquire_cpu_lock() -> Result<(), CpuLockError>
fn acquire_cpu_lock() -> Result<(), CpuLockError>
sourceunsafe fn release_cpu_lock() -> Result<(), CpuLockError>
unsafe fn release_cpu_lock() -> Result<(), CpuLockError>
sourcefn has_cpu_lock() -> bool
fn has_cpu_lock() -> bool
Return a flag indicating whether CPU Lock is currently active.
sourcefn boost_priority() -> Result<(), BoostPriorityError> where
T: KernelBoostPriority,
fn boost_priority() -> Result<(), BoostPriorityError> where
T: KernelBoostPriority,
Activate Priority Boost. Read more
sourceunsafe fn unboost_priority() -> Result<(), BoostPriorityError>
unsafe fn unboost_priority() -> Result<(), BoostPriorityError>
Deactivate Priority Boost. Read more
sourcefn is_priority_boost_active() -> bool
fn is_priority_boost_active() -> bool
Return a flag indicating whether Priority Boost is currently active. Read more
sourcefn is_task_context() -> bool
fn is_task_context() -> bool
Return a flag indicating whether the calling context is a task context. Read more
sourcefn is_interrupt_context() -> bool
fn is_interrupt_context() -> bool
Return a flag indicating whether the calling context is an interrupt context. Read more
sourcefn is_boot_complete() -> bool
fn is_boot_complete() -> bool
Return a flag indicating whether the boot phase is complete, i.e., all startup hooks completed execution, and the kernel started scheduling tasks and taking interrupts. Read more
sourcefn time() -> Result<Time, TimeError> where
T: KernelTime,
fn time() -> Result<Time, TimeError> where
T: KernelTime,
Get the current system time. Read more
sourcefn time_user_headroom() -> Duration where
T: KernelAdjustTime,
fn time_user_headroom() -> Duration where
T: KernelAdjustTime,
The extent of how overdue a timed event can be made or how far a timed
event can be delayed past Duration::MAX
by a call to adjust_time
. Read more
sourcefn adjust_time(delta: Duration) -> Result<(), AdjustTimeError> where
T: KernelAdjustTime,
fn adjust_time(delta: Duration) -> Result<(), AdjustTimeError> where
T: KernelAdjustTime,
Move the current system time forward or backward by the specified amount. Read more
sourceunsafe fn exit_task() -> Result<!, ExitTaskError>
unsafe fn exit_task() -> Result<!, ExitTaskError>
Terminate the current task, putting it into the Dormant state. Read more
sourcefn park() -> Result<(), ParkError>
fn park() -> Result<(), ParkError>
Put the current task into the Waiting state until the task’s token is
made available by Task::unpark
. The token is initially absent when
the task is activated. Read more