mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
target/microblaze: Split out PC from env->sregs
Begin eliminating the sregs array in favor of individual members. Does not correct the width of pc, yet. Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
8a42ddf013
commit
76e8187d00
9 changed files with 42 additions and 37 deletions
|
@ -51,7 +51,7 @@ void cpu_loop(CPUMBState *env)
|
|||
case EXCP_BREAK:
|
||||
/* Return address is 4 bytes after the call. */
|
||||
env->regs[14] += 4;
|
||||
env->sregs[SR_PC] = env->regs[14];
|
||||
env->pc = env->regs[14];
|
||||
ret = do_syscall(env,
|
||||
env->regs[12],
|
||||
env->regs[5],
|
||||
|
@ -63,7 +63,7 @@ void cpu_loop(CPUMBState *env)
|
|||
0, 0);
|
||||
if (ret == -TARGET_ERESTARTSYS) {
|
||||
/* Wind back to before the syscall. */
|
||||
env->sregs[SR_PC] -= 4;
|
||||
env->pc -= 4;
|
||||
} else if (ret != -TARGET_QEMU_ESIGRETURN) {
|
||||
env->regs[3] = ret;
|
||||
}
|
||||
|
@ -73,13 +73,13 @@ void cpu_loop(CPUMBState *env)
|
|||
* not a userspace-usable register, as the kernel may clobber it
|
||||
* at any point.)
|
||||
*/
|
||||
env->regs[14] = env->sregs[SR_PC];
|
||||
env->regs[14] = env->pc;
|
||||
break;
|
||||
case EXCP_HW_EXCP:
|
||||
env->regs[17] = env->sregs[SR_PC] + 4;
|
||||
env->regs[17] = env->pc + 4;
|
||||
if (env->iflags & D_FLAG) {
|
||||
env->sregs[SR_ESR] |= 1 << 12;
|
||||
env->sregs[SR_PC] -= 4;
|
||||
env->pc -= 4;
|
||||
/* FIXME: if branch was immed, replay the imm as well. */
|
||||
}
|
||||
|
||||
|
@ -165,5 +165,5 @@ void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs)
|
|||
env->regs[29] = regs->r29;
|
||||
env->regs[30] = regs->r30;
|
||||
env->regs[31] = regs->r31;
|
||||
env->sregs[SR_PC] = regs->pc;
|
||||
env->pc = regs->pc;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ static void setup_sigcontext(struct target_sigcontext *sc, CPUMBState *env)
|
|||
__put_user(env->regs[29], &sc->regs.r29);
|
||||
__put_user(env->regs[30], &sc->regs.r30);
|
||||
__put_user(env->regs[31], &sc->regs.r31);
|
||||
__put_user(env->sregs[SR_PC], &sc->regs.pc);
|
||||
__put_user(env->pc, &sc->regs.pc);
|
||||
}
|
||||
|
||||
static void restore_sigcontext(struct target_sigcontext *sc, CPUMBState *env)
|
||||
|
@ -124,7 +124,7 @@ static void restore_sigcontext(struct target_sigcontext *sc, CPUMBState *env)
|
|||
__get_user(env->regs[29], &sc->regs.r29);
|
||||
__get_user(env->regs[30], &sc->regs.r30);
|
||||
__get_user(env->regs[31], &sc->regs.r31);
|
||||
__get_user(env->sregs[SR_PC], &sc->regs.pc);
|
||||
__get_user(env->pc, &sc->regs.pc);
|
||||
}
|
||||
|
||||
static abi_ulong get_sigframe(struct target_sigaction *ka,
|
||||
|
@ -188,7 +188,7 @@ void setup_frame(int sig, struct target_sigaction *ka,
|
|||
env->regs[7] = frame_addr += offsetof(typeof(*frame), uc);
|
||||
|
||||
/* Offset of 4 to handle microblaze rtid r14, 0 */
|
||||
env->sregs[SR_PC] = (unsigned long)ka->_sa_handler;
|
||||
env->pc = (unsigned long)ka->_sa_handler;
|
||||
|
||||
unlock_user_struct(frame, frame_addr, 1);
|
||||
return;
|
||||
|
@ -228,7 +228,7 @@ long do_sigreturn(CPUMBState *env)
|
|||
restore_sigcontext(&frame->uc.tuc_mcontext, env);
|
||||
/* We got here through a sigreturn syscall, our path back is via an
|
||||
rtb insn so setup r14 for that. */
|
||||
env->regs[14] = env->sregs[SR_PC];
|
||||
env->regs[14] = env->pc;
|
||||
|
||||
unlock_user_struct(frame, frame_addr, 0);
|
||||
return -TARGET_QEMU_ESIGRETURN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue