static uint64_t openpic_msi_read(void *opaque, hwaddr addr, unsigned size)

{

    OpenPICState *opp = opaque;

    uint64_t r = 0;

    int i, srs;



    DPRINTF("%s: addr " TARGET_FMT_plx "\n", __func__, addr);

    if (addr & 0xF) {

        return -1;

    }



    srs = addr >> 4;



    switch (addr) {

    case 0x00:

    case 0x10:

    case 0x20:

    case 0x30:

    case 0x40:

    case 0x50:

    case 0x60:

    case 0x70: /* MSIRs */

        r = opp->msi[srs].msir;

        /* Clear on read */

        opp->msi[srs].msir = 0;

        break;

    case 0x120: /* MSISR */

        for (i = 0; i < MAX_MSI; i++) {

            r |= (opp->msi[i].msir ? 1 : 0) << i;

        }

        break;

    }



    return r;

}

static uint64_t openpic_msi_read(void *opaque, hwaddr addr, unsigned size)

{

    OpenPICState *opp = opaque;

    uint64_t r = 0;

    int i, srs;



    DPRINTF("%s: addr " TARGET_FMT_plx "\n", __func__, addr);

    if (addr & 0xF) {

        return -1;

    }



    srs = addr >> 4;



    switch (addr) {

    case 0x00:

    case 0x10:

    case 0x20:

    case 0x30:

    case 0x40:

    case 0x50:

    case 0x60:

    case 0x70: 

        r = opp->msi[srs].msir;

        

        opp->msi[srs].msir = 0;

        break;

    case 0x120: 

        for (i = 0; i < MAX_MSI; i++) {

            r |= (opp->msi[i].msir ? 1 : 0) << i;

        }

        break;

    }



    return r;

}

    DPRINTF("%s: addr " TARGET_FMT_plx "\n", __func__, addr);     DPRINTF("%s: addr " TARGET_FMT_plx "\n", __func__, addr);
static uint64_t FUNC_0(void *opaque, hwaddr addr, unsigned size)

{

    OpenPICState *opp = opaque;

    uint64_t r = 0;

    int VAR_0, VAR_1;



    DPRINTF("%s: addr " TARGET_FMT_plx "\n", __func__, addr);

    if (addr & 0xF) {

        return -1;

    }



    VAR_1 = addr >> 4;



    switch (addr) {

    case 0x00:

    case 0x10:

    case 0x20:

    case 0x30:

    case 0x40:

    case 0x50:

    case 0x60:

    case 0x70: 

        r = opp->msi[VAR_1].msir;

        

        opp->msi[VAR_1].msir = 0;

        break;

    case 0x120: 

        for (VAR_0 = 0; VAR_0 < MAX_MSI; VAR_0++) {

            r |= (opp->msi[VAR_0].msir ? 1 : 0) << VAR_0;

        }

        break;

    }



    return r;

}

static uint64_t FUNC_0(void *opaque, hwaddr addr, unsigned size)
{ OpenPICState *opp = opaque; uint64_t r = 0; int VAR_0, VAR_1; DPRINTF("%s: addr " TARGET_FMT_plx "\n", __func__, addr); if (addr & 0xF) { return -1; } VAR_1 = addr >> 4; switch (addr) { case 0x00:
case 0x10:
case 0x20:
case 0x30:
case 0x40:
case 0x50:
case 0x60:
case 0x70:
r = opp->msi[VAR_1].msir; opp->msi[VAR_1].msir = 0; break; case 0x120:
for (VAR_0 = 0; VAR_0 < MAX_MSI; VAR_0++) { r |= (opp->msi[VAR_0].msir ? 1 : 0) << VAR_0; } break; } return r; }