49 logln(
"SCHEDULE",
"Task switch from task %d to task %d",
52 logln(
"SCHEDULE",
"Initial task switch to task %d", next_task);
task_pid_t schedule_get_current_task()
Returns the current task's PID.
cpu_state_t * schedule(cpu_state_t *cpu)
Returns the next task to run.
void tss_set_stack(uint32_t stack_pointer)
Sets the TSS's kernel stack which is used to handle interrupts.
void schedule_finalize_tasks()
Destroys tasks marked for removal.
The CPU's state when an interrupt occurs.
void elf_destroy_task(task_pid_t pid)
Destroys a user task running the code of an ELF file.
page_directory_t * vmm_load_page_directory(page_directory_t *new_directory)
Loads a new page directory.
void task_set_cpu(task_pid_t pid, cpu_state_t *cpu)
Sets a task's CPU state.
cpu_state_t * task_get_cpu(task_pid_t pid)
Returns a task's CPU state.
task_pid_t schedule_get_next_task()
Returns the next running task's PID.
uint32_t task_pid_t
unique process ID
task_pid_t task_get_next_task_with_state(task_pid_t pid, task_state_t state)
Returns the next task from the task list with a specified state.
static task_pid_t current_task
the currently running task pid
static uint32_t ticks_per_time_slice
1 tick = frequency of the PIT
page_directory_t * task_get_page_directory(task_pid_t pid)
Returns a task's page directory.
cpu_state_t * schedule_switch_task(task_pid_t next_task)
Switches to a given task.
void * task_get_elf(task_pid_t pid)
Returns a task's ELF file.
task_state_t task_get_ticks(task_pid_t pid)
Returns a task's number of remaining ticks.
void task_destroy(task_pid_t pid)
Destroys a task.
uint32_t task_set_ticks(task_pid_t pid, uint32_t ticks)
Sets a task's number of remaining ticks.