Major restructure

This commit is contained in:
Imbus 2025-09-01 22:22:35 +02:00
parent 0562c2fe5a
commit c52e19de83
25 changed files with 574 additions and 188 deletions

View file

@ -1,3 +1,6 @@
#include <config.h>
#include <spinlock.h>
#include <riscv.h>
#include <stdint.h>
typedef enum {
@ -37,6 +40,7 @@ struct Cpu {
int intena; // Were interrupts enabled before push_off()?
};
/** Saved registers for kernel context switches. */
typedef struct {
/* 0 */ uint64_t kernel_satp; // kernel page table
/* 8 */ uint64_t kernel_sp; // top of process's kernel stack
@ -75,3 +79,10 @@ typedef struct {
/* 272 */ uint64_t t5;
/* 280 */ uint64_t t6;
} TrapFrame_t;
struct Cpu *mycpu(void);
extern struct Cpu cpus[NCPU];
/** Per-process state */
struct Proc {};