@@ -12,6 +12,7 @@
#ifndef __ASSEMBLY__
+/* MAX_REG_OFFSET should match the bottom of pt_regs */
struct pt_regs {
unsigned long epc;
unsigned long ra;
@@ -45,12 +46,12 @@ struct pt_regs {
unsigned long t4;
unsigned long t5;
unsigned long t6;
+ /* a0 value before the syscall */
+ unsigned long orig_a0;
/* Supervisor/Machine CSRs */
unsigned long status;
unsigned long badaddr;
unsigned long cause;
- /* a0 value before the syscall */
- unsigned long orig_a0;
};
#define PTRACE_SYSEMU 0x1f
@@ -64,7 +65,7 @@ struct pt_regs {
#define user_mode(regs) (((regs)->status & SR_PP) == 0)
-#define MAX_REG_OFFSET offsetof(struct pt_regs, orig_a0)
+#define MAX_REG_OFFSET offsetof(struct pt_regs, cause)
/* Helpers for working with the instruction pointer */
static inline unsigned long instruction_pointer(struct pt_regs *regs)
@@ -54,6 +54,8 @@ struct user_regs_struct {
unsigned long t4;
unsigned long t5;
unsigned long t6;
+ /* a0 value before the syscall */
+ unsigned long orig_a0;
};
struct __riscv_f_ext_state {