[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-4.1 v2 18/36] target/nios2: Use env_cpu, env_arc
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH for-4.1 v2 18/36] target/nios2: Use env_cpu, env_archcpu |
Date: |
Thu, 28 Mar 2019 13:03:46 -1000 |
Signed-off-by: Richard Henderson <address@hidden>
---
target/nios2/cpu.h | 5 -----
hw/nios2/cpu_pic.c | 5 +----
target/nios2/mmu.c | 10 +++++-----
3 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
index e0e12a910e..3fc27ead81 100644
--- a/target/nios2/cpu.h
+++ b/target/nios2/cpu.h
@@ -193,11 +193,6 @@ typedef struct Nios2CPU {
uint32_t fast_tlb_miss_addr;
} Nios2CPU;
-static inline Nios2CPU *nios2_env_get_cpu(CPUNios2State *env)
-{
- return NIOS2_CPU(container_of(env, Nios2CPU, env));
-}
-
#define ENV_OFFSET offsetof(Nios2CPU, env)
void nios2_tcg_init(void);
diff --git a/hw/nios2/cpu_pic.c b/hw/nios2/cpu_pic.c
index 6bccce2f32..9e39955bd1 100644
--- a/hw/nios2/cpu_pic.c
+++ b/hw/nios2/cpu_pic.c
@@ -54,12 +54,9 @@ static void nios2_pic_cpu_handler(void *opaque, int irq, int
level)
void nios2_check_interrupts(CPUNios2State *env)
{
- Nios2CPU *cpu = nios2_env_get_cpu(env);
- CPUState *cs = CPU(cpu);
-
if (env->irq_pending) {
env->irq_pending = 0;
- cpu_interrupt(cs, CPU_INTERRUPT_HARD);
+ cpu_interrupt(env_cpu(env), CPU_INTERRUPT_HARD);
}
}
diff --git a/target/nios2/mmu.c b/target/nios2/mmu.c
index 0752699e25..173da3becc 100644
--- a/target/nios2/mmu.c
+++ b/target/nios2/mmu.c
@@ -72,7 +72,7 @@ unsigned int mmu_translate(CPUNios2State *env,
Nios2MMULookup *lu,
target_ulong vaddr, int rw, int mmu_idx)
{
- Nios2CPU *cpu = nios2_env_get_cpu(env);
+ Nios2CPU *cpu = env_archcpu(env);
int pid = (env->mmu.tlbmisc_wr & CR_TLBMISC_PID_MASK) >> 4;
int vpn = vaddr >> 12;
@@ -114,7 +114,7 @@ unsigned int mmu_translate(CPUNios2State *env,
static void mmu_flush_pid(CPUNios2State *env, uint32_t pid)
{
CPUState *cs = env_cpu(env);
- Nios2CPU *cpu = nios2_env_get_cpu(env);
+ Nios2CPU *cpu = env_archcpu(env);
int idx;
MMU_LOG(qemu_log("TLB Flush PID %d\n", pid));
@@ -138,7 +138,7 @@ static void mmu_flush_pid(CPUNios2State *env, uint32_t pid)
void mmu_write(CPUNios2State *env, uint32_t rn, uint32_t v)
{
CPUState *cs = env_cpu(env);
- Nios2CPU *cpu = nios2_env_get_cpu(env);
+ Nios2CPU *cpu = env_archcpu(env);
MMU_LOG(qemu_log("mmu_write %08X = %08X\n", rn, v));
@@ -255,7 +255,7 @@ void mmu_write(CPUNios2State *env, uint32_t rn, uint32_t v)
void mmu_init(CPUNios2State *env)
{
- Nios2CPU *cpu = nios2_env_get_cpu(env);
+ Nios2CPU *cpu = env_archcpu(env);
Nios2MMU *mmu = &env->mmu;
MMU_LOG(qemu_log("mmu_init\n"));
@@ -266,7 +266,7 @@ void mmu_init(CPUNios2State *env)
void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUNios2State *env)
{
- Nios2CPU *cpu = nios2_env_get_cpu(env);
+ Nios2CPU *cpu = env_archcpu(env);
int i;
cpu_fprintf(f, "MMU: ways %d, entries %d, pid bits %d\n",
--
2.17.1
- [Qemu-devel] [PATCH for-4.1 v2 33/36] cpu: Move the softmmu tlb to CPUNegativeOffsetState, (continued)
- [Qemu-devel] [PATCH for-4.1 v2 33/36] cpu: Move the softmmu tlb to CPUNegativeOffsetState, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 30/36] cpu: Introduce cpu_set_cpustate_pointers, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 34/36] cpu: Remove CPU_COMMON, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 35/36] tcg/aarch64: Use LDP to load tlb mask+table, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 36/36] tcg/arm: Use LDRD to load tlb mask+table, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 29/36] cpu: Move ENV_OFFSET to exec/gen-icount.h, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 24/36] target/sparc: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 23/36] target/sh4: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 19/36] target/openrisc: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 28/36] target/xtensa: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 18/36] target/nios2: Use env_cpu, env_archcpu,
Richard Henderson <=
- [Qemu-devel] [PATCH for-4.1 v2 31/36] cpu: Introduce CPUNegativeOffsetState, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 26/36] target/tricore: Use env_cpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 32/36] cpu: Move icount_decr to CPUNegativeOffsetState, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 21/36] target/riscv: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 22/36] target/s390x: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 17/36] target/moxie: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 20/36] target/ppc: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 14/36] target/m68k: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28
- [Qemu-devel] [PATCH for-4.1 v2 13/36] target/lm32: Use env_cpu, env_archcpu, Richard Henderson, 2019/03/28