36 |
/*****************************************************************************/ |
/*****************************************************************************/ |
37 |
/* PowerPC MMU emulation */ |
/* PowerPC MMU emulation */ |
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 |
65 |
/* Perform BAT hit & translation */ |
/* Perform BAT hit & translation */ |
66 |
static int get_bat (CPUState *env, uint32_t *real, int *prot, |
static int get_bat (CPUState *env, uint32_t *real, int *prot, |
67 |
uint32_t virtual, int rw, int type) |
uint32_t virtual, int rw, int type) |
381 |
return ret; |
return ret; |
382 |
} |
} |
383 |
|
|
384 |
int get_physical_address (CPUState *env, uint32_t *physical, int *prot, |
static int get_physical_address (CPUState *env, uint32_t *physical, int *prot, |
385 |
uint32_t address, int rw, int access_type) |
uint32_t address, int rw, int access_type) |
386 |
{ |
{ |
387 |
int ret; |
int ret; |
388 |
#if 0 |
#if 0 |
413 |
return ret; |
return ret; |
414 |
} |
} |
415 |
|
|
|
#if defined(CONFIG_USER_ONLY) |
|
|
target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr) |
|
|
{ |
|
|
return addr; |
|
|
} |
|
|
#else |
|
416 |
target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr) |
target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr) |
417 |
{ |
{ |
418 |
uint32_t phys_addr; |
uint32_t phys_addr; |
422 |
return -1; |
return -1; |
423 |
return phys_addr; |
return phys_addr; |
424 |
} |
} |
|
#endif |
|
425 |
|
|
426 |
/* Perform address translation */ |
/* Perform address translation */ |
427 |
int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw, |
int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw, |
542 |
} |
} |
543 |
return ret; |
return ret; |
544 |
} |
} |
545 |
|
#endif |
546 |
|
|
547 |
/*****************************************************************************/ |
/*****************************************************************************/ |
548 |
/* BATs management */ |
/* BATs management */ |