[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 19/33] target/nios2: Implement CR_STATUS.RSIE
From: |
Richard Henderson |
Subject: |
[PATCH v4 19/33] target/nios2: Implement CR_STATUS.RSIE |
Date: |
Mon, 7 Mar 2022 21:19:51 -1000 |
Without EIC, this bit is RES1. So set the bit at reset,
and add it to the readonly fields of CR_STATUS.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/nios2/cpu.h | 1 +
target/nios2/cpu.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
index 7faec97d77..b418deec4c 100644
--- a/target/nios2/cpu.h
+++ b/target/nios2/cpu.h
@@ -108,6 +108,7 @@ FIELD(CR_STATUS, IL, 4, 6)
FIELD(CR_STATUS, CRS, 10, 6)
FIELD(CR_STATUS, PRS, 16, 6)
FIELD(CR_STATUS, NMI, 22, 1)
+FIELD(CR_STATUS, RSIE, 23, 1)
#define CR_STATUS_PIE (1u << R_CR_STATUS_PIE_SHIFT)
#define CR_STATUS_U (1u << R_CR_STATUS_U_SHIFT)
diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c
index fbcb4da737..ed7b9f9459 100644
--- a/target/nios2/cpu.c
+++ b/target/nios2/cpu.c
@@ -59,9 +59,9 @@ static void nios2_cpu_reset(DeviceState *dev)
#if defined(CONFIG_USER_ONLY)
/* Start in user mode with interrupts enabled. */
- env->status = CR_STATUS_U | CR_STATUS_PIE;
+ env->status = CR_STATUS_RSIE | CR_STATUS_U | CR_STATUS_PIE;
#else
- env->status = 0;
+ env->status = CR_STATUS_RSIE;
#endif
}
@@ -109,6 +109,7 @@ static void nios2_cpu_initfn(Object *obj)
WR_REG(CR_BADADDR);
/* TODO: These control registers are not present with the EIC. */
+ RO_FIELD(CR_STATUS, RSIE);
WR_REG(CR_IENABLE);
RO_REG(CR_IPENDING);
--
2.25.1
- [PATCH v4 17/33] target/nios2: Prevent writes to read-only or reserved control fields, (continued)
- [PATCH v4 17/33] target/nios2: Prevent writes to read-only or reserved control fields, Richard Henderson, 2022/03/08
- [PATCH v4 13/33] target/nios2: Use hw/registerfields.h for CR_TLBADDR fields, Richard Henderson, 2022/03/08
- [PATCH v4 16/33] target/nios2: Move R_FOO and CR_BAR into enumerations, Richard Henderson, 2022/03/08
- [PATCH v4 24/33] target/nios2: Introduce shadow register sets, Richard Henderson, 2022/03/08
- [PATCH v4 10/33] target/nios2: Clean up nios2_cpu_dump_state, Richard Henderson, 2022/03/08
- [PATCH v4 19/33] target/nios2: Implement CR_STATUS.RSIE,
Richard Henderson <=
- [PATCH v4 20/33] target/nios2: Remove CPU_INTERRUPT_NMI, Richard Henderson, 2022/03/08
- [PATCH v4 25/33] target/nios2: Implement rdprs, wrprs, Richard Henderson, 2022/03/08
- [PATCH v4 23/33] target/nios2: Drop CR_STATUS_EH from tb->flags, Richard Henderson, 2022/03/08
- [PATCH v4 21/33] target/nios2: Use tcg_constant_tl, Richard Henderson, 2022/03/08
- [PATCH v4 28/33] target/nios2: Clean up nios2_cpu_do_interrupt, Richard Henderson, 2022/03/08