Revision eb20c1c6

b/target-ppc/cpu.h
1090 1090
   is returned if the signal was handled by the virtual CPU.  */
1091 1091
int cpu_ppc_signal_handler (int host_signum, void *pinfo,
1092 1092
                            void *puc);
1093
int cpu_ppc_handle_mmu_fault (CPUPPCState *env, target_ulong address, int rw,
1094
                              int mmu_idx);
1095 1093
void ppc_hw_interrupt (CPUPPCState *env);
1096 1094
#if defined(CONFIG_USER_ONLY)
1097 1095
int cpu_handle_mmu_fault(CPUPPCState *env, target_ulong address, int rw,
b/target-ppc/mem_helper.c
252 252

  
253 253
#undef HI_IDX
254 254
#undef LO_IDX
255

  
256
/*****************************************************************************/
257
/* Softmmu support */
258
#if !defined(CONFIG_USER_ONLY)
259

  
260
#define MMUSUFFIX _mmu
261

  
262
#define SHIFT 0
263
#include "exec/softmmu_template.h"
264

  
265
#define SHIFT 1
266
#include "exec/softmmu_template.h"
267

  
268
#define SHIFT 2
269
#include "exec/softmmu_template.h"
270

  
271
#define SHIFT 3
272
#include "exec/softmmu_template.h"
273

  
274
/* try to fill the TLB and return an exception if error. If retaddr is
275
   NULL, it means that the function was called in C code (i.e. not
276
   from generated code or from helper.c) */
277
/* XXX: fix it to restore all registers */
278
void tlb_fill(CPUPPCState *env, target_ulong addr, int is_write, int mmu_idx,
279
              uintptr_t retaddr)
280
{
281
    int ret;
282

  
283
    ret = cpu_ppc_handle_mmu_fault(env, addr, is_write, mmu_idx);
284
    if (unlikely(ret != 0)) {
285
        if (likely(retaddr)) {
286
            /* now we have a real cpu fault */
287
            cpu_restore_state(env, retaddr);
288
        }
289
        helper_raise_exception_err(env, env->exception_index, env->error_code);
290
    }
291
}
292
#endif /* !CONFIG_USER_ONLY */
b/target-ppc/mmu_helper.c
1384 1384
}
1385 1385

  
1386 1386
/* Perform address translation */
1387
int cpu_ppc_handle_mmu_fault(CPUPPCState *env, target_ulong address, int rw,
1388
                             int mmu_idx)
1387
static int cpu_ppc_handle_mmu_fault(CPUPPCState *env, target_ulong address,
1388
                                    int rw, int mmu_idx)
1389 1389
{
1390 1390
    mmu_ctx_t ctx;
1391 1391
    int access_type;
......
2777 2777

  
2778 2778
    booke206_flush_tlb(env, flags, 1);
2779 2779
}
2780

  
2781

  
2782
/*****************************************************************************/
2783

  
2784
#define MMUSUFFIX _mmu
2785

  
2786
#define SHIFT 0
2787
#include "exec/softmmu_template.h"
2788

  
2789
#define SHIFT 1
2790
#include "exec/softmmu_template.h"
2791

  
2792
#define SHIFT 2
2793
#include "exec/softmmu_template.h"
2794

  
2795
#define SHIFT 3
2796
#include "exec/softmmu_template.h"
2797

  
2798
/* try to fill the TLB and return an exception if error. If retaddr is
2799
   NULL, it means that the function was called in C code (i.e. not
2800
   from generated code or from helper.c) */
2801
/* XXX: fix it to restore all registers */
2802
void tlb_fill(CPUPPCState *env, target_ulong addr, int is_write, int mmu_idx,
2803
              uintptr_t retaddr)
2804
{
2805
    int ret;
2806

  
2807
    ret = cpu_ppc_handle_mmu_fault(env, addr, is_write, mmu_idx);
2808
    if (unlikely(ret != 0)) {
2809
        if (likely(retaddr)) {
2810
            /* now we have a real cpu fault */
2811
            cpu_restore_state(env, retaddr);
2812
        }
2813
        helper_raise_exception_err(env, env->exception_index, env->error_code);
2814
    }
2815
}

Also available in: Unified diff