[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 24/68] target/nios2: Use hw/registerfields.h for CR_STATUS fie
From: |
Richard Henderson |
Subject: |
[PATCH v8 24/68] target/nios2: Use hw/registerfields.h for CR_STATUS fields |
Date: |
Fri, 22 Apr 2022 09:51:54 -0700 |
Add all fields; retain the helper macros for single bit fields.
So far there are no uses of the multi-bit status fields.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220421151735.31996-25-richard.henderson@linaro.org>
---
target/nios2/cpu.h | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
index 68ff8033b6..562dca8195 100644
--- a/target/nios2/cpu.h
+++ b/target/nios2/cpu.h
@@ -23,6 +23,7 @@
#include "exec/cpu-defs.h"
#include "hw/core/cpu.h"
+#include "hw/registerfields.h"
#include "qom/object.h"
typedef struct CPUArchState CPUNios2State;
@@ -79,15 +80,24 @@ struct Nios2CPUClass {
/* Control register aliases */
#define CR_STATUS 0
-#define CR_STATUS_PIE (1 << 0)
-#define CR_STATUS_U (1 << 1)
-#define CR_STATUS_EH (1 << 2)
-#define CR_STATUS_IH (1 << 3)
-#define CR_STATUS_IL (63 << 4)
-#define CR_STATUS_CRS (63 << 10)
-#define CR_STATUS_PRS (63 << 16)
-#define CR_STATUS_NMI (1 << 22)
-#define CR_STATUS_RSIE (1 << 23)
+
+FIELD(CR_STATUS, PIE, 0, 1)
+FIELD(CR_STATUS, U, 1, 1)
+FIELD(CR_STATUS, EH, 2, 1)
+FIELD(CR_STATUS, IH, 3, 1)
+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 R_CR_STATUS_PIE_MASK
+#define CR_STATUS_U R_CR_STATUS_U_MASK
+#define CR_STATUS_EH R_CR_STATUS_EH_MASK
+#define CR_STATUS_IH R_CR_STATUS_IH_MASK
+#define CR_STATUS_NMI R_CR_STATUS_NMI_MASK
+#define CR_STATUS_RSIE R_CR_STATUS_RSIE_MASK
+
#define CR_ESTATUS 1
#define CR_BSTATUS 2
#define CR_IENABLE 3
--
2.34.1
- [PATCH v8 10/68] target/nios2: Remove nios2_cpu_record_sigsegv, (continued)
- [PATCH v8 10/68] target/nios2: Remove nios2_cpu_record_sigsegv, Richard Henderson, 2022/04/22
- [PATCH v8 11/68] target/nios2: Build helper.c for system only, Richard Henderson, 2022/04/22
- [PATCH v8 12/68] linux-user/nios2: Use force_sig_fault for EXCP_DEBUG, Richard Henderson, 2022/04/22
- [PATCH v8 14/68] target/nios2: Stop generating code if gen_check_supervisor fails, Richard Henderson, 2022/04/22
- [PATCH v8 13/68] target/nios2: Check supervisor on eret, Richard Henderson, 2022/04/22
- [PATCH v8 16/68] target/nios2: Split PC out of env->regs[], Richard Henderson, 2022/04/22
- [PATCH v8 18/68] target/nios2: Fix BRET instruction, Richard Henderson, 2022/04/22
- [PATCH v8 19/68] target/nios2: Do not create TCGv for control registers, Richard Henderson, 2022/04/22
- [PATCH v8 20/68] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs, Richard Henderson, 2022/04/22
- [PATCH v8 21/68] target/nios2: Remove cpu_interrupts_enabled, Richard Henderson, 2022/04/22
- [PATCH v8 24/68] target/nios2: Use hw/registerfields.h for CR_STATUS fields,
Richard Henderson <=
- [PATCH v8 15/68] target/nios2: Add NUM_GP_REGS and NUM_CP_REGS, Richard Henderson, 2022/04/22
- [PATCH v8 17/68] target/nios2: Split out helper for eret instruction, Richard Henderson, 2022/04/22
- [PATCH v8 23/68] target/nios2: Clean up nios2_cpu_dump_state, Richard Henderson, 2022/04/22
- [PATCH v8 22/68] target/nios2: Split control registers away from general registers, Richard Henderson, 2022/04/22
- [PATCH v8 25/68] target/nios2: Use hw/registerfields.h for CR_EXCEPTION fields, Richard Henderson, 2022/04/22
- [PATCH v8 26/68] target/nios2: Use hw/registerfields.h for CR_TLBADDR fields, Richard Henderson, 2022/04/22
- [PATCH v8 27/68] target/nios2: Use hw/registerfields.h for CR_TLBACC fields, Richard Henderson, 2022/04/22
- [PATCH v8 28/68] target/nios2: Rename CR_TLBMISC_WR to CR_TLBMISC_WE, Richard Henderson, 2022/04/22
- [PATCH v8 29/68] target/nios2: Use hw/registerfields.h for CR_TLBMISC fields, Richard Henderson, 2022/04/22
- [PATCH v8 30/68] target/nios2: Move R_FOO and CR_BAR into enumerations, Richard Henderson, 2022/04/22