36 if (info->name == arg)
40 pr_dinfo2(scheduler,
"active scheduler: %s", info->name);
45 pr_dwarn(scheduler,
"scheduler '%s' not found", arg);
53 pr_dwarn(scheduler,
"no scheduler is selected, using the first scheduler");
61 pr_dinfo2(scheduler,
"unblocking scheduler");
102 pr_dinfo2(scheduler,
"waking up %pt", thread);
133 const bool should_switch_mm = cpu->
mm_context != next->owner->mm;
134 if (should_switch_mm)
140 const ContextSwitchBehaviorFlags switch_flags =
statement_expr(ContextSwitchBehaviorFlags, {
#define MOS_ASSERT_X(cond, msg,...)
#define MOS_UNREACHABLE()
__nodiscard MMContext * mm_switch_context(MMContext *new_ctx)
#define statement_expr(type,...)
#define pr_dinfo2(feat, fmt,...)
#define pr_dwarn(feat, fmt,...)
void blocked_reschedule(void)
Mark the current task as blocked and reschedule.
bool reschedule_for_waitlist(waitlist_t *waitlist)
void unblock_scheduler(void)
Unblock the scheduler, so that APs can start scheduling.
void enter_scheduler(void)
Enter the scheduler and switch to the next thread.
void reschedule(void)
reschedule.
char thread_state_str(thread_state_t state)
static bool scheduler_ready
const scheduler_info_t __MOS_SCHEDULERS_END[]
const scheduler_info_t __MOS_SCHEDULERS_START[]
static scheduler_t * active_scheduler
void scheduler_add_thread(Thread *thread)
Add a thread to the scheduler, so that it can be scheduled.
void scheduler_remove_thread(Thread *thread)
Remove a thread from the scheduler.
void scheduler_wake_thread(Thread *thread)
Wake a thread.
#define MOS_SETUP(_param, _fn)
should_inline bool spinlock_is_locked(const spinlock_t *lock)
#define spinlock_acquire(lock)
#define spinlock_release(lock)
static bool IsValid(const Thread *thread)
spinlock_t state_lock
protects the thread state
thread_state_t state
thread state
Thread * idle_thread
idle thread for this CPU
__nodiscard bool waitlist_append(waitlist_t *list)