• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónf76a9ea1cb50d37ab98ee0b211ef7ece00ee70ea (tree)
Tiempo2019-06-16 22:31:40
AutorYoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

target/rx: Follow the change of tcg.

Add cpu-param.h
Remove CPU_COMMON
Use env_cpu

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

Cambiar Resumen

Diferencia incremental

--- /dev/null
+++ b/target/rx/cpu-param.h
@@ -0,0 +1,31 @@
1+/*
2+ * RX cpu parameters
3+ *
4+ * Copyright (c) 2019 Yoshinori Sato
5+ *
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms and conditions of the GNU General Public License,
8+ * version 2 or later, as published by the Free Software Foundation.
9+ *
10+ * This program is distributed in the hope it will be useful, but WITHOUT
11+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13+ * more details.
14+ *
15+ * You should have received a copy of the GNU General Public License along with
16+ * this program. If not, see <http://www.gnu.org/licenses/>.
17+ */
18+
19+#ifndef RX_CPU_PARAM_H
20+#define RX_CPU_PARAM_H
21+
22+#define TARGET_LONG_BITS 32
23+#define TARGET_PAGE_BITS 12
24+
25+#define TARGET_PHYS_ADDR_SPACE_BITS 32
26+#define TARGET_VIRT_ADDR_SPACE_BITS 32
27+
28+#define NB_MMU_MODES 1
29+#define MMU_MODE0_SUFFIX _all
30+
31+#endif
--- a/target/rx/cpu.c
+++ b/target/rx/cpu.c
@@ -173,6 +173,7 @@ static void rx_cpu_init(Object *obj)
173173 RXCPU *cpu = RXCPU(obj);
174174 CPURXState *env = &cpu->env;
175175
176+ cpu_set_cpustate_pointers(cpu);
176177 cs->env_ptr = env;
177178 qdev_init_gpio_in(DEVICE(cpu), rx_cpu_set_irq, 2);
178179 }
--- a/target/rx/cpu.h
+++ b/target/rx/cpu.h
@@ -25,14 +25,8 @@
2525 #include "cpu-qom.h"
2626 #include "qom/cpu.h"
2727
28-#define TARGET_LONG_BITS 32
29-#define TARGET_PAGE_BITS 12
30-
3128 #include "exec/cpu-defs.h"
3229
33-#define TARGET_PHYS_ADDR_SPACE_BITS 32
34-#define TARGET_VIRT_ADDR_SPACE_BITS 32
35-
3630 /* PSW define */
3731 REG32(PSW, 0)
3832 FIELD(PSW, C, 0, 1)
@@ -69,9 +63,6 @@ FIELD(FPSW, FX, 30, 1)
6963 FIELD(FPSW, FLAGS, 26, 4)
7064 FIELD(FPSW, FS, 31, 1)
7165
72-#define NB_MMU_MODES 1
73-#define MMU_MODE0_SUFFIX _all
74-
7566 enum {
7667 NUM_REGS = 16,
7768 };
@@ -108,8 +99,6 @@ typedef struct CPURXState {
10899 uint32_t ack_ipl; /* execute ipl */
109100 float_status fp_status;
110101 qemu_irq ack; /* Interrupt acknowledge */
111-
112- CPU_COMMON
113102 } CPURXState;
114103
115104 /*
@@ -123,19 +112,13 @@ struct RXCPU {
123112 CPUState parent_obj;
124113 /*< public >*/
125114
115+ CPUNegativeOffsetState neg;
126116 CPURXState env;
127117 };
128118
129119 typedef struct RXCPU RXCPU;
130120 typedef RXCPU ArchCPU;
131121
132-static inline RXCPU *rx_env_get_cpu(CPURXState *env)
133-{
134- return container_of(env, RXCPU, env);
135-}
136-
137-#define ENV_GET_CPU(e) CPU(rx_env_get_cpu(e))
138-
139122 #define ENV_OFFSET offsetof(RXCPU, env)
140123
141124 #define RX_CPU_TYPE_SUFFIX "-" TYPE_RX_CPU
@@ -156,8 +139,6 @@ int cpu_rx_signal_handler(int host_signum, void *pinfo,
156139 void *puc);
157140
158141 void rx_cpu_list(void);
159-void rx_load_image(RXCPU *cpu, const char *filename,
160- uint32_t start, uint32_t size);
161142 void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte);
162143
163144 #define cpu_signal_handler cpu_rx_signal_handler
--- a/target/rx/op_helper.c
+++ b/target/rx/op_helper.c
@@ -421,7 +421,7 @@ uint32_t helper_divu(CPURXState *env, uint32_t num, uint32_t den)
421421 static inline void QEMU_NORETURN raise_exception(CPURXState *env, int index,
422422 uintptr_t retaddr)
423423 {
424- CPUState *cs = CPU(rx_env_get_cpu(env));
424+ CPUState *cs = env_cpu(env);
425425
426426 cs->exception_index = index;
427427 cpu_loop_exit_restore(cs, retaddr);
@@ -444,7 +444,7 @@ void QEMU_NORETURN helper_raise_illegal_instruction(CPURXState *env)
444444
445445 void QEMU_NORETURN helper_wait(CPURXState *env)
446446 {
447- CPUState *cs = CPU(rx_env_get_cpu(env));
447+ CPUState *cs = env_cpu(env);
448448
449449 cs->halted = 1;
450450 env->in_sleep = 1;
@@ -453,7 +453,7 @@ void QEMU_NORETURN helper_wait(CPURXState *env)
453453
454454 void QEMU_NORETURN helper_debug(CPURXState *env)
455455 {
456- CPUState *cs = CPU(rx_env_get_cpu(env));
456+ CPUState *cs = env_cpu(env);
457457
458458 cs->exception_index = EXCP_DEBUG;
459459 cpu_loop_exit(cs);