Revision 20503968

b/cpu-defs.h
166 166
    /* in order to avoid passing too many arguments to the MMIO         \
167 167
       helpers, we store some rarely used information in the CPU        \
168 168
       context) */                                                      \
169
    unsigned long mem_io_pc; /* host pc at which the memory was         \
170
                                accessed */                             \
169
    uintptr_t mem_io_pc; /* host pc at which the memory was             \
170
                            accessed */                                 \
171 171
    target_ulong mem_io_vaddr; /* target virtual addr at which the      \
172 172
                                     memory was accessed */             \
173 173
    uint32_t halted; /* Nonzero if the CPU is in suspend state */       \
b/exec-all.h
87 87
int cpu_restore_state(struct TranslationBlock *tb,
88 88
                      CPUArchState *env, uintptr_t searched_pc);
89 89
void QEMU_NORETURN cpu_resume_from_signal(CPUArchState *env1, void *puc);
90
void QEMU_NORETURN cpu_io_recompile(CPUArchState *env, void *retaddr);
90
void QEMU_NORETURN cpu_io_recompile(CPUArchState *env, uintptr_t retaddr);
91 91
TranslationBlock *tb_gen_code(CPUArchState *env, 
92 92
                              target_ulong pc, target_ulong cs_base, int flags,
93 93
                              int cflags);
......
287 287
# endif
288 288
#elif defined(__s390__) && !defined(__s390x__)
289 289
# define GETPC() \
290
    ((void *)(((uintptr_t)__builtin_return_address(0) & 0x7fffffffUL) - 1))
290
    (((uintptr_t)__builtin_return_address(0) & 0x7fffffffUL) - 1)
291 291
#elif defined(__arm__)
292 292
/* Thumb return addresses have the low bit set, so we need to subtract two.
293 293
   This is still safe in ARM mode because instructions are 4 bytes.  */
294
# define GETPC() ((void *)((uintptr_t)__builtin_return_address(0) - 2))
294
# define GETPC() ((uintptr_t)__builtin_return_address(0) - 2)
295 295
#else
296
# define GETPC() ((void *)((uintptr_t)__builtin_return_address(0) - 1))
296
# define GETPC() ((uintptr_t)__builtin_return_address(0) - 1)
297 297
#endif
298 298

  
299 299
#if !defined(CONFIG_USER_ONLY)
......
305 305
                  uint64_t value, unsigned size);
306 306

  
307 307
void tlb_fill(CPUArchState *env1, target_ulong addr, int is_write, int mmu_idx,
308
              void *retaddr);
308
              uintptr_t retaddr);
309 309

  
310 310
#include "softmmu_defs.h"
311 311

  
b/exec.c
1221 1221

  
1222 1222
#if !defined(CONFIG_SOFTMMU)
1223 1223
static void tb_invalidate_phys_page(tb_page_addr_t addr,
1224
                                    unsigned long pc, void *puc)
1224
                                    uintptr_t pc, void *puc)
1225 1225
{
1226 1226
    TranslationBlock *tb;
1227 1227
    PageDesc *p;
......
4477 4477

  
4478 4478
/* in deterministic execution mode, instructions doing device I/Os
4479 4479
   must be at the end of the TB */
4480
void cpu_io_recompile(CPUArchState *env, void *retaddr)
4480
void cpu_io_recompile(CPUArchState *env, uintptr_t retaddr)
4481 4481
{
4482 4482
    TranslationBlock *tb;
4483 4483
    uint32_t n, cflags;
4484 4484
    target_ulong pc, cs_base;
4485 4485
    uint64_t flags;
4486 4486

  
4487
    tb = tb_find_pc((uintptr_t)retaddr);
4487
    tb = tb_find_pc(retaddr);
4488 4488
    if (!tb) {
4489 4489
        cpu_abort(env, "cpu_io_recompile: could not find TB for pc=%p", 
4490
                  retaddr);
4490
                  (void *)retaddr);
4491 4491
    }
4492 4492
    n = env->icount_decr.u16.low + tb->icount;
4493
    cpu_restore_state(tb, env, (unsigned long)retaddr);
4493
    cpu_restore_state(tb, env, retaddr);
4494 4494
    /* Calculate how many instructions had been executed before the fault
4495 4495
       occurred.  */
4496 4496
    n = n - env->icount_decr.u16.low;
......
4638 4638

  
4639 4639
#define MMUSUFFIX _cmmu
4640 4640
#undef GETPC
4641
#define GETPC() NULL
4641
#define GETPC() ((uintptr_t)0)
4642 4642
#define env cpu_single_env
4643 4643
#define SOFTMMU_CODE_ACCESS
4644 4644

  
b/softmmu_template.h
69 69
static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(ENV_PARAM
70 70
                                                        target_ulong addr,
71 71
                                                        int mmu_idx,
72
                                                        void *retaddr);
72
                                                        uintptr_t retaddr);
73 73
static inline DATA_TYPE glue(io_read, SUFFIX)(ENV_PARAM
74 74
                                              target_phys_addr_t physaddr,
75 75
                                              target_ulong addr,
76
                                              void *retaddr)
76
                                              uintptr_t retaddr)
77 77
{
78 78
    DATA_TYPE res;
79 79
    MemoryRegion *mr = iotlb_to_region(physaddr);
80 80

  
81 81
    physaddr = (physaddr & TARGET_PAGE_MASK) + addr;
82
    env->mem_io_pc = (unsigned long)retaddr;
82
    env->mem_io_pc = retaddr;
83 83
    if (mr != &io_mem_ram && mr != &io_mem_rom
84 84
        && mr != &io_mem_unassigned
85 85
        && mr != &io_mem_notdirty
......
113 113
    target_ulong tlb_addr;
114 114
    target_phys_addr_t ioaddr;
115 115
    unsigned long addend;
116
    void *retaddr;
116
    uintptr_t retaddr;
117 117

  
118 118
    /* test if there is match for unaligned or IO access */
119 119
    /* XXX: could done more in memory macro in a non portable way */
......
166 166
glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(ENV_PARAM
167 167
                                       target_ulong addr,
168 168
                                       int mmu_idx,
169
                                       void *retaddr)
169
                                       uintptr_t retaddr)
170 170
{
171 171
    DATA_TYPE res, res1, res2;
172 172
    int index, shift;
......
219 219
                                                   target_ulong addr,
220 220
                                                   DATA_TYPE val,
221 221
                                                   int mmu_idx,
222
                                                   void *retaddr);
222
                                                   uintptr_t retaddr);
223 223

  
224 224
static inline void glue(io_write, SUFFIX)(ENV_PARAM
225 225
                                          target_phys_addr_t physaddr,
226 226
                                          DATA_TYPE val,
227 227
                                          target_ulong addr,
228
                                          void *retaddr)
228
                                          uintptr_t retaddr)
229 229
{
230 230
    MemoryRegion *mr = iotlb_to_region(physaddr);
231 231

  
......
238 238
    }
239 239

  
240 240
    env->mem_io_vaddr = addr;
241
    env->mem_io_pc = (unsigned long)retaddr;
241
    env->mem_io_pc = retaddr;
242 242
#if SHIFT <= 2
243 243
    io_mem_write(mr, physaddr, val, 1 << SHIFT);
244 244
#else
......
260 260
    target_phys_addr_t ioaddr;
261 261
    unsigned long addend;
262 262
    target_ulong tlb_addr;
263
    void *retaddr;
263
    uintptr_t retaddr;
264 264
    int index;
265 265

  
266 266
    index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
......
310 310
                                                   target_ulong addr,
311 311
                                                   DATA_TYPE val,
312 312
                                                   int mmu_idx,
313
                                                   void *retaddr)
313
                                                   uintptr_t retaddr)
314 314
{
315 315
    target_phys_addr_t ioaddr;
316 316
    unsigned long addend;
b/target-alpha/cpu.h
433 433
                                int mmu_idx);
434 434
#define cpu_handle_mmu_fault cpu_alpha_handle_mmu_fault
435 435
void do_interrupt (CPUAlphaState *env);
436
void do_restore_state(CPUAlphaState *, void *retaddr);
437
void QEMU_NORETURN dynamic_excp(CPUAlphaState *, void *, int, int);
438
void QEMU_NORETURN arith_excp(CPUAlphaState *, void *, int, uint64_t);
436
void do_restore_state(CPUAlphaState *, uintptr_t retaddr);
437
void QEMU_NORETURN dynamic_excp(CPUAlphaState *, uintptr_t, int, int);
438
void QEMU_NORETURN arith_excp(CPUAlphaState *, uintptr_t, int, uint64_t);
439 439

  
440 440
uint64_t cpu_alpha_load_fpcr (CPUAlphaState *env);
441 441
void cpu_alpha_store_fpcr (CPUAlphaState *env, uint64_t val);
b/target-alpha/fpu_helper.c
44 44
    return get_float_exception_flags(&FP_STATUS);
45 45
}
46 46

  
47
static inline void inline_fp_exc_raise(CPUAlphaState *env, void *retaddr,
47
static inline void inline_fp_exc_raise(CPUAlphaState *env, uintptr_t retaddr,
48 48
                                       uint32_t exc, uint32_t regno)
49 49
{
50 50
    if (exc) {
......
160 160
    return r;
161 161
}
162 162

  
163
static float32 f_to_float32(CPUAlphaState *env, void *retaddr, uint64_t a)
163
static float32 f_to_float32(CPUAlphaState *env, uintptr_t retaddr, uint64_t a)
164 164
{
165 165
    uint32_t exp, mant_sig;
166 166
    CPU_FloatU r;
......
291 291
    return r;
292 292
}
293 293

  
294
static float64 g_to_float64(CPUAlphaState *env, void *retaddr, uint64_t a)
294
static float64 g_to_float64(CPUAlphaState *env, uintptr_t retaddr, uint64_t a)
295 295
{
296 296
    uint64_t exp, mant_sig;
297 297
    CPU_DoubleU r;
b/target-alpha/helper.c
494 494
    cpu_fprintf(f, "\n");
495 495
}
496 496

  
497
void do_restore_state(CPUAlphaState *env, void *retaddr)
497
void do_restore_state(CPUAlphaState *env, uintptr_t retaddr)
498 498
{
499
    uintptr_t pc = (uintptr_t)retaddr;
500
    if (pc) {
501
        TranslationBlock *tb = tb_find_pc(pc);
499
    if (retaddr) {
500
        TranslationBlock *tb = tb_find_pc(retaddr);
502 501
        if (tb) {
503
            cpu_restore_state(tb, env, pc);
502
            cpu_restore_state(tb, env, retaddr);
504 503
        }
505 504
    }
506 505
}
......
515 514
}
516 515

  
517 516
/* This may be called from any of the helpers to set up EXCEPTION_INDEX.  */
518
void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, void *retaddr,
517
void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uintptr_t retaddr,
519 518
                                int excp, int error)
520 519
{
521 520
    env->exception_index = excp;
......
524 523
    cpu_loop_exit(env);
525 524
}
526 525

  
527
void QEMU_NORETURN arith_excp(CPUAlphaState *env, void *retaddr,
526
void QEMU_NORETURN arith_excp(CPUAlphaState *env, uintptr_t retaddr,
528 527
                              int exc, uint64_t mask)
529 528
{
530 529
    env->trap_arg0 = exc;
b/target-alpha/mem_helper.c
89 89
}
90 90

  
91 91
static void do_unaligned_access(CPUAlphaState *env, target_ulong addr,
92
                                int is_write, int is_user, void *retaddr)
92
                                int is_write, int is_user, uintptr_t retaddr)
93 93
{
94 94
    uint64_t pc;
95 95
    uint32_t insn;
......
112 112
{
113 113
    env->trap_arg0 = addr;
114 114
    env->trap_arg1 = is_write;
115
    dynamic_excp(env, NULL, EXCP_MCHK, 0);
115
    dynamic_excp(env, 0, EXCP_MCHK, 0);
116 116
}
117 117

  
118 118
#include "softmmu_exec.h"
......
137 137
   from generated code or from helper.c) */
138 138
/* XXX: fix it to restore all registers */
139 139
void tlb_fill(CPUAlphaState *env, target_ulong addr, int is_write,
140
              int mmu_idx, void *retaddr)
140
              int mmu_idx, uintptr_t retaddr)
141 141
{
142 142
    int ret;
143 143

  
b/target-arm/op_helper.c
76 76
   from generated code or from helper.c) */
77 77
/* XXX: fix it to restore all registers */
78 78
void tlb_fill(CPUARMState *env1, target_ulong addr, int is_write, int mmu_idx,
79
              void *retaddr)
79
              uintptr_t retaddr)
80 80
{
81 81
    TranslationBlock *tb;
82 82
    CPUARMState *saved_env;
83
    unsigned long pc;
84 83
    int ret;
85 84

  
86 85
    saved_env = env;
......
89 88
    if (unlikely(ret)) {
90 89
        if (retaddr) {
91 90
            /* now we have a real cpu fault */
92
            pc = (unsigned long)retaddr;
93
            tb = tb_find_pc(pc);
91
            tb = tb_find_pc(retaddr);
94 92
            if (tb) {
95 93
                /* the PC is inside the translated code. It means that we have
96 94
                   a virtual CPU fault */
97
                cpu_restore_state(tb, env, pc);
95
                cpu_restore_state(tb, env, retaddr);
98 96
            }
99 97
        }
100 98
        raise_exception(env->exception_index);
b/target-cris/op_helper.c
57 57
   from generated code or from helper.c) */
58 58
/* XXX: fix it to restore all registers */
59 59
void tlb_fill(CPUCRISState *env1, target_ulong addr, int is_write, int mmu_idx,
60
              void *retaddr)
60
              uintptr_t retaddr)
61 61
{
62 62
    TranslationBlock *tb;
63 63
    CPUCRISState *saved_env;
64
    unsigned long pc;
65 64
    int ret;
66 65

  
67 66
    saved_env = env;
68 67
    env = env1;
69 68

  
70
    D_LOG("%s pc=%x tpc=%x ra=%x\n", __func__, 
71
	     env->pc, env->debug1, retaddr);
69
    D_LOG("%s pc=%x tpc=%x ra=%p\n", __func__,
70
          env->pc, env->debug1, (void *)retaddr);
72 71
    ret = cpu_cris_handle_mmu_fault(env, addr, is_write, mmu_idx);
73 72
    if (unlikely(ret)) {
74 73
        if (retaddr) {
75 74
            /* now we have a real cpu fault */
76
            pc = (unsigned long)retaddr;
77
            tb = tb_find_pc(pc);
75
            tb = tb_find_pc(retaddr);
78 76
            if (tb) {
79 77
                /* the PC is inside the translated code. It means that we have
80 78
                   a virtual CPU fault */
81
                cpu_restore_state(tb, env, pc);
79
                cpu_restore_state(tb, env, retaddr);
82 80

  
83 81
		/* Evaluate flags after retranslation.  */
84 82
                helper_top_evaluate_flags();
b/target-i386/op_helper.c
5003 5003
   from generated code or from helper.c) */
5004 5004
/* XXX: fix it to restore all registers */
5005 5005
void tlb_fill(CPUX86State *env1, target_ulong addr, int is_write, int mmu_idx,
5006
              void *retaddr)
5006
              uintptr_t retaddr)
5007 5007
{
5008 5008
    TranslationBlock *tb;
5009 5009
    int ret;
5010
    unsigned long pc;
5011 5010
    CPUX86State *saved_env;
5012 5011

  
5013 5012
    saved_env = env;
......
5017 5016
    if (ret) {
5018 5017
        if (retaddr) {
5019 5018
            /* now we have a real cpu fault */
5020
            pc = (unsigned long)retaddr;
5021
            tb = tb_find_pc(pc);
5019
            tb = tb_find_pc(retaddr);
5022 5020
            if (tb) {
5023 5021
                /* the PC is inside the translated code. It means that we have
5024 5022
                   a virtual CPU fault */
5025
                cpu_restore_state(tb, env, pc);
5023
                cpu_restore_state(tb, env, retaddr);
5026 5024
            }
5027 5025
        }
5028 5026
        raise_exception_err(env->exception_index, env->error_code);
b/target-lm32/op_helper.c
76 76
   from generated code or from helper.c) */
77 77
/* XXX: fix it to restore all registers */
78 78
void tlb_fill(CPULM32State *env1, target_ulong addr, int is_write, int mmu_idx,
79
              void *retaddr)
79
              uintptr_t retaddr)
80 80
{
81 81
    TranslationBlock *tb;
82 82
    CPULM32State *saved_env;
83
    unsigned long pc;
84 83
    int ret;
85 84

  
86 85
    saved_env = env;
......
90 89
    if (unlikely(ret)) {
91 90
        if (retaddr) {
92 91
            /* now we have a real cpu fault */
93
            pc = (unsigned long)retaddr;
94
            tb = tb_find_pc(pc);
92
            tb = tb_find_pc(retaddr);
95 93
            if (tb) {
96 94
                /* the PC is inside the translated code. It means that we have
97 95
                   a virtual CPU fault */
98
                cpu_restore_state(tb, env, pc);
96
                cpu_restore_state(tb, env, retaddr);
99 97
            }
100 98
        }
101 99
        cpu_loop_exit(env);
b/target-m68k/op_helper.c
56 56
   from generated code or from helper.c) */
57 57
/* XXX: fix it to restore all registers */
58 58
void tlb_fill(CPUM68KState *env1, target_ulong addr, int is_write, int mmu_idx,
59
              void *retaddr)
59
              uintptr_t retaddr)
60 60
{
61 61
    TranslationBlock *tb;
62 62
    CPUM68KState *saved_env;
63
    unsigned long pc;
64 63
    int ret;
65 64

  
66 65
    saved_env = env;
......
69 68
    if (unlikely(ret)) {
70 69
        if (retaddr) {
71 70
            /* now we have a real cpu fault */
72
            pc = (unsigned long)retaddr;
73
            tb = tb_find_pc(pc);
71
            tb = tb_find_pc(retaddr);
74 72
            if (tb) {
75 73
                /* the PC is inside the translated code. It means that we have
76 74
                   a virtual CPU fault */
77
                cpu_restore_state(tb, env, pc);
75
                cpu_restore_state(tb, env, retaddr);
78 76
            }
79 77
        }
80 78
        cpu_loop_exit(env);
b/target-microblaze/op_helper.c
44 44
   from generated code or from helper.c) */
45 45
/* XXX: fix it to restore all registers */
46 46
void tlb_fill(CPUMBState *env1, target_ulong addr, int is_write, int mmu_idx,
47
              void *retaddr)
47
              uintptr_t retaddr)
48 48
{
49 49
    TranslationBlock *tb;
50 50
    CPUMBState *saved_env;
51
    unsigned long pc;
52 51
    int ret;
53 52

  
54 53
    saved_env = env;
......
58 57
    if (unlikely(ret)) {
59 58
        if (retaddr) {
60 59
            /* now we have a real cpu fault */
61
            pc = (unsigned long)retaddr;
62
            tb = tb_find_pc(pc);
60
            tb = tb_find_pc(retaddr);
63 61
            if (tb) {
64 62
                /* the PC is inside the translated code. It means that we have
65 63
                   a virtual CPU fault */
66
                cpu_restore_state(tb, env, pc);
64
                cpu_restore_state(tb, env, retaddr);
67 65
            }
68 66
        }
69 67
        cpu_loop_exit(env);
b/target-mips/op_helper.c
101 101
}
102 102

  
103 103
#if !defined(CONFIG_USER_ONLY)
104
static void do_restore_state (void *pc_ptr)
104
static void do_restore_state(uintptr_t pc)
105 105
{
106 106
    TranslationBlock *tb;
107
    unsigned long pc = (unsigned long) pc_ptr;
108
    
107

  
109 108
    tb = tb_find_pc (pc);
110 109
    if (tb) {
111 110
        cpu_restore_state(tb, env, pc);
......
2293 2292
#if !defined(CONFIG_USER_ONLY)
2294 2293

  
2295 2294
static void QEMU_NORETURN do_unaligned_access(target_ulong addr, int is_write,
2296
                                              int is_user, void *retaddr);
2295
                                              int is_user, uintptr_t retaddr);
2297 2296

  
2298 2297
#define MMUSUFFIX _mmu
2299 2298
#define ALIGNED_ONLY
......
2310 2309
#define SHIFT 3
2311 2310
#include "softmmu_template.h"
2312 2311

  
2313
static void do_unaligned_access (target_ulong addr, int is_write, int is_user, void *retaddr)
2312
static void do_unaligned_access(target_ulong addr, int is_write,
2313
                                int is_user, uintptr_t retaddr)
2314 2314
{
2315 2315
    env->CP0_BadVAddr = addr;
2316 2316
    do_restore_state (retaddr);
......
2318 2318
}
2319 2319

  
2320 2320
void tlb_fill(CPUMIPSState *env1, target_ulong addr, int is_write, int mmu_idx,
2321
              void *retaddr)
2321
              uintptr_t retaddr)
2322 2322
{
2323 2323
    TranslationBlock *tb;
2324 2324
    CPUMIPSState *saved_env;
2325
    unsigned long pc;
2326 2325
    int ret;
2327 2326

  
2328 2327
    saved_env = env;
......
2331 2330
    if (ret) {
2332 2331
        if (retaddr) {
2333 2332
            /* now we have a real cpu fault */
2334
            pc = (unsigned long)retaddr;
2335
            tb = tb_find_pc(pc);
2333
            tb = tb_find_pc(retaddr);
2336 2334
            if (tb) {
2337 2335
                /* the PC is inside the translated code. It means that we have
2338 2336
                   a virtual CPU fault */
2339
                cpu_restore_state(tb, env, pc);
2337
                cpu_restore_state(tb, env, retaddr);
2340 2338
            }
2341 2339
        }
2342 2340
        helper_raise_exception_err(env->exception_index, env->error_code);
b/target-ppc/op_helper.c
3715 3715
   from generated code or from helper.c) */
3716 3716
/* XXX: fix it to restore all registers */
3717 3717
void tlb_fill(CPUPPCState *env1, target_ulong addr, int is_write, int mmu_idx,
3718
              void *retaddr)
3718
              uintptr_t retaddr)
3719 3719
{
3720 3720
    TranslationBlock *tb;
3721 3721
    CPUPPCState *saved_env;
3722
    unsigned long pc;
3723 3722
    int ret;
3724 3723

  
3725 3724
    saved_env = env;
......
3728 3727
    if (unlikely(ret != 0)) {
3729 3728
        if (likely(retaddr)) {
3730 3729
            /* now we have a real cpu fault */
3731
            pc = (unsigned long)retaddr;
3732
            tb = tb_find_pc(pc);
3730
            tb = tb_find_pc(retaddr);
3733 3731
            if (likely(tb)) {
3734 3732
                /* the PC is inside the translated code. It means that we have
3735 3733
                   a virtual CPU fault */
3736
                cpu_restore_state(tb, env, pc);
3734
                cpu_restore_state(tb, env, retaddr);
3737 3735
            }
3738 3736
        }
3739 3737
        helper_raise_exception_err(env->exception_index, env->error_code);
b/target-s390x/op_helper.c
57 57
   from generated code or from helper.c) */
58 58
/* XXX: fix it to restore all registers */
59 59
void tlb_fill(CPUS390XState *env1, target_ulong addr, int is_write, int mmu_idx,
60
              void *retaddr)
60
              uintptr_t retaddr)
61 61
{
62 62
    TranslationBlock *tb;
63 63
    CPUS390XState *saved_env;
64
    unsigned long pc;
65 64
    int ret;
66 65

  
67 66
    saved_env = env;
......
70 69
    if (unlikely(ret != 0)) {
71 70
        if (likely(retaddr)) {
72 71
            /* now we have a real cpu fault */
73
            pc = (unsigned long)retaddr;
74
            tb = tb_find_pc(pc);
72
            tb = tb_find_pc(retaddr);
75 73
            if (likely(tb)) {
76 74
                /* the PC is inside the translated code. It means that we have
77 75
                   a virtual CPU fault */
78
                cpu_restore_state(tb, env, pc);
76
                cpu_restore_state(tb, env, retaddr);
79 77
            }
80 78
        }
81 79
        cpu_loop_exit(env);
b/target-sh4/op_helper.c
22 22
#include "dyngen-exec.h"
23 23
#include "helper.h"
24 24

  
25
static void cpu_restore_state_from_retaddr(void *retaddr)
25
static void cpu_restore_state_from_retaddr(uintptr_t retaddr)
26 26
{
27 27
    TranslationBlock *tb;
28
    unsigned long pc;
29 28

  
30 29
    if (retaddr) {
31
        pc = (unsigned long) retaddr;
32
        tb = tb_find_pc(pc);
30
        tb = tb_find_pc(retaddr);
33 31
        if (tb) {
34 32
            /* the PC is inside the translated code. It means that we have
35 33
               a virtual CPU fault */
36
            cpu_restore_state(tb, env, pc);
34
            cpu_restore_state(tb, env, retaddr);
37 35
        }
38 36
    }
39 37
}
......
56 54
#include "softmmu_template.h"
57 55

  
58 56
void tlb_fill(CPUSH4State *env1, target_ulong addr, int is_write, int mmu_idx,
59
              void *retaddr)
57
              uintptr_t retaddr)
60 58
{
61 59
    CPUSH4State *saved_env;
62 60
    int ret;
......
84 82
#endif
85 83
}
86 84

  
87
static inline void raise_exception(int index, void *retaddr)
85
static inline void raise_exception(int index, uintptr_t retaddr)
88 86
{
89 87
    env->exception_index = index;
90 88
    cpu_restore_state_from_retaddr(retaddr);
......
447 445
    set_flush_to_zero((val & FPSCR_DN) != 0, &env->fp_status);
448 446
}
449 447

  
450
static void update_fpscr(void *retaddr)
448
static void update_fpscr(uintptr_t retaddr)
451 449
{
452 450
    int xcpt, cause, enable;
453 451

  
b/target-sparc/cpu.h
702 702
#endif
703 703
void QEMU_NORETURN do_unaligned_access(CPUSPARCState *env, target_ulong addr,
704 704
                                       int is_write, int is_user,
705
                                       void *retaddr);
705
                                       uintptr_t retaddr);
706 706

  
707 707
#define TB_FLAG_FPU_ENABLED (1 << 4)
708 708
#define TB_FLAG_AM_ENABLED (1 << 5)
b/target-sparc/ldst_helper.c
2376 2376

  
2377 2377
#if !defined(CONFIG_USER_ONLY)
2378 2378
/* XXX: make it generic ? */
2379
static void cpu_restore_state2(CPUSPARCState *env, void *retaddr)
2379
static void cpu_restore_state2(CPUSPARCState *env, uintptr_t retaddr)
2380 2380
{
2381 2381
    TranslationBlock *tb;
2382
    unsigned long pc;
2383 2382

  
2384 2383
    if (retaddr) {
2385 2384
        /* now we have a real cpu fault */
2386
        pc = (unsigned long)retaddr;
2387
        tb = tb_find_pc(pc);
2385
        tb = tb_find_pc(retaddr);
2388 2386
        if (tb) {
2389 2387
            /* the PC is inside the translated code. It means that we have
2390 2388
               a virtual CPU fault */
2391
            cpu_restore_state(tb, env, pc);
2389
            cpu_restore_state(tb, env, retaddr);
2392 2390
        }
2393 2391
    }
2394 2392
}
2395 2393

  
2396 2394
void do_unaligned_access(CPUSPARCState *env, target_ulong addr, int is_write,
2397
                         int is_user, void *retaddr)
2395
                         int is_user, uintptr_t retaddr)
2398 2396
{
2399 2397
#ifdef DEBUG_UNALIGNED
2400 2398
    printf("Unaligned access to 0x" TARGET_FMT_lx " from 0x" TARGET_FMT_lx
......
2409 2407
   from generated code or from helper.c) */
2410 2408
/* XXX: fix it to restore all registers */
2411 2409
void tlb_fill(CPUSPARCState *env, target_ulong addr, int is_write, int mmu_idx,
2412
              void *retaddr)
2410
              uintptr_t retaddr)
2413 2411
{
2414 2412
    int ret;
2415 2413

  
b/target-xtensa/op_helper.c
31 31
#include "host-utils.h"
32 32

  
33 33
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
34
        void *retaddr);
34
                                uintptr_t retaddr);
35 35

  
36 36
#define ALIGNED_ONLY
37 37
#define MMUSUFFIX _mmu
......
48 48
#define SHIFT 3
49 49
#include "softmmu_template.h"
50 50

  
51
static void do_restore_state(void *pc_ptr)
51
static void do_restore_state(uintptr_t pc)
52 52
{
53 53
    TranslationBlock *tb;
54
    uint32_t pc = (uint32_t)(intptr_t)pc_ptr;
55 54

  
56 55
    tb = tb_find_pc(pc);
57 56
    if (tb) {
......
60 59
}
61 60

  
62 61
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
63
        void *retaddr)
62
                                uintptr_t retaddr)
64 63
{
65 64
    if (xtensa_option_enabled(env->config, XTENSA_OPTION_UNALIGNED_EXCEPTION) &&
66 65
            !xtensa_option_enabled(env->config, XTENSA_OPTION_HW_ALIGNMENT)) {
......
71 70
}
72 71

  
73 72
void tlb_fill(CPUXtensaState *env1, target_ulong vaddr, int is_write, int mmu_idx,
74
              void *retaddr)
73
              uintptr_t retaddr)
75 74
{
76 75
    CPUXtensaState *saved_env = env;
77 76

  
b/user-exec.c
82 82
   the effective address of the memory exception. 'is_write' is 1 if a
83 83
   write caused the exception and otherwise 0'. 'old_set' is the
84 84
   signal set which should be restored */
85
static inline int handle_cpu_signal(unsigned long pc, unsigned long address,
85
static inline int handle_cpu_signal(uintptr_t pc, unsigned long address,
86 86
                                    int is_write, sigset_t *old_set,
87 87
                                    void *puc)
88 88
{

Also available in: Unified diff