Merge pull request #7 from Sin-kider/master
fix: Modify the register number into a macro definition
This commit is contained in:
commit
6c461b59db
1 changed files with 7 additions and 1 deletions
|
@ -1,9 +1,15 @@
|
||||||
#ifndef ARCH_H__
|
#ifndef ARCH_H__
|
||||||
#define ARCH_H__
|
#define ARCH_H__
|
||||||
|
|
||||||
|
#ifdef __riscv_e
|
||||||
|
#define NR_REGS 16
|
||||||
|
#else
|
||||||
|
#define NR_REGS 32
|
||||||
|
#endif
|
||||||
|
|
||||||
struct Context {
|
struct Context {
|
||||||
// TODO: fix the order of these members to match trap.S
|
// TODO: fix the order of these members to match trap.S
|
||||||
uintptr_t mepc, mcause, gpr[32], mstatus;
|
uintptr_t mepc, mcause, gpr[NR_REGS], mstatus;
|
||||||
void *pdir;
|
void *pdir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue