Revision 4c4f0e48 hw/openpic.c
b/hw/openpic.c | ||
---|---|---|
43 | 43 |
//#define DEBUG_OPENPIC |
44 | 44 |
|
45 | 45 |
#ifdef DEBUG_OPENPIC |
46 |
#define DPRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0)
|
|
46 |
static const int debug_openpic = 1;
|
|
47 | 47 |
#else |
48 |
#define DPRINTF(fmt, ...) do { } while (0)
|
|
48 |
static const int debug_openpic = 0;
|
|
49 | 49 |
#endif |
50 | 50 |
|
51 |
#define DPRINTF(fmt, ...) do { \ |
|
52 |
if (debug_openpic) { \ |
|
53 |
printf(fmt , ## __VA_ARGS__); \ |
|
54 |
} \ |
|
55 |
} while (0) |
|
56 |
|
|
51 | 57 |
#define MAX_CPU 15 |
52 | 58 |
#define MAX_SRC 256 |
53 | 59 |
#define MAX_TMR 4 |
... | ... | |
422 | 428 |
IRQSource *src; |
423 | 429 |
|
424 | 430 |
src = &opp->src[n_IRQ]; |
425 |
DPRINTF("openpic: set irq %d = %d ipvp=%08x\n", |
|
431 |
DPRINTF("openpic: set irq %d = %d ipvp=0x%08x\n",
|
|
426 | 432 |
n_IRQ, level, src->ipvp); |
427 | 433 |
if (src->ipvp & IPVP_SENSE_MASK) { |
428 | 434 |
/* level-sensitive irq */ |
... | ... | |
513 | 519 |
IRQDest *dst; |
514 | 520 |
int idx; |
515 | 521 |
|
516 |
DPRINTF("%s: addr " TARGET_FMT_plx " <= %08x\n", __func__, addr, val); |
|
522 |
DPRINTF("%s: addr %#" HWADDR_PRIx " <= %08" PRIx64 "\n", |
|
523 |
__func__, addr, val); |
|
517 | 524 |
if (addr & 0xF) { |
518 | 525 |
return; |
519 | 526 |
} |
... | ... | |
576 | 583 |
OpenPICState *opp = opaque; |
577 | 584 |
uint32_t retval; |
578 | 585 |
|
579 |
DPRINTF("%s: addr " TARGET_FMT_plx "\n", __func__, addr);
|
|
586 |
DPRINTF("%s: addr %#" HWADDR_PRIx "\n", __func__, addr);
|
|
580 | 587 |
retval = 0xFFFFFFFF; |
581 | 588 |
if (addr & 0xF) { |
582 | 589 |
return retval; |
... | ... | |
623 | 630 |
default: |
624 | 631 |
break; |
625 | 632 |
} |
626 |
DPRINTF("%s: => %08x\n", __func__, retval); |
|
633 |
DPRINTF("%s: => 0x%08x\n", __func__, retval);
|
|
627 | 634 |
|
628 | 635 |
return retval; |
629 | 636 |
} |
... | ... | |
634 | 641 |
OpenPICState *opp = opaque; |
635 | 642 |
int idx; |
636 | 643 |
|
637 |
DPRINTF("%s: addr %08x <= %08x\n", __func__, addr, val); |
|
644 |
DPRINTF("%s: addr %#" HWADDR_PRIx " <= %08" PRIx64 "\n", |
|
645 |
__func__, addr, val); |
|
638 | 646 |
if (addr & 0xF) { |
639 | 647 |
return; |
640 | 648 |
} |
... | ... | |
672 | 680 |
uint32_t retval = -1; |
673 | 681 |
int idx; |
674 | 682 |
|
675 |
DPRINTF("%s: addr %08x\n", __func__, addr);
|
|
683 |
DPRINTF("%s: addr %#" HWADDR_PRIx "\n", __func__, addr);
|
|
676 | 684 |
if (addr & 0xF) { |
677 | 685 |
goto out; |
678 | 686 |
} |
... | ... | |
698 | 706 |
} |
699 | 707 |
|
700 | 708 |
out: |
701 |
DPRINTF("%s: => %08x\n", __func__, retval); |
|
709 |
DPRINTF("%s: => 0x%08x\n", __func__, retval);
|
|
702 | 710 |
|
703 | 711 |
return retval; |
704 | 712 |
} |
... | ... | |
709 | 717 |
OpenPICState *opp = opaque; |
710 | 718 |
int idx; |
711 | 719 |
|
712 |
DPRINTF("%s: addr %08x <= %08x\n", __func__, addr, val); |
|
720 |
DPRINTF("%s: addr %#" HWADDR_PRIx " <= %08" PRIx64 "\n", |
|
721 |
__func__, addr, val); |
|
713 | 722 |
if (addr & 0xF) { |
714 | 723 |
return; |
715 | 724 |
} |
... | ... | |
730 | 739 |
uint32_t retval; |
731 | 740 |
int idx; |
732 | 741 |
|
733 |
DPRINTF("%s: addr %08x\n", __func__, addr);
|
|
742 |
DPRINTF("%s: addr %#" HWADDR_PRIx "\n", __func__, addr);
|
|
734 | 743 |
retval = 0xFFFFFFFF; |
735 | 744 |
if (addr & 0xF) { |
736 | 745 |
return retval; |
... | ... | |
744 | 753 |
/* EXVP / IFEVP / IEEVP */ |
745 | 754 |
retval = read_IRQreg_ipvp(opp, idx); |
746 | 755 |
} |
747 |
DPRINTF("%s: => %08x\n", __func__, retval); |
|
756 |
DPRINTF("%s: => 0x%08x\n", __func__, retval);
|
|
748 | 757 |
|
749 | 758 |
return retval; |
750 | 759 |
} |
... | ... | |
756 | 765 |
int idx = opp->irq_msi; |
757 | 766 |
int srs, ibs; |
758 | 767 |
|
759 |
DPRINTF("%s: addr " TARGET_FMT_plx " <= %08x\n", __func__, addr, val); |
|
768 |
DPRINTF("%s: addr %#" HWADDR_PRIx " <= 0x%08" PRIx64 "\n", |
|
769 |
__func__, addr, val); |
|
760 | 770 |
if (addr & 0xF) { |
761 | 771 |
return; |
762 | 772 |
} |
... | ... | |
781 | 791 |
uint64_t r = 0; |
782 | 792 |
int i, srs; |
783 | 793 |
|
784 |
DPRINTF("%s: addr " TARGET_FMT_plx "\n", __func__, addr);
|
|
794 |
DPRINTF("%s: addr %#" HWADDR_PRIx "\n", __func__, addr);
|
|
785 | 795 |
if (addr & 0xF) { |
786 | 796 |
return -1; |
787 | 797 |
} |
... | ... | |
819 | 829 |
IRQDest *dst; |
820 | 830 |
int s_IRQ, n_IRQ; |
821 | 831 |
|
822 |
DPRINTF("%s: cpu %d addr " TARGET_FMT_plx " <= %08x\n", __func__, idx,
|
|
832 |
DPRINTF("%s: cpu %d addr %#" HWADDR_PRIx " <= 0x%08x\n", __func__, idx,
|
|
823 | 833 |
addr, val); |
824 | 834 |
|
825 | 835 |
if (idx < 0) { |
... | ... | |
890 | 900 |
uint32_t retval; |
891 | 901 |
int n_IRQ; |
892 | 902 |
|
893 |
DPRINTF("%s: cpu %d addr " TARGET_FMT_plx "\n", __func__, idx, addr);
|
|
903 |
DPRINTF("%s: cpu %d addr %#" HWADDR_PRIx "\n", __func__, idx, addr);
|
|
894 | 904 |
retval = 0xFFFFFFFF; |
895 | 905 |
|
896 | 906 |
if (idx < 0) { |
... | ... | |
958 | 968 |
default: |
959 | 969 |
break; |
960 | 970 |
} |
961 |
DPRINTF("%s: => %08x\n", __func__, retval); |
|
971 |
DPRINTF("%s: => 0x%08x\n", __func__, retval);
|
|
962 | 972 |
|
963 | 973 |
return retval; |
964 | 974 |
} |
Also available in: Unified diff