mirror of https://github.com/xqemu/xqemu.git
Use uintptr_t for various op related functions
Use uintptr_t instead of void * or unsigned long in several op related functions, env->mem_io_pc and GETPC() macro. Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
d1b719e98c
commit
2050396801
|
@ -166,7 +166,7 @@ typedef struct CPUWatchpoint {
|
||||||
/* in order to avoid passing too many arguments to the MMIO \
|
/* in order to avoid passing too many arguments to the MMIO \
|
||||||
helpers, we store some rarely used information in the CPU \
|
helpers, we store some rarely used information in the CPU \
|
||||||
context) */ \
|
context) */ \
|
||||||
unsigned long mem_io_pc; /* host pc at which the memory was \
|
uintptr_t mem_io_pc; /* host pc at which the memory was \
|
||||||
accessed */ \
|
accessed */ \
|
||||||
target_ulong mem_io_vaddr; /* target virtual addr at which the \
|
target_ulong mem_io_vaddr; /* target virtual addr at which the \
|
||||||
memory was accessed */ \
|
memory was accessed */ \
|
||||||
|
|
10
exec-all.h
10
exec-all.h
|
@ -87,7 +87,7 @@ int cpu_gen_code(CPUArchState *env, struct TranslationBlock *tb,
|
||||||
int cpu_restore_state(struct TranslationBlock *tb,
|
int cpu_restore_state(struct TranslationBlock *tb,
|
||||||
CPUArchState *env, uintptr_t searched_pc);
|
CPUArchState *env, uintptr_t searched_pc);
|
||||||
void QEMU_NORETURN cpu_resume_from_signal(CPUArchState *env1, void *puc);
|
void QEMU_NORETURN cpu_resume_from_signal(CPUArchState *env1, void *puc);
|
||||||
void QEMU_NORETURN cpu_io_recompile(CPUArchState *env, void *retaddr);
|
void QEMU_NORETURN cpu_io_recompile(CPUArchState *env, uintptr_t retaddr);
|
||||||
TranslationBlock *tb_gen_code(CPUArchState *env,
|
TranslationBlock *tb_gen_code(CPUArchState *env,
|
||||||
target_ulong pc, target_ulong cs_base, int flags,
|
target_ulong pc, target_ulong cs_base, int flags,
|
||||||
int cflags);
|
int cflags);
|
||||||
|
@ -287,13 +287,13 @@ extern void *tci_tb_ptr;
|
||||||
# endif
|
# endif
|
||||||
#elif defined(__s390__) && !defined(__s390x__)
|
#elif defined(__s390__) && !defined(__s390x__)
|
||||||
# define GETPC() \
|
# define GETPC() \
|
||||||
((void *)(((uintptr_t)__builtin_return_address(0) & 0x7fffffffUL) - 1))
|
(((uintptr_t)__builtin_return_address(0) & 0x7fffffffUL) - 1)
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__)
|
||||||
/* Thumb return addresses have the low bit set, so we need to subtract two.
|
/* Thumb return addresses have the low bit set, so we need to subtract two.
|
||||||
This is still safe in ARM mode because instructions are 4 bytes. */
|
This is still safe in ARM mode because instructions are 4 bytes. */
|
||||||
# define GETPC() ((void *)((uintptr_t)__builtin_return_address(0) - 2))
|
# define GETPC() ((uintptr_t)__builtin_return_address(0) - 2)
|
||||||
#else
|
#else
|
||||||
# define GETPC() ((void *)((uintptr_t)__builtin_return_address(0) - 1))
|
# define GETPC() ((uintptr_t)__builtin_return_address(0) - 1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
|
@ -305,7 +305,7 @@ void io_mem_write(struct MemoryRegion *mr, target_phys_addr_t addr,
|
||||||
uint64_t value, unsigned size);
|
uint64_t value, unsigned size);
|
||||||
|
|
||||||
void tlb_fill(CPUArchState *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUArchState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr);
|
uintptr_t retaddr);
|
||||||
|
|
||||||
#include "softmmu_defs.h"
|
#include "softmmu_defs.h"
|
||||||
|
|
||||||
|
|
12
exec.c
12
exec.c
|
@ -1221,7 +1221,7 @@ static inline void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len)
|
||||||
|
|
||||||
#if !defined(CONFIG_SOFTMMU)
|
#if !defined(CONFIG_SOFTMMU)
|
||||||
static void tb_invalidate_phys_page(tb_page_addr_t addr,
|
static void tb_invalidate_phys_page(tb_page_addr_t addr,
|
||||||
unsigned long pc, void *puc)
|
uintptr_t pc, void *puc)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
PageDesc *p;
|
PageDesc *p;
|
||||||
|
@ -4477,20 +4477,20 @@ int cpu_memory_rw_debug(CPUArchState *env, target_ulong addr,
|
||||||
|
|
||||||
/* in deterministic execution mode, instructions doing device I/Os
|
/* in deterministic execution mode, instructions doing device I/Os
|
||||||
must be at the end of the TB */
|
must be at the end of the TB */
|
||||||
void cpu_io_recompile(CPUArchState *env, void *retaddr)
|
void cpu_io_recompile(CPUArchState *env, uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
uint32_t n, cflags;
|
uint32_t n, cflags;
|
||||||
target_ulong pc, cs_base;
|
target_ulong pc, cs_base;
|
||||||
uint64_t flags;
|
uint64_t flags;
|
||||||
|
|
||||||
tb = tb_find_pc((uintptr_t)retaddr);
|
tb = tb_find_pc(retaddr);
|
||||||
if (!tb) {
|
if (!tb) {
|
||||||
cpu_abort(env, "cpu_io_recompile: could not find TB for pc=%p",
|
cpu_abort(env, "cpu_io_recompile: could not find TB for pc=%p",
|
||||||
retaddr);
|
(void *)retaddr);
|
||||||
}
|
}
|
||||||
n = env->icount_decr.u16.low + tb->icount;
|
n = env->icount_decr.u16.low + tb->icount;
|
||||||
cpu_restore_state(tb, env, (unsigned long)retaddr);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
/* Calculate how many instructions had been executed before the fault
|
/* Calculate how many instructions had been executed before the fault
|
||||||
occurred. */
|
occurred. */
|
||||||
n = n - env->icount_decr.u16.low;
|
n = n - env->icount_decr.u16.low;
|
||||||
|
@ -4638,7 +4638,7 @@ bool virtio_is_big_endian(void)
|
||||||
|
|
||||||
#define MMUSUFFIX _cmmu
|
#define MMUSUFFIX _cmmu
|
||||||
#undef GETPC
|
#undef GETPC
|
||||||
#define GETPC() NULL
|
#define GETPC() ((uintptr_t)0)
|
||||||
#define env cpu_single_env
|
#define env cpu_single_env
|
||||||
#define SOFTMMU_CODE_ACCESS
|
#define SOFTMMU_CODE_ACCESS
|
||||||
|
|
||||||
|
|
|
@ -69,17 +69,17 @@
|
||||||
static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(ENV_PARAM
|
static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(ENV_PARAM
|
||||||
target_ulong addr,
|
target_ulong addr,
|
||||||
int mmu_idx,
|
int mmu_idx,
|
||||||
void *retaddr);
|
uintptr_t retaddr);
|
||||||
static inline DATA_TYPE glue(io_read, SUFFIX)(ENV_PARAM
|
static inline DATA_TYPE glue(io_read, SUFFIX)(ENV_PARAM
|
||||||
target_phys_addr_t physaddr,
|
target_phys_addr_t physaddr,
|
||||||
target_ulong addr,
|
target_ulong addr,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
DATA_TYPE res;
|
DATA_TYPE res;
|
||||||
MemoryRegion *mr = iotlb_to_region(physaddr);
|
MemoryRegion *mr = iotlb_to_region(physaddr);
|
||||||
|
|
||||||
physaddr = (physaddr & TARGET_PAGE_MASK) + addr;
|
physaddr = (physaddr & TARGET_PAGE_MASK) + addr;
|
||||||
env->mem_io_pc = (unsigned long)retaddr;
|
env->mem_io_pc = retaddr;
|
||||||
if (mr != &io_mem_ram && mr != &io_mem_rom
|
if (mr != &io_mem_ram && mr != &io_mem_rom
|
||||||
&& mr != &io_mem_unassigned
|
&& mr != &io_mem_unassigned
|
||||||
&& mr != &io_mem_notdirty
|
&& mr != &io_mem_notdirty
|
||||||
|
@ -113,7 +113,7 @@ glue(glue(glue(HELPER_PREFIX, ld), SUFFIX), MMUSUFFIX)(ENV_PARAM
|
||||||
target_ulong tlb_addr;
|
target_ulong tlb_addr;
|
||||||
target_phys_addr_t ioaddr;
|
target_phys_addr_t ioaddr;
|
||||||
unsigned long addend;
|
unsigned long addend;
|
||||||
void *retaddr;
|
uintptr_t retaddr;
|
||||||
|
|
||||||
/* test if there is match for unaligned or IO access */
|
/* test if there is match for unaligned or IO access */
|
||||||
/* XXX: could done more in memory macro in a non portable way */
|
/* XXX: could done more in memory macro in a non portable way */
|
||||||
|
@ -166,7 +166,7 @@ static DATA_TYPE
|
||||||
glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(ENV_PARAM
|
glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(ENV_PARAM
|
||||||
target_ulong addr,
|
target_ulong addr,
|
||||||
int mmu_idx,
|
int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
DATA_TYPE res, res1, res2;
|
DATA_TYPE res, res1, res2;
|
||||||
int index, shift;
|
int index, shift;
|
||||||
|
@ -219,13 +219,13 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(ENV_PARAM
|
||||||
target_ulong addr,
|
target_ulong addr,
|
||||||
DATA_TYPE val,
|
DATA_TYPE val,
|
||||||
int mmu_idx,
|
int mmu_idx,
|
||||||
void *retaddr);
|
uintptr_t retaddr);
|
||||||
|
|
||||||
static inline void glue(io_write, SUFFIX)(ENV_PARAM
|
static inline void glue(io_write, SUFFIX)(ENV_PARAM
|
||||||
target_phys_addr_t physaddr,
|
target_phys_addr_t physaddr,
|
||||||
DATA_TYPE val,
|
DATA_TYPE val,
|
||||||
target_ulong addr,
|
target_ulong addr,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
MemoryRegion *mr = iotlb_to_region(physaddr);
|
MemoryRegion *mr = iotlb_to_region(physaddr);
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ static inline void glue(io_write, SUFFIX)(ENV_PARAM
|
||||||
}
|
}
|
||||||
|
|
||||||
env->mem_io_vaddr = addr;
|
env->mem_io_vaddr = addr;
|
||||||
env->mem_io_pc = (unsigned long)retaddr;
|
env->mem_io_pc = retaddr;
|
||||||
#if SHIFT <= 2
|
#if SHIFT <= 2
|
||||||
io_mem_write(mr, physaddr, val, 1 << SHIFT);
|
io_mem_write(mr, physaddr, val, 1 << SHIFT);
|
||||||
#else
|
#else
|
||||||
|
@ -260,7 +260,7 @@ void glue(glue(glue(HELPER_PREFIX, st), SUFFIX), MMUSUFFIX)(ENV_PARAM
|
||||||
target_phys_addr_t ioaddr;
|
target_phys_addr_t ioaddr;
|
||||||
unsigned long addend;
|
unsigned long addend;
|
||||||
target_ulong tlb_addr;
|
target_ulong tlb_addr;
|
||||||
void *retaddr;
|
uintptr_t retaddr;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
|
index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
|
||||||
|
@ -310,7 +310,7 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(ENV_PARAM
|
||||||
target_ulong addr,
|
target_ulong addr,
|
||||||
DATA_TYPE val,
|
DATA_TYPE val,
|
||||||
int mmu_idx,
|
int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
target_phys_addr_t ioaddr;
|
target_phys_addr_t ioaddr;
|
||||||
unsigned long addend;
|
unsigned long addend;
|
||||||
|
|
|
@ -433,9 +433,9 @@ int cpu_alpha_handle_mmu_fault (CPUAlphaState *env, uint64_t address, int rw,
|
||||||
int mmu_idx);
|
int mmu_idx);
|
||||||
#define cpu_handle_mmu_fault cpu_alpha_handle_mmu_fault
|
#define cpu_handle_mmu_fault cpu_alpha_handle_mmu_fault
|
||||||
void do_interrupt (CPUAlphaState *env);
|
void do_interrupt (CPUAlphaState *env);
|
||||||
void do_restore_state(CPUAlphaState *, void *retaddr);
|
void do_restore_state(CPUAlphaState *, uintptr_t retaddr);
|
||||||
void QEMU_NORETURN dynamic_excp(CPUAlphaState *, void *, int, int);
|
void QEMU_NORETURN dynamic_excp(CPUAlphaState *, uintptr_t, int, int);
|
||||||
void QEMU_NORETURN arith_excp(CPUAlphaState *, void *, int, uint64_t);
|
void QEMU_NORETURN arith_excp(CPUAlphaState *, uintptr_t, int, uint64_t);
|
||||||
|
|
||||||
uint64_t cpu_alpha_load_fpcr (CPUAlphaState *env);
|
uint64_t cpu_alpha_load_fpcr (CPUAlphaState *env);
|
||||||
void cpu_alpha_store_fpcr (CPUAlphaState *env, uint64_t val);
|
void cpu_alpha_store_fpcr (CPUAlphaState *env, uint64_t val);
|
||||||
|
|
|
@ -44,7 +44,7 @@ uint32_t helper_fp_exc_get(CPUAlphaState *env)
|
||||||
return get_float_exception_flags(&FP_STATUS);
|
return get_float_exception_flags(&FP_STATUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void inline_fp_exc_raise(CPUAlphaState *env, void *retaddr,
|
static inline void inline_fp_exc_raise(CPUAlphaState *env, uintptr_t retaddr,
|
||||||
uint32_t exc, uint32_t regno)
|
uint32_t exc, uint32_t regno)
|
||||||
{
|
{
|
||||||
if (exc) {
|
if (exc) {
|
||||||
|
@ -160,7 +160,7 @@ static uint64_t float32_to_f(float32 fa)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static float32 f_to_float32(CPUAlphaState *env, void *retaddr, uint64_t a)
|
static float32 f_to_float32(CPUAlphaState *env, uintptr_t retaddr, uint64_t a)
|
||||||
{
|
{
|
||||||
uint32_t exp, mant_sig;
|
uint32_t exp, mant_sig;
|
||||||
CPU_FloatU r;
|
CPU_FloatU r;
|
||||||
|
@ -291,7 +291,7 @@ static uint64_t float64_to_g(float64 fa)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static float64 g_to_float64(CPUAlphaState *env, void *retaddr, uint64_t a)
|
static float64 g_to_float64(CPUAlphaState *env, uintptr_t retaddr, uint64_t a)
|
||||||
{
|
{
|
||||||
uint64_t exp, mant_sig;
|
uint64_t exp, mant_sig;
|
||||||
CPU_DoubleU r;
|
CPU_DoubleU r;
|
||||||
|
|
|
@ -494,13 +494,12 @@ void cpu_dump_state (CPUAlphaState *env, FILE *f, fprintf_function cpu_fprintf,
|
||||||
cpu_fprintf(f, "\n");
|
cpu_fprintf(f, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_restore_state(CPUAlphaState *env, void *retaddr)
|
void do_restore_state(CPUAlphaState *env, uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
uintptr_t pc = (uintptr_t)retaddr;
|
if (retaddr) {
|
||||||
if (pc) {
|
TranslationBlock *tb = tb_find_pc(retaddr);
|
||||||
TranslationBlock *tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -515,7 +514,7 @@ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int excp, int error)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This may be called from any of the helpers to set up EXCEPTION_INDEX. */
|
/* This may be called from any of the helpers to set up EXCEPTION_INDEX. */
|
||||||
void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, void *retaddr,
|
void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uintptr_t retaddr,
|
||||||
int excp, int error)
|
int excp, int error)
|
||||||
{
|
{
|
||||||
env->exception_index = excp;
|
env->exception_index = excp;
|
||||||
|
@ -524,7 +523,7 @@ void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, void *retaddr,
|
||||||
cpu_loop_exit(env);
|
cpu_loop_exit(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEMU_NORETURN arith_excp(CPUAlphaState *env, void *retaddr,
|
void QEMU_NORETURN arith_excp(CPUAlphaState *env, uintptr_t retaddr,
|
||||||
int exc, uint64_t mask)
|
int exc, uint64_t mask)
|
||||||
{
|
{
|
||||||
env->trap_arg0 = exc;
|
env->trap_arg0 = exc;
|
||||||
|
|
|
@ -89,7 +89,7 @@ uint64_t helper_stq_c_phys(CPUAlphaState *env, uint64_t p, uint64_t v)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_unaligned_access(CPUAlphaState *env, target_ulong addr,
|
static void do_unaligned_access(CPUAlphaState *env, target_ulong addr,
|
||||||
int is_write, int is_user, void *retaddr)
|
int is_write, int is_user, uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
uint64_t pc;
|
uint64_t pc;
|
||||||
uint32_t insn;
|
uint32_t insn;
|
||||||
|
@ -112,7 +112,7 @@ void cpu_unassigned_access(CPUAlphaState *env, target_phys_addr_t addr,
|
||||||
{
|
{
|
||||||
env->trap_arg0 = addr;
|
env->trap_arg0 = addr;
|
||||||
env->trap_arg1 = is_write;
|
env->trap_arg1 = is_write;
|
||||||
dynamic_excp(env, NULL, EXCP_MCHK, 0);
|
dynamic_excp(env, 0, EXCP_MCHK, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "softmmu_exec.h"
|
#include "softmmu_exec.h"
|
||||||
|
@ -137,7 +137,7 @@ void cpu_unassigned_access(CPUAlphaState *env, target_phys_addr_t addr,
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPUAlphaState *env, target_ulong addr, int is_write,
|
void tlb_fill(CPUAlphaState *env, target_ulong addr, int is_write,
|
||||||
int mmu_idx, void *retaddr)
|
int mmu_idx, uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
|
@ -76,11 +76,10 @@ uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def,
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPUARMState *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUARMState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
CPUARMState *saved_env;
|
CPUARMState *saved_env;
|
||||||
unsigned long pc;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
saved_env = env;
|
saved_env = env;
|
||||||
|
@ -89,12 +88,11 @@ void tlb_fill(CPUARMState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
if (unlikely(ret)) {
|
if (unlikely(ret)) {
|
||||||
if (retaddr) {
|
if (retaddr) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
raise_exception(env->exception_index);
|
raise_exception(env->exception_index);
|
||||||
|
|
|
@ -57,28 +57,26 @@
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPUCRISState *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUCRISState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
CPUCRISState *saved_env;
|
CPUCRISState *saved_env;
|
||||||
unsigned long pc;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
saved_env = env;
|
saved_env = env;
|
||||||
env = env1;
|
env = env1;
|
||||||
|
|
||||||
D_LOG("%s pc=%x tpc=%x ra=%x\n", __func__,
|
D_LOG("%s pc=%x tpc=%x ra=%p\n", __func__,
|
||||||
env->pc, env->debug1, retaddr);
|
env->pc, env->debug1, (void *)retaddr);
|
||||||
ret = cpu_cris_handle_mmu_fault(env, addr, is_write, mmu_idx);
|
ret = cpu_cris_handle_mmu_fault(env, addr, is_write, mmu_idx);
|
||||||
if (unlikely(ret)) {
|
if (unlikely(ret)) {
|
||||||
if (retaddr) {
|
if (retaddr) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
|
|
||||||
/* Evaluate flags after retranslation. */
|
/* Evaluate flags after retranslation. */
|
||||||
helper_top_evaluate_flags();
|
helper_top_evaluate_flags();
|
||||||
|
|
|
@ -5003,11 +5003,10 @@ void helper_boundl(target_ulong a0, int v)
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPUX86State *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUX86State *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
int ret;
|
int ret;
|
||||||
unsigned long pc;
|
|
||||||
CPUX86State *saved_env;
|
CPUX86State *saved_env;
|
||||||
|
|
||||||
saved_env = env;
|
saved_env = env;
|
||||||
|
@ -5017,12 +5016,11 @@ void tlb_fill(CPUX86State *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (retaddr) {
|
if (retaddr) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
raise_exception_err(env->exception_index, env->error_code);
|
raise_exception_err(env->exception_index, env->error_code);
|
||||||
|
|
|
@ -76,11 +76,10 @@ uint32_t helper_rcsr_jrx(void)
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPULM32State *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPULM32State *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
CPULM32State *saved_env;
|
CPULM32State *saved_env;
|
||||||
unsigned long pc;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
saved_env = env;
|
saved_env = env;
|
||||||
|
@ -90,12 +89,11 @@ void tlb_fill(CPULM32State *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
if (unlikely(ret)) {
|
if (unlikely(ret)) {
|
||||||
if (retaddr) {
|
if (retaddr) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cpu_loop_exit(env);
|
cpu_loop_exit(env);
|
||||||
|
|
|
@ -56,11 +56,10 @@ extern int semihosting_enabled;
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPUM68KState *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUM68KState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
CPUM68KState *saved_env;
|
CPUM68KState *saved_env;
|
||||||
unsigned long pc;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
saved_env = env;
|
saved_env = env;
|
||||||
|
@ -69,12 +68,11 @@ void tlb_fill(CPUM68KState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
if (unlikely(ret)) {
|
if (unlikely(ret)) {
|
||||||
if (retaddr) {
|
if (retaddr) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cpu_loop_exit(env);
|
cpu_loop_exit(env);
|
||||||
|
|
|
@ -44,11 +44,10 @@
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPUMBState *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUMBState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
CPUMBState *saved_env;
|
CPUMBState *saved_env;
|
||||||
unsigned long pc;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
saved_env = env;
|
saved_env = env;
|
||||||
|
@ -58,12 +57,11 @@ void tlb_fill(CPUMBState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
if (unlikely(ret)) {
|
if (unlikely(ret)) {
|
||||||
if (retaddr) {
|
if (retaddr) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cpu_loop_exit(env);
|
cpu_loop_exit(env);
|
||||||
|
|
|
@ -101,10 +101,9 @@ void helper_raise_exception (uint32_t exception)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
static void do_restore_state (void *pc_ptr)
|
static void do_restore_state(uintptr_t pc)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
unsigned long pc = (unsigned long) pc_ptr;
|
|
||||||
|
|
||||||
tb = tb_find_pc (pc);
|
tb = tb_find_pc (pc);
|
||||||
if (tb) {
|
if (tb) {
|
||||||
|
@ -2293,7 +2292,7 @@ void helper_wait (void)
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
|
|
||||||
static void QEMU_NORETURN do_unaligned_access(target_ulong addr, int is_write,
|
static void QEMU_NORETURN do_unaligned_access(target_ulong addr, int is_write,
|
||||||
int is_user, void *retaddr);
|
int is_user, uintptr_t retaddr);
|
||||||
|
|
||||||
#define MMUSUFFIX _mmu
|
#define MMUSUFFIX _mmu
|
||||||
#define ALIGNED_ONLY
|
#define ALIGNED_ONLY
|
||||||
|
@ -2310,7 +2309,8 @@ static void QEMU_NORETURN do_unaligned_access(target_ulong addr, int is_write,
|
||||||
#define SHIFT 3
|
#define SHIFT 3
|
||||||
#include "softmmu_template.h"
|
#include "softmmu_template.h"
|
||||||
|
|
||||||
static void do_unaligned_access (target_ulong addr, int is_write, int is_user, void *retaddr)
|
static void do_unaligned_access(target_ulong addr, int is_write,
|
||||||
|
int is_user, uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
env->CP0_BadVAddr = addr;
|
env->CP0_BadVAddr = addr;
|
||||||
do_restore_state (retaddr);
|
do_restore_state (retaddr);
|
||||||
|
@ -2318,11 +2318,10 @@ static void do_unaligned_access (target_ulong addr, int is_write, int is_user, v
|
||||||
}
|
}
|
||||||
|
|
||||||
void tlb_fill(CPUMIPSState *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUMIPSState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
CPUMIPSState *saved_env;
|
CPUMIPSState *saved_env;
|
||||||
unsigned long pc;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
saved_env = env;
|
saved_env = env;
|
||||||
|
@ -2331,12 +2330,11 @@ void tlb_fill(CPUMIPSState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (retaddr) {
|
if (retaddr) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
helper_raise_exception_err(env->exception_index, env->error_code);
|
helper_raise_exception_err(env->exception_index, env->error_code);
|
||||||
|
|
|
@ -3715,11 +3715,10 @@ uint32_t helper_efdcmpeq (uint64_t op1, uint64_t op2)
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPUPPCState *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUPPCState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
CPUPPCState *saved_env;
|
CPUPPCState *saved_env;
|
||||||
unsigned long pc;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
saved_env = env;
|
saved_env = env;
|
||||||
|
@ -3728,12 +3727,11 @@ void tlb_fill(CPUPPCState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
if (unlikely(ret != 0)) {
|
if (unlikely(ret != 0)) {
|
||||||
if (likely(retaddr)) {
|
if (likely(retaddr)) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (likely(tb)) {
|
if (likely(tb)) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
helper_raise_exception_err(env->exception_index, env->error_code);
|
helper_raise_exception_err(env->exception_index, env->error_code);
|
||||||
|
|
|
@ -57,11 +57,10 @@
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPUS390XState *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUS390XState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
CPUS390XState *saved_env;
|
CPUS390XState *saved_env;
|
||||||
unsigned long pc;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
saved_env = env;
|
saved_env = env;
|
||||||
|
@ -70,12 +69,11 @@ void tlb_fill(CPUS390XState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
if (unlikely(ret != 0)) {
|
if (unlikely(ret != 0)) {
|
||||||
if (likely(retaddr)) {
|
if (likely(retaddr)) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (likely(tb)) {
|
if (likely(tb)) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cpu_loop_exit(env);
|
cpu_loop_exit(env);
|
||||||
|
|
|
@ -22,18 +22,16 @@
|
||||||
#include "dyngen-exec.h"
|
#include "dyngen-exec.h"
|
||||||
#include "helper.h"
|
#include "helper.h"
|
||||||
|
|
||||||
static void cpu_restore_state_from_retaddr(void *retaddr)
|
static void cpu_restore_state_from_retaddr(uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
unsigned long pc;
|
|
||||||
|
|
||||||
if (retaddr) {
|
if (retaddr) {
|
||||||
pc = (unsigned long) retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +54,7 @@ static void cpu_restore_state_from_retaddr(void *retaddr)
|
||||||
#include "softmmu_template.h"
|
#include "softmmu_template.h"
|
||||||
|
|
||||||
void tlb_fill(CPUSH4State *env1, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUSH4State *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
CPUSH4State *saved_env;
|
CPUSH4State *saved_env;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -84,7 +82,7 @@ void helper_ldtlb(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void raise_exception(int index, void *retaddr)
|
static inline void raise_exception(int index, uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
env->exception_index = index;
|
env->exception_index = index;
|
||||||
cpu_restore_state_from_retaddr(retaddr);
|
cpu_restore_state_from_retaddr(retaddr);
|
||||||
|
@ -447,7 +445,7 @@ void helper_ld_fpscr(uint32_t val)
|
||||||
set_flush_to_zero((val & FPSCR_DN) != 0, &env->fp_status);
|
set_flush_to_zero((val & FPSCR_DN) != 0, &env->fp_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_fpscr(void *retaddr)
|
static void update_fpscr(uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
int xcpt, cause, enable;
|
int xcpt, cause, enable;
|
||||||
|
|
||||||
|
|
|
@ -702,7 +702,7 @@ trap_state* cpu_tsptr(CPUSPARCState* env);
|
||||||
#endif
|
#endif
|
||||||
void QEMU_NORETURN do_unaligned_access(CPUSPARCState *env, target_ulong addr,
|
void QEMU_NORETURN do_unaligned_access(CPUSPARCState *env, target_ulong addr,
|
||||||
int is_write, int is_user,
|
int is_write, int is_user,
|
||||||
void *retaddr);
|
uintptr_t retaddr);
|
||||||
|
|
||||||
#define TB_FLAG_FPU_ENABLED (1 << 4)
|
#define TB_FLAG_FPU_ENABLED (1 << 4)
|
||||||
#define TB_FLAG_AM_ENABLED (1 << 5)
|
#define TB_FLAG_AM_ENABLED (1 << 5)
|
||||||
|
|
|
@ -2376,25 +2376,23 @@ void cpu_unassigned_access(CPUSPARCState *env, target_phys_addr_t addr,
|
||||||
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
/* XXX: make it generic ? */
|
/* XXX: make it generic ? */
|
||||||
static void cpu_restore_state2(CPUSPARCState *env, void *retaddr)
|
static void cpu_restore_state2(CPUSPARCState *env, uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
unsigned long pc;
|
|
||||||
|
|
||||||
if (retaddr) {
|
if (retaddr) {
|
||||||
/* now we have a real cpu fault */
|
/* now we have a real cpu fault */
|
||||||
pc = (unsigned long)retaddr;
|
tb = tb_find_pc(retaddr);
|
||||||
tb = tb_find_pc(pc);
|
|
||||||
if (tb) {
|
if (tb) {
|
||||||
/* the PC is inside the translated code. It means that we have
|
/* the PC is inside the translated code. It means that we have
|
||||||
a virtual CPU fault */
|
a virtual CPU fault */
|
||||||
cpu_restore_state(tb, env, pc);
|
cpu_restore_state(tb, env, retaddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_unaligned_access(CPUSPARCState *env, target_ulong addr, int is_write,
|
void do_unaligned_access(CPUSPARCState *env, target_ulong addr, int is_write,
|
||||||
int is_user, void *retaddr)
|
int is_user, uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_UNALIGNED
|
#ifdef DEBUG_UNALIGNED
|
||||||
printf("Unaligned access to 0x" TARGET_FMT_lx " from 0x" TARGET_FMT_lx
|
printf("Unaligned access to 0x" TARGET_FMT_lx " from 0x" TARGET_FMT_lx
|
||||||
|
@ -2409,7 +2407,7 @@ void do_unaligned_access(CPUSPARCState *env, target_ulong addr, int is_write,
|
||||||
from generated code or from helper.c) */
|
from generated code or from helper.c) */
|
||||||
/* XXX: fix it to restore all registers */
|
/* XXX: fix it to restore all registers */
|
||||||
void tlb_fill(CPUSPARCState *env, target_ulong addr, int is_write, int mmu_idx,
|
void tlb_fill(CPUSPARCState *env, target_ulong addr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include "host-utils.h"
|
#include "host-utils.h"
|
||||||
|
|
||||||
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
|
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
|
||||||
void *retaddr);
|
uintptr_t retaddr);
|
||||||
|
|
||||||
#define ALIGNED_ONLY
|
#define ALIGNED_ONLY
|
||||||
#define MMUSUFFIX _mmu
|
#define MMUSUFFIX _mmu
|
||||||
|
@ -48,10 +48,9 @@ static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
|
||||||
#define SHIFT 3
|
#define SHIFT 3
|
||||||
#include "softmmu_template.h"
|
#include "softmmu_template.h"
|
||||||
|
|
||||||
static void do_restore_state(void *pc_ptr)
|
static void do_restore_state(uintptr_t pc)
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
uint32_t pc = (uint32_t)(intptr_t)pc_ptr;
|
|
||||||
|
|
||||||
tb = tb_find_pc(pc);
|
tb = tb_find_pc(pc);
|
||||||
if (tb) {
|
if (tb) {
|
||||||
|
@ -60,7 +59,7 @@ static void do_restore_state(void *pc_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
|
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
if (xtensa_option_enabled(env->config, XTENSA_OPTION_UNALIGNED_EXCEPTION) &&
|
if (xtensa_option_enabled(env->config, XTENSA_OPTION_UNALIGNED_EXCEPTION) &&
|
||||||
!xtensa_option_enabled(env->config, XTENSA_OPTION_HW_ALIGNMENT)) {
|
!xtensa_option_enabled(env->config, XTENSA_OPTION_HW_ALIGNMENT)) {
|
||||||
|
@ -71,7 +70,7 @@ static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
|
||||||
}
|
}
|
||||||
|
|
||||||
void tlb_fill(CPUXtensaState *env1, target_ulong vaddr, int is_write, int mmu_idx,
|
void tlb_fill(CPUXtensaState *env1, target_ulong vaddr, int is_write, int mmu_idx,
|
||||||
void *retaddr)
|
uintptr_t retaddr)
|
||||||
{
|
{
|
||||||
CPUXtensaState *saved_env = env;
|
CPUXtensaState *saved_env = env;
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ void cpu_resume_from_signal(CPUArchState *env1, void *puc)
|
||||||
the effective address of the memory exception. 'is_write' is 1 if a
|
the effective address of the memory exception. 'is_write' is 1 if a
|
||||||
write caused the exception and otherwise 0'. 'old_set' is the
|
write caused the exception and otherwise 0'. 'old_set' is the
|
||||||
signal set which should be restored */
|
signal set which should be restored */
|
||||||
static inline int handle_cpu_signal(unsigned long pc, unsigned long address,
|
static inline int handle_cpu_signal(uintptr_t pc, unsigned long address,
|
||||||
int is_write, sigset_t *old_set,
|
int is_write, sigset_t *old_set,
|
||||||
void *puc)
|
void *puc)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue