At this point the threads are really processes...

This commit is contained in:
2018-02-20 20:46:24 +01:00
parent 6523b10984
commit e868b83f50
6 changed files with 93 additions and 93 deletions

View File

@@ -0,0 +1,22 @@
#pragma once
#include <queue.h>
#include <scheduler.h>
#include <stdint.h>
struct process
{
uint64_t pid;
void *stack_ptr;
uint64_t state;
uint64_t P4;
QUEUE_SPOT(runQ);
uint8_t stack[];
};
struct process *process();
struct process *new_process(void (*function)(void));
void yield();
void start_scheduler();
void switch_stack(void *old_ptr, void *new_ptr);