[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 20/64] linux-user/nios2: Only initialize SP and PC in target_c
From: |
Richard Henderson |
Subject: |
[PATCH v7 20/64] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs |
Date: |
Thu, 21 Apr 2022 08:16:51 -0700 |
Drop the set of estatus in init_thread; it was clearly intended
to be setting the value of CR_STATUS for the application, but we
never actually performed that copy. However, the proper value is
set in nios2_cpu_reset so we don't need to do anything here.
We only initialize SP and EA in init_thread, there's no value in
copying other uninitialized data into ENV.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/elfload.c | 1 -
linux-user/nios2/cpu_loop.c | 22 ----------------------
2 files changed, 23 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 397dec5eb8..61063fd974 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1096,7 +1096,6 @@ static void init_thread(struct target_pt_regs *regs,
struct image_info *infop)
{
regs->ea = infop->entry;
regs->sp = infop->start_stack;
- regs->estatus = 0x3;
}
#define LO_COMMPAGE TARGET_PAGE_SIZE
diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c
index a941f9032e..c5e68ac048 100644
--- a/linux-user/nios2/cpu_loop.c
+++ b/linux-user/nios2/cpu_loop.c
@@ -133,28 +133,6 @@ void cpu_loop(CPUNios2State *env)
void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs)
{
- env->regs[0] = 0;
- env->regs[1] = regs->r1;
- env->regs[2] = regs->r2;
- env->regs[3] = regs->r3;
- env->regs[4] = regs->r4;
- env->regs[5] = regs->r5;
- env->regs[6] = regs->r6;
- env->regs[7] = regs->r7;
- env->regs[8] = regs->r8;
- env->regs[9] = regs->r9;
- env->regs[10] = regs->r10;
- env->regs[11] = regs->r11;
- env->regs[12] = regs->r12;
- env->regs[13] = regs->r13;
- env->regs[14] = regs->r14;
- env->regs[15] = regs->r15;
- /* TODO: unsigned long orig_r2; */
- env->regs[R_RA] = regs->ra;
- env->regs[R_FP] = regs->fp;
env->regs[R_SP] = regs->sp;
- env->regs[R_GP] = regs->gp;
- env->regs[CR_ESTATUS] = regs->estatus;
env->pc = regs->ea;
- /* TODO: unsigned long orig_r7; */
}
--
2.34.1
- [PATCH v7 10/64] target/nios2: Remove nios2_cpu_record_sigsegv, (continued)
- [PATCH v7 10/64] target/nios2: Remove nios2_cpu_record_sigsegv, Richard Henderson, 2022/04/21
- [PATCH v7 11/64] target/nios2: Build helper.c for system only, Richard Henderson, 2022/04/21
- [PATCH v7 12/64] linux-user/nios2: Use force_sig_fault for EXCP_DEBUG, Richard Henderson, 2022/04/21
- [PATCH v7 13/64] target/nios2: Check supervisor on eret, Richard Henderson, 2022/04/21
- [PATCH v7 14/64] target/nios2: Stop generating code if gen_check_supervisor fails, Richard Henderson, 2022/04/21
- [PATCH v7 15/64] target/nios2: Add NUM_GP_REGS and NUM_CP_REGS, Richard Henderson, 2022/04/21
- [PATCH v7 16/64] target/nios2: Split PC out of env->regs[], Richard Henderson, 2022/04/21
- [PATCH v7 17/64] target/nios2: Split out helper for eret instruction, Richard Henderson, 2022/04/21
- [PATCH v7 18/64] target/nios2: Fix BRET instruction, Richard Henderson, 2022/04/21
- [PATCH v7 19/64] target/nios2: Do not create TCGv for control registers, Richard Henderson, 2022/04/21
- [PATCH v7 20/64] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs,
Richard Henderson <=
- [PATCH v7 23/64] target/nios2: Clean up nios2_cpu_dump_state, Richard Henderson, 2022/04/21
- [PATCH v7 22/64] target/nios2: Split control registers away from general registers, Richard Henderson, 2022/04/21
- [PATCH v7 24/64] target/nios2: Use hw/registerfields.h for CR_STATUS fields, Richard Henderson, 2022/04/21
- [PATCH v7 25/64] target/nios2: Use hw/registerfields.h for CR_EXCEPTION fields, Richard Henderson, 2022/04/21
- [PATCH v7 21/64] target/nios2: Remove cpu_interrupts_enabled, Richard Henderson, 2022/04/21
- [PATCH v7 26/64] target/nios2: Use hw/registerfields.h for CR_TLBADDR fields, Richard Henderson, 2022/04/21
- [PATCH v7 27/64] target/nios2: Use hw/registerfields.h for CR_TLBACC fields, Richard Henderson, 2022/04/21
- [PATCH v7 28/64] target/nios2: Rename CR_TLBMISC_WR to CR_TLBMISC_WE, Richard Henderson, 2022/04/21
- [PATCH v7 29/64] target/nios2: Use hw/registerfields.h for CR_TLBMISC fields, Richard Henderson, 2022/04/21
- [PATCH v7 30/64] target/nios2: Move R_FOO and CR_BAR into enumerations, Richard Henderson, 2022/04/21