aboutsummaryrefslogtreecommitdiff
path: root/target/rx/translate.c
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2019-01-21 05:23:56 -0800
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-03-19 17:58:05 +0100
commit27a4a30e2945bbc4d073524c62a75b641715c832 (patch)
tree6ff40facc034d254e08cfaa5641da663395374de /target/rx/translate.c
parent075d047e2bd69d01d8718f5b2750020151f96d2f (diff)
downloadqemu-27a4a30e2945bbc4d073524c62a75b641715c832.zip
qemu-27a4a30e2945bbc4d073524c62a75b641715c832.tar.gz
qemu-27a4a30e2945bbc4d073524c62a75b641715c832.tar.bz2
target/rx: CPU definitions
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> [PMD: Use newer QOM style, split cpu-qom.h, restrict access to extable array, use rx_cpu_tlb_fill() extracted from patch of Yoshinori Sato 'Convert to CPUClass::tlb_fill', call cpu_reset after qemu_init_vcpu, make rx_crname a function] Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20200224141923.82118-7-ysato@users.sourceforge.jp> Acked-by: Richard Henderson <richard.henderson@linaro.org> [PMD: Use GByteArray in gdbstub (rebase commit a010bdbe), use device_class_set_parent_reset (rebase commit 781c67ca)] Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'target/rx/translate.c')
-rw-r--r--target/rx/translate.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/target/rx/translate.c b/target/rx/translate.c
index 6b52424..b3d7305 100644
--- a/target/rx/translate.c
+++ b/target/rx/translate.c
@@ -41,10 +41,17 @@ typedef struct DisasCompare {
TCGCond cond;
} DisasCompare;
-const char rx_crname[][6] = {
- "psw", "pc", "usp", "fpsw", "", "", "", "",
- "bpsw", "bpc", "isp", "fintv", "intb", "", "", "",
-};
+const char *rx_crname(uint8_t cr)
+{
+ static const char *cr_names[] = {
+ "psw", "pc", "usp", "fpsw", "", "", "", "",
+ "bpsw", "bpc", "isp", "fintv", "intb", "", "", ""
+ };
+ if (cr >= ARRAY_SIZE(cr_names)) {
+ return "illegal";
+ }
+ return cr_names[cr];
+}
/* Target-specific values for dc->base.is_jmp. */
#define DISAS_JUMP DISAS_TARGET_0
@@ -365,7 +372,7 @@ static void move_to_cr(DisasContext *ctx, TCGv val, int cr)
if (cr >= 8 && !is_privileged(ctx, 0)) {
/* Some control registers can only be written in privileged mode. */
qemu_log_mask(LOG_GUEST_ERROR,
- "disallow control register write %s", rx_crname[cr]);
+ "disallow control register write %s", rx_crname(cr));
return;
}
z = tcg_const_i32(0);