diff --git a/arch/risc-v/include/elf.h b/arch/risc-v/include/elf.h index 2eb6270fb1..c6d45984f8 100644 --- a/arch/risc-v/include/elf.h +++ b/arch/risc-v/include/elf.h @@ -86,6 +86,9 @@ #define ARCH_ELFDATA 1 #define ARCH_ELF_RELCNT 8 +#define EM_ARCH EM_RISCV +#define EF_FLAG 0 + /**************************************************************************** * Public Types ****************************************************************************/ @@ -103,5 +106,13 @@ struct arch_elfdata_s }; typedef struct arch_elfdata_s arch_elfdata_t; +struct user_pt_regs +{ + uintreg_t regs[32]; +}; + +#define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(uintreg_t)) +typedef uintreg_t elf_gregset_t[ELF_NGREG]; + #endif /* __ASSEMBLY__ */ #endif /* __ARCH_RISCV_INCLUDE_ELF_H */ diff --git a/arch/risc-v/src/common/riscv_tcbinfo.c b/arch/risc-v/src/common/riscv_tcbinfo.c index bd79624650..1ad6216243 100644 --- a/arch/risc-v/src/common/riscv_tcbinfo.c +++ b/arch/risc-v/src/common/riscv_tcbinfo.c @@ -34,7 +34,7 @@ static const uint16_t g_reg_offs[] = { - UINT16_MAX, /* x0 */ + TCB_REG_OFF(REG_EPC_NDX), TCB_REG_OFF(REG_X1_NDX), TCB_REG_OFF(REG_X2_NDX), TCB_REG_OFF(REG_X3_NDX), @@ -66,7 +66,6 @@ static const uint16_t g_reg_offs[] = TCB_REG_OFF(REG_X29_NDX), TCB_REG_OFF(REG_X30_NDX), TCB_REG_OFF(REG_X31_NDX), - TCB_REG_OFF(REG_EPC_NDX), #if 0 # ifdef CONFIG_ARCH_FPU