![]() |
MOS Source Code
|
#include "mos/tasks/schedule.hpp"#include "mos/assert.hpp"#include "mos/lib/sync/spinlock.hpp"#include "mos/misc/setup.hpp"#include "mos/platform/platform.hpp"#include "mos/tasks/scheduler.hpp"#include <mos_string.hpp>Go to the source code of this file.
Functions | |
| char | thread_state_str (thread_state_t state) |
| MOS_SETUP ("scheduler", scheduler_cmdline_selector) | |
| void | scheduler_init () |
| 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 | 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. | |
| void | reschedule (void) |
| reschedule. | |
| void | blocked_reschedule (void) |
| Mark the current task as blocked and reschedule. | |
| bool | reschedule_for_waitlist (waitlist_t *waitlist) |
Variables | |
| static bool | scheduler_ready = false |
| static scheduler_t * | active_scheduler = NULL |
| const scheduler_info_t | __MOS_SCHEDULERS_START [] |
| const scheduler_info_t | __MOS_SCHEDULERS_END [] |
| char thread_state_str | ( | thread_state_t | state | ) |
Definition at line 13 of file schedule.cpp.
Referenced by reschedule(), and tasks_sysfs_thread_list().
| MOS_SETUP | ( | "scheduler" | , |
| scheduler_cmdline_selector | ) |
Definition at line 32 of file schedule.cpp.
| void scheduler_init | ( | ) |
Definition at line 49 of file schedule.cpp.
Referenced by mos_start_kernel().
Unblock the scheduler, so that APs can start scheduling.
Definition at line 59 of file schedule.cpp.
Referenced by mos_start_kernel().
Enter the scheduler and switch to the next thread.
Definition at line 66 of file schedule.cpp.
Referenced by mos_start_kernel(), and platform_ap_entry().
Add a thread to the scheduler, so that it can be scheduled.
| thread |
Definition at line 77 of file schedule.cpp.
Referenced by create_thread(), elf_create_process(), kthread_create(), process_do_fork(), and reschedule().
Remove a thread from the scheduler.
| thread |
Definition at line 84 of file schedule.cpp.
Wake a thread.
| thread |
Definition at line 90 of file schedule.cpp.
Referenced by signal_send_to_thread(), timer_do_wakeup(), and waitlist_wake().
reschedule.
Definition at line 106 of file schedule.cpp.
Referenced by blocked_reschedule(), enter_scheduler(), MOS_STATIC_ASSERT(), riscv64_trap_handler(), thread_exit_locked(), and x86_pit_timer_handler().
Mark the current task as blocked and reschedule.
Definition at line 163 of file schedule.cpp.
Referenced by ipc_connect_to_server(), ipc_server_accept(), reschedule_for_waitlist(), and timer_msleep().
| bool reschedule_for_waitlist | ( | waitlist_t * | waitlist | ) |
Definition at line 171 of file schedule.cpp.
Referenced by futex_wait(), Console::on_read(), pipe_read(), pipe_write(), process_wait_for_pid(), and thread_wait_for_tid().
Definition at line 28 of file schedule.cpp.
Referenced by enter_scheduler(), and unblock_scheduler().
|
static |
Definition at line 29 of file schedule.cpp.
Referenced by MOS_SETUP(), reschedule(), scheduler_add_thread(), scheduler_init(), scheduler_remove_thread(), and scheduler_wake_thread().
|
extern |
Referenced by MOS_SETUP(), and scheduler_init().
| const scheduler_info_t __MOS_SCHEDULERS_END[] |
Definition at line 30 of file schedule.cpp.
Referenced by MOS_SETUP().