Revision 4b3686fa target-ppc/helper.c
b/target-ppc/helper.c | ||
---|---|---|
28 | 28 |
//#define DEBUG_EXCEPTIONS |
29 | 29 |
|
30 | 30 |
extern FILE *stdout, *stderr; |
31 |
void abort (void); |
|
32 |
|
|
33 |
/*****************************************************************************/ |
|
34 | 31 |
|
35 | 32 |
/*****************************************************************************/ |
36 | 33 |
/* PPC MMU emulation */ |
... | ... | |
365 | 362 |
fprintf(logfile, "%s\n", __func__); |
366 | 363 |
} |
367 | 364 |
|
368 |
if ((access_type == ACCESS_CODE && msr_ir == 0) || msr_dr == 0) { |
|
365 |
if ((access_type == ACCESS_CODE && msr_ir == 0) || |
|
366 |
(access_type != ACCESS_CODE && msr_dr == 0)) { |
|
369 | 367 |
/* No address translation */ |
370 | 368 |
*physical = address & ~0xFFF; |
371 | 369 |
*prot = PAGE_READ | PAGE_WRITE; |
... | ... | |
441 | 439 |
index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); |
442 | 440 |
tlb_addrr = env->tlb_read[is_user][index].address; |
443 | 441 |
tlb_addrw = env->tlb_write[is_user][index].address; |
444 |
#if 0 |
|
445 |
printf("%s 1 %p %p idx=%d addr=0x%08lx tbl_addr=0x%08lx 0x%08lx " |
|
442 |
#if 1 |
|
443 |
if (loglevel) { |
|
444 |
fprintf(logfile, |
|
445 |
"%s 1 %p %p idx=%d addr=0x%08lx tbl_addr=0x%08lx 0x%08lx " |
|
446 | 446 |
"(0x%08lx 0x%08lx)\n", __func__, env, |
447 | 447 |
&env->tlb_read[is_user][index], index, addr, |
448 | 448 |
tlb_addrr, tlb_addrw, addr & TARGET_PAGE_MASK, |
449 | 449 |
tlb_addrr & (TARGET_PAGE_MASK | TLB_INVALID_MASK)); |
450 |
} |
|
450 | 451 |
#endif |
451 | 452 |
} |
452 | 453 |
ret = cpu_ppc_handle_mmu_fault(env, addr, is_write, is_user, 1); |
... | ... | |
631 | 632 |
|
632 | 633 |
void _store_msr (CPUState *env, uint32_t value) |
633 | 634 |
{ |
635 |
#if 0 // TRY |
|
634 | 636 |
if (((value >> MSR_IR) & 0x01) != msr_ir || |
635 |
((value >> MSR_DR) & 0x01) != msr_dr) { |
|
637 |
((value >> MSR_DR) & 0x01) != msr_dr) |
|
638 |
{ |
|
636 | 639 |
/* Flush all tlb when changing translation mode or privilege level */ |
637 | 640 |
tlb_flush(env, 1); |
638 | 641 |
} |
642 |
#endif |
|
639 | 643 |
msr_pow = (value >> MSR_POW) & 0x03; |
640 | 644 |
msr_ile = (value >> MSR_ILE) & 0x01; |
641 | 645 |
msr_ee = (value >> MSR_EE) & 0x01; |
... | ... | |
699 | 703 |
goto store_next; |
700 | 704 |
case EXCP_MACHINE_CHECK: |
701 | 705 |
if (msr_me == 0) { |
702 |
printf("Machine check exception while not allowed !\n"); |
|
703 |
if (loglevel) { |
|
704 |
fprintf(logfile, |
|
705 |
"Machine check exception while not allowed !\n"); |
|
706 |
cpu_abort(env, "Machine check exception while not allowed\n"); |
|
706 | 707 |
} |
707 |
abort(); |
|
708 |
} |
|
709 | 708 |
msr_me = 0; |
710 | 709 |
break; |
711 | 710 |
case EXCP_DSI: |
... | ... | |
801 | 800 |
env->fpscr[7] |= 0x4; |
802 | 801 |
break; |
803 | 802 |
case EXCP_INVAL: |
804 |
printf("Invalid instruction at 0x%08x\n", env->nip); |
|
803 |
// printf("Invalid instruction at 0x%08x\n", env->nip);
|
|
805 | 804 |
msr |= 0x00080000; |
806 | 805 |
break; |
807 | 806 |
case EXCP_PRIV: |
Also available in: Unified diff