ready for ics2021

This commit is contained in:
Zihao Yu 2021-08-07 11:28:08 +08:00
parent 3cf0ee6d42
commit 30e5cd0c7e
72 changed files with 252 additions and 339 deletions

View file

@ -2,6 +2,7 @@
#define __ARCH_H__
struct Context {
// TODO: fix the order of these members to match trap.S
uintptr_t hi, gpr[32], epc, cause, lo, status;
void *pdir;
};

View file

@ -2,7 +2,8 @@
#define ARCH_H__
struct Context {
uintptr_t epc, cause, gpr[32], status;
// TODO: fix the order of these members to match trap.S
uintptr_t mepc, mcause, gpr[32], mstatus;
void *pdir;
};

View file

@ -3,14 +3,12 @@
struct Context {
// TODO: fix the order of these members to match trap.S
uintptr_t epc, cause, gpr[32], status;
uintptr_t mepc, mcause, gpr[32], mstatus;
};
#define GPR1 gpr[0]
#define GPR1 gpr[17] // a7
#define GPR2 gpr[0]
#define GPR3 gpr[0]
#define GPR4 gpr[0]
#define GPRx gpr[0]
#endif

View file

@ -2,7 +2,8 @@
#define ARCH_H__
struct Context {
uintptr_t epc, cause, gpr[32], status;
// TODO: fix the order of these members to match trap.S
uintptr_t mepc, mcause, gpr[32], mstatus;
void *pdir;
};
@ -11,5 +12,4 @@ struct Context {
#define GPR3 gpr[0]
#define GPR4 gpr[0]
#define GPRx gpr[0]
#endif

View file

@ -2,6 +2,13 @@
#define ARCH_H__
struct Context {
uintptr_t gpr[1];
};
#define GPR1 gpr[0]
#define GPR2 gpr[0]
#define GPR3 gpr[0]
#define GPR4 gpr[0]
#define GPRx gpr[0]
#endif

View file

@ -2,6 +2,7 @@
#define ARCH_H__
struct Context {
// TODO: fix the order of these members to match trap.S
uintptr_t esi, ebx, eax, eip, edx, eflags, ecx, cs, esp, edi, ebp;
void *cr3;
int irq;