Hexagon (target/hexagon) use env_archcpu and env_cpu

Remove hexagon_env_get_cpu and replace with env_archcpu
Replace CPU(hexagon_env_get_cpu(env)) with env_cpu(env)

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <1617930474-31979-5-git-send-email-tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Taylor Simpson 2021-04-08 20:07:32 -05:00 committed by Richard Henderson
parent 2d27cebbf8
commit 7d9ab2021f
5 changed files with 5 additions and 10 deletions

View File

@ -25,7 +25,7 @@
void cpu_loop(CPUHexagonState *env) void cpu_loop(CPUHexagonState *env)
{ {
CPUState *cs = CPU(hexagon_env_get_cpu(env)); CPUState *cs = env_cpu(env);
int trapnr, signum, sigcode; int trapnr, signum, sigcode;
target_ulong sigaddr; target_ulong sigaddr;
target_ulong syscallnum; target_ulong syscallnum;

View File

@ -71,7 +71,7 @@ const char * const hexagon_regnames[TOTAL_PER_THREAD_REGS] = {
*/ */
static target_ulong adjust_stack_ptrs(CPUHexagonState *env, target_ulong addr) static target_ulong adjust_stack_ptrs(CPUHexagonState *env, target_ulong addr)
{ {
HexagonCPU *cpu = hexagon_env_get_cpu(env); HexagonCPU *cpu = env_archcpu(env);
target_ulong stack_adjust = cpu->lldb_stack_adjust; target_ulong stack_adjust = cpu->lldb_stack_adjust;
target_ulong stack_start = env->stack_start; target_ulong stack_start = env->stack_start;
target_ulong stack_size = 0x10000; target_ulong stack_size = 0x10000;
@ -115,7 +115,7 @@ static void print_reg(FILE *f, CPUHexagonState *env, int regnum)
static void hexagon_dump(CPUHexagonState *env, FILE *f) static void hexagon_dump(CPUHexagonState *env, FILE *f)
{ {
HexagonCPU *cpu = hexagon_env_get_cpu(env); HexagonCPU *cpu = env_archcpu(env);
if (cpu->lldb_compat) { if (cpu->lldb_compat) {
/* /*

View File

@ -127,11 +127,6 @@ typedef struct HexagonCPU {
target_ulong lldb_stack_adjust; target_ulong lldb_stack_adjust;
} HexagonCPU; } HexagonCPU;
static inline HexagonCPU *hexagon_env_get_cpu(CPUHexagonState *env)
{
return container_of(env, HexagonCPU, env);
}
#include "cpu_bits.h" #include "cpu_bits.h"
#define cpu_signal_handler cpu_hexagon_signal_handler #define cpu_signal_handler cpu_hexagon_signal_handler

View File

@ -35,7 +35,7 @@ static void QEMU_NORETURN do_raise_exception_err(CPUHexagonState *env,
uint32_t exception, uint32_t exception,
uintptr_t pc) uintptr_t pc)
{ {
CPUState *cs = CPU(hexagon_env_get_cpu(env)); CPUState *cs = env_cpu(env);
qemu_log_mask(CPU_LOG_INT, "%s: %d\n", __func__, exception); qemu_log_mask(CPU_LOG_INT, "%s: %d\n", __func__, exception);
cs->exception_index = exception; cs->exception_index = exception;
cpu_loop_exit_restore(cs, pc); cpu_loop_exit_restore(cs, pc);

View File

@ -585,7 +585,7 @@ static void hexagon_tr_translate_packet(DisasContextBase *dcbase, CPUState *cpu)
* The CPU log is used to compare against LLDB single stepping, * The CPU log is used to compare against LLDB single stepping,
* so end the TLB after every packet. * so end the TLB after every packet.
*/ */
HexagonCPU *hex_cpu = hexagon_env_get_cpu(env); HexagonCPU *hex_cpu = env_archcpu(env);
if (hex_cpu->lldb_compat && qemu_loglevel_mask(CPU_LOG_TB_CPU)) { if (hex_cpu->lldb_compat && qemu_loglevel_mask(CPU_LOG_TB_CPU)) {
ctx->base.is_jmp = DISAS_TOO_MANY; ctx->base.is_jmp = DISAS_TOO_MANY;
} }