NJU-ProjectN/abstract-machine ics2023 initialized
NJU-ProjectN/abstract-machine 3348db971fd860be5cb28e21c18f9d0e65d0c96a Merge pull request #8 from Jasonyanyusong/master
This commit is contained in:
parent
2824efad33
commit
8e4feb4010
129 changed files with 9017 additions and 0 deletions
27
abstract-machine/am/include/arch/riscv.h
Normal file
27
abstract-machine/am/include/arch/riscv.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef ARCH_H__
|
||||
#define ARCH_H__
|
||||
|
||||
#ifdef __riscv_e
|
||||
#define NR_REGS 16
|
||||
#else
|
||||
#define NR_REGS 32
|
||||
#endif
|
||||
|
||||
struct Context {
|
||||
// TODO: fix the order of these members to match trap.S
|
||||
uintptr_t mepc, mcause, gpr[NR_REGS], 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