| 1 |
//! Header: `sys/sched.h` |
| 2 |
//! |
| 3 |
//! QuRT scheduling parameters and functions. |
| 4 |
|
| 5 |
use crate::prelude::*; |
| 6 |
|
| 7 |
// Scheduling policies (from QuRT sys/sched.h) |
| 8 |
pub const SCHED_FIFO: c_int = 0; |
| 9 |
pub const SCHED_RR: c_int = 1; |
| 10 |
pub const SCHED_SPORADIC: c_int = 2; |
| 11 |
pub const SCHED_OTHER: c_int = 3; |
| 12 |
|
| 13 |
s! { |
| 14 |
pub struct sched_param { |
| 15 |
pub unimplemented: *mut c_void, |
| 16 |
pub sched_priority: c_int, |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
extern "C" { |
| 21 |
// Note: sched_yield is static inline in QuRT sys/sched.h, so there is no |
| 22 |
// linkable symbol in the SDK libraries. Programs must provide their own |
| 23 |
// implementation or use --defsym=sched_yield=abort at link time. |
| 24 |
pub fn sched_yield() -> c_int; |
| 25 |
pub fn sched_get_priority_max(policy: c_int) -> c_int; |
| 26 |
pub fn sched_get_priority_min(policy: c_int) -> c_int; |
| 27 |
} |