summaryrefslogtreecommitdiff
path: root/kernel/sched/scheduler.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-02-19 18:52:30 +0100
committerAnton Kling <anton@kling.gg>2024-02-19 18:52:30 +0100
commit239e33019117f4ab59dd26550d7969e45c290166 (patch)
treede180effd804573d07acf8ac495fa7defc1edd70 /kernel/sched/scheduler.c
parent61c443579150a4714c132ecb1ac18779535f91c9 (diff)
Kernel/VFS: Cleanup of file descriptor halts
Diffstat (limited to 'kernel/sched/scheduler.c')
-rw-r--r--kernel/sched/scheduler.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/kernel/sched/scheduler.c b/kernel/sched/scheduler.c
index 8cb5af7..5a95c4c 100644
--- a/kernel/sched/scheduler.c
+++ b/kernel/sched/scheduler.c
@@ -119,6 +119,10 @@ process_t *create_process(process_t *p, u32 esp, u32 eip) {
r->tcb = kcalloc(1, sizeof(struct TCB));
r->tcb->CR3 = r->cr3->physical_address;
+ list_init(&r->read_list);
+ list_init(&r->write_list);
+ list_init(&r->disconnect_list);
+
// Temporarily switch to the page directory to be able to place the
// "entry_instruction_pointer" onto the stack.
@@ -155,12 +159,6 @@ process_t *create_process(process_t *p, u32 esp, u32 eip) {
} else {
r->file_descriptors[i] = NULL;
}
- if (i < 20)
- r->signal_handlers[i] = NULL;
- r->read_halt_inode[i] = NULL;
- r->write_halt_inode[i] = NULL;
- r->disconnect_halt_inode[i] = NULL;
- r->maps[i] = NULL;
}
return r;
}
@@ -332,8 +330,7 @@ int is_halted(process_t *process) {
if (process->halts[i])
return 1;
- if (isset_fdhalt(process->read_halt_inode, process->write_halt_inode,
- process->disconnect_halt_inode)) {
+ if (isset_fdhalt(process)) {
return 1;
}
return 0;
@@ -349,7 +346,7 @@ process_t *next_task(process_t *c) {
if (1 == loop) {
return s;
}
- loop = 1;
+ // loop = 1;
}
c = c->next;
if (!c)
@@ -387,8 +384,8 @@ void switch_task() {
if (!current_task) {
return;
}
- disable_interrupts();
+ disable_interrupts();
current_task = next_task((process_t *)current_task);
active_directory = current_task->cr3;