Scheduler and multiple threads

This commit is contained in:
2022-01-10 23:31:23 +01:00
parent 9a68961a64
commit 576a32d92f
8 changed files with 123 additions and 45 deletions

View File

@@ -5,12 +5,21 @@ struct thread
{
struct thread *q_next;
uint64_t tid;
void *stack;
void *stack_ptr;
uint64_t state;
uint8_t stack[];
};
// proc/thread.c
extern struct thread *current_thread;
// proc/swtch.S
void *switch_stack(void *out, void *in);
// proc/thread.c
struct thread *new_thread(void (*function)(void));
struct thread *thread();
// proc/scheduler.c
void scheduler_insert(struct thread *new);
void start_scheduler();