Revision 24741ef3 target-ppc/helper.c

b/target-ppc/helper.c
36 36
/*****************************************************************************/
37 37
/* PowerPC MMU emulation */
38 38

  
39
#if defined(CONFIG_USER_ONLY) 
40
int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw,
41
                              int is_user, int is_softmmu)
42
{
43
    int exception, error_code;
44
    
45
    if (rw == 2) {
46
        exception = EXCP_ISI;
47
        error_code = 0;
48
    } else {
49
        exception = EXCP_DSI;
50
        error_code = 0;
51
        if (rw)
52
            error_code |= 0x02000000;
53
        env->spr[SPR_DAR] = address;
54
        env->spr[SPR_DSISR] = error_code;
55
    }
56
    env->exception_index = exception;
57
    env->error_code = error_code;
58
    return 1;
59
}
60
target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
61
{
62
    return addr;
63
}
64
#else
39 65
/* Perform BAT hit & translation */
40 66
static int get_bat (CPUState *env, uint32_t *real, int *prot,
41 67
                    uint32_t virtual, int rw, int type)
......
355 381
    return ret;
356 382
}
357 383

  
358
int get_physical_address (CPUState *env, uint32_t *physical, int *prot,
359
                          uint32_t address, int rw, int access_type)
384
static int get_physical_address (CPUState *env, uint32_t *physical, int *prot,
385
                                 uint32_t address, int rw, int access_type)
360 386
{
361 387
    int ret;
362 388
#if 0
......
387 413
    return ret;
388 414
}
389 415

  
390
#if defined(CONFIG_USER_ONLY) 
391
target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
392
{
393
    return addr;
394
}
395
#else
396 416
target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
397 417
{
398 418
    uint32_t phys_addr;
......
402 422
        return -1;
403 423
    return phys_addr;
404 424
}
405
#endif
406 425

  
407 426
/* Perform address translation */
408 427
int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw,
......
523 542
    }
524 543
    return ret;
525 544
}
545
#endif
526 546

  
527 547
/*****************************************************************************/
528 548
/* BATs management */

Also available in: Unified diff