25 lines
477 B
C
25 lines
477 B
C
#pragma once
|
|
#include <stdint.h>
|
|
|
|
struct process {
|
|
uint64_t pid;
|
|
void *stack_ptr;
|
|
uint64_t state;
|
|
uint64_t P4;
|
|
struct process *q_next;
|
|
uint8_t stack[];
|
|
};
|
|
|
|
// proc/process.c
|
|
extern struct process *current_proc;
|
|
|
|
// proc/swtch.S
|
|
void *switch_stack(void *out, void *in);
|
|
|
|
// proc/process.c
|
|
struct process *new_process(void (*function)(void));
|
|
struct process *proc();
|
|
|
|
// proc/scheduler.c
|
|
void scheduler_insert(struct process *new);
|
|
void start_scheduler(); |