You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
riscv-pke/kernel/process.h

31 lines
721 B

#ifndef _PROC_H_
#define _PROC_H_
#include "riscv.h"
typedef struct trapframe_t {
// space to store context (all common registers)
/* offset:0 */ riscv_regs regs;
// process's "user kernel" stack
/* offset:248 */ uint64 kernel_sp;
// pointer to smode_trap_handler
/* offset:256 */ uint64 kernel_trap;
// saved user process counter
/* offset:264 */ uint64 epc;
}trapframe;
// the extremely simple definition of process, used for begining labs of PKE
typedef struct process_t {
// pointing to the stack used in trap handling.
uint64 kstack;
// trapframe storing the context of a (User mode) process.
trapframe* trapframe;
}process;
void switch_to(process*);
extern process* current;
#endif