aboutsummaryrefslogtreecommitdiff
path: root/linux-user/signal.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-12 21:01:26 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-12 21:01:26 +0000
commitd0dc7dc3274a88db1c9941614454ed842d62cf91 (patch)
tree46e369f2d52daecef62ef93665fdc6dbb21c3b82 /linux-user/signal.c
parent577d8dd43779f6ae75cb1b49606443ddab870bda (diff)
Make MIPS MT implementation more cache friendly.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3981 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/signal.c')
-rw-r--r--linux-user/signal.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 312e41941e..1f4608edac 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -2131,7 +2131,7 @@ setup_sigcontext(CPUState *regs, struct target_sigcontext *sc)
err |= __put_user(regs->PC[regs->current_tc], &sc->sc_pc);
#define save_gp_reg(i) do { \
- err |= __put_user(regs->gpr[i][regs->current_tc], &sc->sc_regs[i]); \
+ err |= __put_user(regs->gpr[regs->current_tc][i], &sc->sc_regs[i]); \
} while(0)
__put_user(0, &sc->sc_regs[0]); save_gp_reg(1); save_gp_reg(2);
save_gp_reg(3); save_gp_reg(4); save_gp_reg(5); save_gp_reg(6);
@@ -2144,8 +2144,8 @@ setup_sigcontext(CPUState *regs, struct target_sigcontext *sc)
save_gp_reg(31);
#undef save_gp_reg
- err |= __put_user(regs->HI[0][regs->current_tc], &sc->sc_mdhi);
- err |= __put_user(regs->LO[0][regs->current_tc], &sc->sc_mdlo);
+ err |= __put_user(regs->HI[regs->current_tc][0], &sc->sc_mdhi);
+ err |= __put_user(regs->LO[regs->current_tc][0], &sc->sc_mdlo);
/* Not used yet, but might be useful if we ever have DSP suppport */
#if 0
@@ -2205,11 +2205,11 @@ restore_sigcontext(CPUState *regs, struct target_sigcontext *sc)
err |= __get_user(regs->CP0_EPC, &sc->sc_pc);
- err |= __get_user(regs->HI[0][regs->current_tc], &sc->sc_mdhi);
- err |= __get_user(regs->LO[0][regs->current_tc], &sc->sc_mdlo);
+ err |= __get_user(regs->HI[regs->current_tc][0], &sc->sc_mdhi);
+ err |= __get_user(regs->LO[regs->current_tc][0], &sc->sc_mdlo);
#define restore_gp_reg(i) do { \
- err |= __get_user(regs->gpr[i][regs->current_tc], &sc->sc_regs[i]); \
+ err |= __get_user(regs->gpr[regs->current_tc][i], &sc->sc_regs[i]); \
} while(0)
restore_gp_reg( 1); restore_gp_reg( 2); restore_gp_reg( 3);
restore_gp_reg( 4); restore_gp_reg( 5); restore_gp_reg( 6);
@@ -2275,7 +2275,7 @@ get_sigframe(struct emulated_sigaction *ka, CPUState *regs, size_t frame_size)
unsigned long sp;
/* Default to using normal stack */
- sp = regs->gpr[29][regs->current_tc];
+ sp = regs->gpr[regs->current_tc][29];
/*
* FPU emulator may have it's own trampoline active just
@@ -2324,15 +2324,15 @@ static void setup_frame(int sig, struct emulated_sigaction * ka,
* $25 and PC point to the signal handler, $29 points to the
* struct sigframe.
*/
- regs->gpr[ 4][regs->current_tc] = sig;
- regs->gpr[ 5][regs->current_tc] = 0;
- regs->gpr[ 6][regs->current_tc] = frame_addr + offsetof(struct sigframe, sf_sc);
- regs->gpr[29][regs->current_tc] = frame_addr;
- regs->gpr[31][regs->current_tc] = frame_addr + offsetof(struct sigframe, sf_code);
+ regs->gpr[regs->current_tc][ 4] = sig;
+ regs->gpr[regs->current_tc][ 5] = 0;
+ regs->gpr[regs->current_tc][ 6] = frame_addr + offsetof(struct sigframe, sf_sc);
+ regs->gpr[regs->current_tc][29] = frame_addr;
+ regs->gpr[regs->current_tc][31] = frame_addr + offsetof(struct sigframe, sf_code);
/* The original kernel code sets CP0_EPC to the handler
* since it returns to userland using eret
* we cannot do this here, and we must set PC directly */
- regs->PC[regs->current_tc] = regs->gpr[25][regs->current_tc] = ka->sa._sa_handler;
+ regs->PC[regs->current_tc] = regs->gpr[regs->current_tc][25] = ka->sa._sa_handler;
unlock_user_struct(frame, frame_addr, 1);
return;
@@ -2353,7 +2353,7 @@ long do_sigreturn(CPUState *regs)
#if defined(DEBUG_SIGNAL)
fprintf(stderr, "do_sigreturn\n");
#endif
- frame_addr = regs->gpr[29][regs->current_tc];
+ frame_addr = regs->gpr[regs->current_tc][29];
if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))
goto badframe;