Turn threads into processes by giving them unique page directories
This commit is contained in:
@@ -1,25 +1,26 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
struct thread
|
||||
struct process
|
||||
{
|
||||
struct thread *q_next;
|
||||
uint64_t tid;
|
||||
uint64_t pid;
|
||||
void *stack_ptr;
|
||||
uint64_t state;
|
||||
uint64_t P4;
|
||||
struct process *q_next;
|
||||
uint8_t stack[];
|
||||
};
|
||||
|
||||
// proc/thread.c
|
||||
extern struct thread *current_thread;
|
||||
// proc/process.c
|
||||
extern struct process *current_proc;
|
||||
|
||||
// proc/swtch.S
|
||||
void *switch_stack(void *out, void *in);
|
||||
|
||||
// proc/thread.c
|
||||
struct thread *new_thread(void (*function)(void));
|
||||
struct thread *thread();
|
||||
// proc/process.c
|
||||
struct process *new_process(void (*function)(void));
|
||||
struct process *proc();
|
||||
|
||||
// proc/scheduler.c
|
||||
void scheduler_insert(struct thread *new);
|
||||
void scheduler_insert(struct process *new);
|
||||
void start_scheduler();
|
||||
Reference in New Issue
Block a user