On 10/19/21 9:44 AM, Warner Losh wrote:
Implement the register copying routines to extract registers from the
cpu for core dump generation.
Signed-off-by: Stacey Son <s...@freebsd.org>
Signed-off-by: Warner Losh <i...@bsdimp.com>
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
+static inline void target_copy_regs(target_reg_t *regs, const CPUARMState *env)
+{
+ int i;
+
+ for (i = 0; i < 13; i++) {
+ regs->r[i] = tswapreg(env->regs[i + 1]);
+ }
+ regs->r_sp = tswapreg(env->regs[13]);
+ regs->r_lr = tswapreg(env->regs[14]);
+ regs->r_pc = tswapreg(env->regs[15]);
+ regs->r_cpsr = tswapreg(cpsr_read((CPUARMState *)env));
I guess we could do with a bit of const-ification in target/arm/...
r~