Major restructure
This commit is contained in:
parent
0562c2fe5a
commit
c52e19de83
25 changed files with 574 additions and 188 deletions
11
kern/proc.h
11
kern/proc.h
|
|
@ -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 {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue