abstract-machine(nemu): support context switch
This commit is contained in:
parent
ef51673020
commit
385d448746
22 changed files with 236 additions and 87 deletions
|
@ -1,5 +1,6 @@
|
|||
#ifndef ARCH_H__
|
||||
#define ARCH_H__
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __riscv_e
|
||||
#define NR_REGS 16
|
||||
|
@ -9,10 +10,13 @@
|
|||
|
||||
struct Context {
|
||||
// TODO: fix the order of these members to match trap.S
|
||||
uintptr_t mepc, mcause, gpr[NR_REGS], mstatus;
|
||||
uintptr_t gpr[NR_REGS];
|
||||
uintptr_t mcause, mstatus, mepc;
|
||||
void *pdir;
|
||||
};
|
||||
|
||||
enum Cause { CauseEnvironmentCallFromMMode = 11 };
|
||||
|
||||
#ifdef __riscv_e
|
||||
#define GPR1 gpr[15] // a5
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue