Fix braces + init_paging args
This commit is contained in:
@@ -22,13 +22,11 @@ void scheduler_init()
|
||||
|
||||
struct cpu_status_t* scheduler_schedule(struct cpu_status_t* context)
|
||||
{
|
||||
if (context == NULL)
|
||||
{
|
||||
if (context == NULL) {
|
||||
panic(NULL, "Scheduler called with NULL context");
|
||||
}
|
||||
|
||||
if (current_process == NULL)
|
||||
{
|
||||
if (current_process == NULL) {
|
||||
// If no more processes, then set IDLE as the current process, that's it.
|
||||
current_process = idle_proc;
|
||||
}
|
||||
@@ -38,21 +36,17 @@ struct cpu_status_t* scheduler_schedule(struct cpu_status_t* context)
|
||||
|
||||
for (;;) {
|
||||
struct process_t* prev_process = current_process;
|
||||
if (current_process->next != NULL)
|
||||
{
|
||||
if (current_process->next != NULL) {
|
||||
current_process = current_process->next;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
current_process = processes_list;
|
||||
}
|
||||
|
||||
if (current_process != NULL && current_process->status == DEAD)
|
||||
{
|
||||
if (current_process != NULL && current_process->status == DEAD) {
|
||||
process_delete(&prev_process, current_process);
|
||||
current_process = NULL;
|
||||
return idle_proc->context;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
current_process->status = RUNNING;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user