am,include,arch: merge riscv*.h into riscv.h
This commit is contained in:
parent
ad8f8fb636
commit
e0ae9b7651
6 changed files with 10 additions and 44 deletions
21
am/include/arch/riscv.h
Normal file
21
am/include/arch/riscv.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef ARCH_H__
|
||||
#define ARCH_H__
|
||||
|
||||
struct Context {
|
||||
// TODO: fix the order of these members to match trap.S
|
||||
uintptr_t mepc, mcause, gpr[32], mstatus;
|
||||
void *pdir;
|
||||
};
|
||||
|
||||
#ifdef __riscv_e
|
||||
#define GPR1 gpr[15] // a5
|
||||
#else
|
||||
#define GPR1 gpr[17] // a7
|
||||
#endif
|
||||
|
||||
#define GPR2 gpr[0]
|
||||
#define GPR3 gpr[0]
|
||||
#define GPR4 gpr[0]
|
||||
#define GPRx gpr[0]
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue