#error "Please select which OpenPic implementation is to be emulated"
#endif
+#define OPENPIC_PAGE_SIZE 4096
+
#define BF_WIDTH(_bits_) \
(((_bits_) + (sizeof(uint32_t) * 8) - 1) / (sizeof(uint32_t) * 8))
DPRINTF("%s: addr " TARGET_FMT_plx " <= %08x\n", __func__, addr, val);
if (addr & 0xF)
return;
-#if defined TARGET_WORDS_BIGENDIAN
val = openpic_swap32(opp, val);
-#endif
addr &= 0xFF;
switch (addr) {
case 0x00: /* FREP */
break;
}
DPRINTF("%s: => %08x\n", __func__, retval);
-#if defined TARGET_WORDS_BIGENDIAN
retval = openpic_swap32(opp, retval);
-#endif
return retval;
}
DPRINTF("%s: addr %08x <= %08x\n", __func__, addr, val);
if (addr & 0xF)
return;
-#if defined TARGET_WORDS_BIGENDIAN
val = openpic_swap32(opp, val);
-#endif
addr -= 0x1100;
addr &= 0xFFFF;
idx = (addr & 0xFFF0) >> 6;
break;
}
DPRINTF("%s: => %08x\n", __func__, retval);
-#if defined TARGET_WORDS_BIGENDIAN
retval = openpic_swap32(opp, retval);
-#endif
return retval;
}
DPRINTF("%s: addr %08x <= %08x\n", __func__, addr, val);
if (addr & 0xF)
return;
-#if defined TARGET_WORDS_BIGENDIAN
val = openpic_swap32(opp, val);
-#endif
addr = addr & 0xFFF0;
idx = addr >> 5;
if (addr & 0x10) {
retval = read_IRQreg(opp, idx, IRQ_IPVP);
}
DPRINTF("%s: => %08x\n", __func__, retval);
-#if defined TARGET_WORDS_BIGENDIAN
retval = openpic_swap32(opp, retval);
-#endif
return retval;
}
DPRINTF("%s: addr " TARGET_FMT_plx " <= %08x\n", __func__, addr, val);
if (addr & 0xF)
return;
-#if defined TARGET_WORDS_BIGENDIAN
val = openpic_swap32(opp, val);
-#endif
addr &= 0x1FFF0;
idx = addr / 0x1000;
dst = &opp->dst[idx];
break;
}
DPRINTF("%s: => %08x\n", __func__, retval);
-#if defined TARGET_WORDS_BIGENDIAN
retval = openpic_swap32(opp, retval);
-#endif
return retval;
}
if (addr & 0xF)
return;
- addr -= MPIC_EXT_REG_START & (TARGET_PAGE_SIZE - 1);
+ addr -= MPIC_EXT_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_EXT_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
if (addr & 0xF)
return retval;
- addr -= MPIC_EXT_REG_START & (TARGET_PAGE_SIZE - 1);
+ addr -= MPIC_EXT_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_EXT_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
if (addr & 0xF)
return;
- addr -= MPIC_INT_REG_START & (TARGET_PAGE_SIZE - 1);
+ addr -= MPIC_INT_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_INT_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
if (addr & 0xF)
return retval;
- addr -= MPIC_INT_REG_START & (TARGET_PAGE_SIZE - 1);
+ addr -= MPIC_INT_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_INT_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
if (addr & 0xF)
return;
- addr -= MPIC_MSG_REG_START & (TARGET_PAGE_SIZE - 1);
+ addr -= MPIC_MSG_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_MSG_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
if (addr & 0xF)
return retval;
- addr -= MPIC_MSG_REG_START & (TARGET_PAGE_SIZE - 1);
+ addr -= MPIC_MSG_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_MSG_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
if (addr & 0xF)
return;
- addr -= MPIC_MSI_REG_START & (TARGET_PAGE_SIZE - 1);
+ addr -= MPIC_MSI_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_MSI_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
if (addr & 0xF)
return retval;
- addr -= MPIC_MSI_REG_START & (TARGET_PAGE_SIZE - 1);
+ addr -= MPIC_MSI_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_MSI_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {