Skip to main content

nros_platform_task_attr_t

Struct nros_platform_task_attr_t 

Source
#[repr(C)]
pub struct nros_platform_task_attr_t { pub name: *const c_char, pub stack_bytes: usize, pub stack_mem: *mut c_void, pub priority: i32, pub core: i8, pub flags: u8, }

Fields§

§name: *const c_char

Task name for the kernel’s own tables and crash dumps. NULL = the port’s default. Ports whose kernel has no name concept ignore it.

§stack_bytes: usize

Minimum stack size in BYTES. 0 = the port’s default.

A FLOOR, not an exact size (issue 0612). Every port has a minimum of its own — PTHREAD_STACK_MIN, configMINIMAL_STACK_SIZE, TX_MINIMUM_STACK — and those differ by an order of magnitude, and on POSIX differ by ARCHITECTURE (16384 on glibc/x86_64, 131072 on glibc/aarch64). So no portable caller can name a number that is legal everywhere, and a port that treats a small request as an error turns a reasonable ask into a dead capability: that is exactly how Executor::signal_fd() returned NotInitialized on every Linux host. A port raises this to its own minimum; it never lowers it, and never refuses for being too small.

Always bytes, never words: FreeRTOS’s xTaskCreate takes words, and the private struct it replaced called the field stack_depth while ThreadX’s identically-named field was bytes. The conversion belongs in the one port that needs it, not in every caller.

§stack_mem: *mut c_void

Caller-provided stack memory, or NULL to let the port obtain it.

ThreadX requires the stack from its caller; POSIX, FreeRTOS and ESP-IDF let the kernel allocate and ignore this. A port that needs memory and is given NULL obtains it itself and releases it in task_free.

§priority: i32

Scheduling priority in the NORMALISED band: 0 = least urgent, larger = more urgent, NROS_PLATFORM_PRIORITY_INHERIT = keep the creating task’s.

phase-364 W5. This was “platform-native”, and the natives disagree: 0 is the HIGHEST priority on ThreadX and the LOWEST on FreeRTOS, while Zephyr runs lower-is-more-urgent with negatives reserved for cooperative threads. A tier priority is authored ONCE, in system.toml, and deployed to several of them — so the same number meant “run me first” on one board and “run me last” on another, with nothing in the ABI recording which convention a port used.

Each port maps this band onto its own range and documents the map at its task_init. Use NROS_PLATFORM_PRIORITY_RAW(n) to bypass the band when tuning one RTOS against its own documentation — that is a legitimate thing to do, and the band should not make it impossible.

§core: i8

SMP core to pin to, or -1 for unpinned. Ignored on single-core.

§flags: u8

NROS_PLATFORM_TASK_* flags below.

Trait Implementations§

Source§

impl Clone for nros_platform_task_attr_t

Source§

fn clone(&self) -> nros_platform_task_attr_t

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for nros_platform_task_attr_t

Source§

impl Debug for nros_platform_task_attr_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.