37 if (
strcmp(info->name, arg) == 0)
41 pr_dinfo2(scheduler,
"active scheduler: %s", info->name);
46 pr_dwarn(scheduler,
"scheduler '%s' not found", arg);
54 pr_dwarn(scheduler,
"no scheduler is selected, using the first scheduler");
62 pr_dinfo2(scheduler,
"unblocking scheduler");
103 pr_dinfo2(scheduler,
"waking up %pt", thread);
134 const bool should_switch_mm = cpu->
mm_context != next->owner->mm;
135 if (should_switch_mm)
#define MOS_ASSERT_X(cond, msg,...)
#define MOS_UNREACHABLE()
MOSAPI s32 strcmp(const char *str1, const char *str2)
__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)
spinlock_t state_lock
protects the thread state
thread_state_t state
thread state
Thread * idle_thread
idle thread for this CPU
should_inline bool thread_is_valid(const Thread *thread)
__nodiscard bool waitlist_append(waitlist_t *list)