提交 33276f1b 编写于 作者: A Andreas Färber

target-ppc: Clean up ENV_GET_CPU() usage

Commits fdfba1a2,
ab1da857,
f606604f and
2c17449b added usages of ENV_GET_CPU()
macro in target-specific code.

Use ppc_env_get_cpu() instead.

Cc: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 19d6ca16
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
ram_addr_t ppc405_set_bootinfo (CPUPPCState *env, ppc4xx_bd_info_t *bd, ram_addr_t ppc405_set_bootinfo (CPUPPCState *env, ppc4xx_bd_info_t *bd,
uint32_t flags) uint32_t flags)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
ram_addr_t bdloc; ram_addr_t bdloc;
int i, n; int i, n;
......
...@@ -356,7 +356,7 @@ static target_ulong h_set_dabr(PowerPCCPU *cpu, sPAPREnvironment *spapr, ...@@ -356,7 +356,7 @@ static target_ulong h_set_dabr(PowerPCCPU *cpu, sPAPREnvironment *spapr,
static target_ulong register_vpa(CPUPPCState *env, target_ulong vpa) static target_ulong register_vpa(CPUPPCState *env, target_ulong vpa)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
uint16_t size; uint16_t size;
uint8_t tmp; uint8_t tmp;
...@@ -406,7 +406,7 @@ static target_ulong deregister_vpa(CPUPPCState *env, target_ulong vpa) ...@@ -406,7 +406,7 @@ static target_ulong deregister_vpa(CPUPPCState *env, target_ulong vpa)
static target_ulong register_slb_shadow(CPUPPCState *env, target_ulong addr) static target_ulong register_slb_shadow(CPUPPCState *env, target_ulong addr)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
uint32_t size; uint32_t size;
if (addr == 0) { if (addr == 0) {
...@@ -442,7 +442,7 @@ static target_ulong deregister_slb_shadow(CPUPPCState *env, target_ulong addr) ...@@ -442,7 +442,7 @@ static target_ulong deregister_slb_shadow(CPUPPCState *env, target_ulong addr)
static target_ulong register_dtl(CPUPPCState *env, target_ulong addr) static target_ulong register_dtl(CPUPPCState *env, target_ulong addr)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
uint32_t size; uint32_t size;
if (addr == 0) { if (addr == 0) {
......
...@@ -68,7 +68,8 @@ int ppc_hash32_handle_mmu_fault(CPUPPCState *env, target_ulong address, int rw, ...@@ -68,7 +68,8 @@ int ppc_hash32_handle_mmu_fault(CPUPPCState *env, target_ulong address, int rw,
static inline target_ulong ppc_hash32_load_hpte0(CPUPPCState *env, static inline target_ulong ppc_hash32_load_hpte0(CPUPPCState *env,
hwaddr pte_offset) hwaddr pte_offset)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
assert(!env->external_htab); /* Not supported on 32-bit for now */ assert(!env->external_htab); /* Not supported on 32-bit for now */
return ldl_phys(cs->as, env->htab_base + pte_offset); return ldl_phys(cs->as, env->htab_base + pte_offset);
} }
...@@ -76,7 +77,8 @@ static inline target_ulong ppc_hash32_load_hpte0(CPUPPCState *env, ...@@ -76,7 +77,8 @@ static inline target_ulong ppc_hash32_load_hpte0(CPUPPCState *env,
static inline target_ulong ppc_hash32_load_hpte1(CPUPPCState *env, static inline target_ulong ppc_hash32_load_hpte1(CPUPPCState *env,
hwaddr pte_offset) hwaddr pte_offset)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
assert(!env->external_htab); /* Not supported on 32-bit for now */ assert(!env->external_htab); /* Not supported on 32-bit for now */
return ldl_phys(cs->as, env->htab_base + pte_offset + HASH_PTE_SIZE_32/2); return ldl_phys(cs->as, env->htab_base + pte_offset + HASH_PTE_SIZE_32/2);
} }
...@@ -84,7 +86,8 @@ static inline target_ulong ppc_hash32_load_hpte1(CPUPPCState *env, ...@@ -84,7 +86,8 @@ static inline target_ulong ppc_hash32_load_hpte1(CPUPPCState *env,
static inline void ppc_hash32_store_hpte0(CPUPPCState *env, static inline void ppc_hash32_store_hpte0(CPUPPCState *env,
hwaddr pte_offset, target_ulong pte0) hwaddr pte_offset, target_ulong pte0)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
assert(!env->external_htab); /* Not supported on 32-bit for now */ assert(!env->external_htab); /* Not supported on 32-bit for now */
stl_phys(cs->as, env->htab_base + pte_offset, pte0); stl_phys(cs->as, env->htab_base + pte_offset, pte0);
} }
...@@ -92,7 +95,8 @@ static inline void ppc_hash32_store_hpte0(CPUPPCState *env, ...@@ -92,7 +95,8 @@ static inline void ppc_hash32_store_hpte0(CPUPPCState *env,
static inline void ppc_hash32_store_hpte1(CPUPPCState *env, static inline void ppc_hash32_store_hpte1(CPUPPCState *env,
hwaddr pte_offset, target_ulong pte1) hwaddr pte_offset, target_ulong pte1)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
assert(!env->external_htab); /* Not supported on 32-bit for now */ assert(!env->external_htab); /* Not supported on 32-bit for now */
stl_phys(cs->as, env->htab_base + pte_offset + HASH_PTE_SIZE_32/2, pte1); stl_phys(cs->as, env->htab_base + pte_offset + HASH_PTE_SIZE_32/2, pte1);
} }
......
...@@ -608,7 +608,7 @@ void ppc_hash64_store_hpte(CPUPPCState *env, ...@@ -608,7 +608,7 @@ void ppc_hash64_store_hpte(CPUPPCState *env,
target_ulong pte_index, target_ulong pte_index,
target_ulong pte0, target_ulong pte1) target_ulong pte0, target_ulong pte1)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
if (kvmppc_kern_htab) { if (kvmppc_kern_htab) {
return kvmppc_hash64_write_pte(env, pte_index, pte0, pte1); return kvmppc_hash64_write_pte(env, pte_index, pte0, pte1);
......
...@@ -85,8 +85,9 @@ void ppc_hash64_stop_access(uint64_t token); ...@@ -85,8 +85,9 @@ void ppc_hash64_stop_access(uint64_t token);
static inline target_ulong ppc_hash64_load_hpte0(CPUPPCState *env, static inline target_ulong ppc_hash64_load_hpte0(CPUPPCState *env,
uint64_t token, int index) uint64_t token, int index)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
uint64_t addr; uint64_t addr;
addr = token + (index * HASH_PTE_SIZE_64); addr = token + (index * HASH_PTE_SIZE_64);
if (env->external_htab) { if (env->external_htab) {
return ldq_p((const void *)(uintptr_t)addr); return ldq_p((const void *)(uintptr_t)addr);
...@@ -98,8 +99,9 @@ static inline target_ulong ppc_hash64_load_hpte0(CPUPPCState *env, ...@@ -98,8 +99,9 @@ static inline target_ulong ppc_hash64_load_hpte0(CPUPPCState *env,
static inline target_ulong ppc_hash64_load_hpte1(CPUPPCState *env, static inline target_ulong ppc_hash64_load_hpte1(CPUPPCState *env,
uint64_t token, int index) uint64_t token, int index)
{ {
CPUState *cs = ENV_GET_CPU(env); CPUState *cs = CPU(ppc_env_get_cpu(env));
uint64_t addr; uint64_t addr;
addr = token + (index * HASH_PTE_SIZE_64) + HASH_PTE_SIZE_64/2; addr = token + (index * HASH_PTE_SIZE_64) + HASH_PTE_SIZE_64/2;
if (env->external_htab) { if (env->external_htab) {
return ldq_p((const void *)(uintptr_t)addr); return ldq_p((const void *)(uintptr_t)addr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册