Revisión | f76a9ea1cb50d37ab98ee0b211ef7ece00ee70ea (tree) |
---|---|
Tiempo | 2019-06-16 22:31:40 |
Autor | Yoshinori Sato <ysato@user...> |
Commiter | Yoshinori Sato |
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>
@@ -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 |
@@ -173,6 +173,7 @@ static void rx_cpu_init(Object *obj) | ||
173 | 173 | RXCPU *cpu = RXCPU(obj); |
174 | 174 | CPURXState *env = &cpu->env; |
175 | 175 | |
176 | + cpu_set_cpustate_pointers(cpu); | |
176 | 177 | cs->env_ptr = env; |
177 | 178 | qdev_init_gpio_in(DEVICE(cpu), rx_cpu_set_irq, 2); |
178 | 179 | } |
@@ -25,14 +25,8 @@ | ||
25 | 25 | #include "cpu-qom.h" |
26 | 26 | #include "qom/cpu.h" |
27 | 27 | |
28 | -#define TARGET_LONG_BITS 32 | |
29 | -#define TARGET_PAGE_BITS 12 | |
30 | - | |
31 | 28 | #include "exec/cpu-defs.h" |
32 | 29 | |
33 | -#define TARGET_PHYS_ADDR_SPACE_BITS 32 | |
34 | -#define TARGET_VIRT_ADDR_SPACE_BITS 32 | |
35 | - | |
36 | 30 | /* PSW define */ |
37 | 31 | REG32(PSW, 0) |
38 | 32 | FIELD(PSW, C, 0, 1) |
@@ -69,9 +63,6 @@ FIELD(FPSW, FX, 30, 1) | ||
69 | 63 | FIELD(FPSW, FLAGS, 26, 4) |
70 | 64 | FIELD(FPSW, FS, 31, 1) |
71 | 65 | |
72 | -#define NB_MMU_MODES 1 | |
73 | -#define MMU_MODE0_SUFFIX _all | |
74 | - | |
75 | 66 | enum { |
76 | 67 | NUM_REGS = 16, |
77 | 68 | }; |
@@ -108,8 +99,6 @@ typedef struct CPURXState { | ||
108 | 99 | uint32_t ack_ipl; /* execute ipl */ |
109 | 100 | float_status fp_status; |
110 | 101 | qemu_irq ack; /* Interrupt acknowledge */ |
111 | - | |
112 | - CPU_COMMON | |
113 | 102 | } CPURXState; |
114 | 103 | |
115 | 104 | /* |
@@ -123,19 +112,13 @@ struct RXCPU { | ||
123 | 112 | CPUState parent_obj; |
124 | 113 | /*< public >*/ |
125 | 114 | |
115 | + CPUNegativeOffsetState neg; | |
126 | 116 | CPURXState env; |
127 | 117 | }; |
128 | 118 | |
129 | 119 | typedef struct RXCPU RXCPU; |
130 | 120 | typedef RXCPU ArchCPU; |
131 | 121 | |
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 | - | |
139 | 122 | #define ENV_OFFSET offsetof(RXCPU, env) |
140 | 123 | |
141 | 124 | #define RX_CPU_TYPE_SUFFIX "-" TYPE_RX_CPU |
@@ -156,8 +139,6 @@ int cpu_rx_signal_handler(int host_signum, void *pinfo, | ||
156 | 139 | void *puc); |
157 | 140 | |
158 | 141 | void rx_cpu_list(void); |
159 | -void rx_load_image(RXCPU *cpu, const char *filename, | |
160 | - uint32_t start, uint32_t size); | |
161 | 142 | void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte); |
162 | 143 | |
163 | 144 | #define cpu_signal_handler cpu_rx_signal_handler |
@@ -421,7 +421,7 @@ uint32_t helper_divu(CPURXState *env, uint32_t num, uint32_t den) | ||
421 | 421 | static inline void QEMU_NORETURN raise_exception(CPURXState *env, int index, |
422 | 422 | uintptr_t retaddr) |
423 | 423 | { |
424 | - CPUState *cs = CPU(rx_env_get_cpu(env)); | |
424 | + CPUState *cs = env_cpu(env); | |
425 | 425 | |
426 | 426 | cs->exception_index = index; |
427 | 427 | cpu_loop_exit_restore(cs, retaddr); |
@@ -444,7 +444,7 @@ void QEMU_NORETURN helper_raise_illegal_instruction(CPURXState *env) | ||
444 | 444 | |
445 | 445 | void QEMU_NORETURN helper_wait(CPURXState *env) |
446 | 446 | { |
447 | - CPUState *cs = CPU(rx_env_get_cpu(env)); | |
447 | + CPUState *cs = env_cpu(env); | |
448 | 448 | |
449 | 449 | cs->halted = 1; |
450 | 450 | env->in_sleep = 1; |
@@ -453,7 +453,7 @@ void QEMU_NORETURN helper_wait(CPURXState *env) | ||
453 | 453 | |
454 | 454 | void QEMU_NORETURN helper_debug(CPURXState *env) |
455 | 455 | { |
456 | - CPUState *cs = CPU(rx_env_get_cpu(env)); | |
456 | + CPUState *cs = env_cpu(env); | |
457 | 457 | |
458 | 458 | cs->exception_index = EXCP_DEBUG; |
459 | 459 | cpu_loop_exit(cs); |