Revision 629bd516 target-ppc/mmu-hash32.c
b/target-ppc/mmu-hash32.c | ||
---|---|---|
158 | 158 |
return ret; |
159 | 159 |
} |
160 | 160 |
|
161 |
int get_segment32(CPUPPCState *env, mmu_ctx_t *ctx, |
|
162 |
target_ulong eaddr, int rw, int type) |
|
161 |
static int get_segment32(CPUPPCState *env, mmu_ctx_t *ctx,
|
|
162 |
target_ulong eaddr, int rw, int type)
|
|
163 | 163 |
{ |
164 | 164 |
hwaddr hash; |
165 | 165 |
target_ulong vsid; |
... | ... | |
302 | 302 |
|
303 | 303 |
return ret; |
304 | 304 |
} |
305 |
|
|
306 |
int ppc_hash32_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx, |
|
307 |
target_ulong eaddr, int rw, int access_type) |
|
308 |
{ |
|
309 |
bool real_mode = (access_type == ACCESS_CODE && msr_ir == 0) |
|
310 |
|| (access_type != ACCESS_CODE && msr_dr == 0); |
|
311 |
|
|
312 |
if (real_mode) { |
|
313 |
ctx->raddr = eaddr; |
|
314 |
ctx->prot = PAGE_READ | PAGE_EXEC | PAGE_WRITE; |
|
315 |
return 0; |
|
316 |
} else { |
|
317 |
int ret = -1; |
|
318 |
|
|
319 |
/* Try to find a BAT */ |
|
320 |
if (env->nb_BATs != 0) { |
|
321 |
ret = get_bat(env, ctx, eaddr, rw, access_type); |
|
322 |
} |
|
323 |
if (ret < 0) { |
|
324 |
/* We didn't match any BAT entry or don't have BATs */ |
|
325 |
ret = get_segment32(env, ctx, eaddr, rw, access_type); |
|
326 |
} |
|
327 |
return ret; |
|
328 |
} |
|
329 |
} |
Also available in: Unified diff