static void mpic_reset (void *opaque)

{

    openpic_t *mpp = (openpic_t *)opaque;

    int i;



    mpp->glbc = 0x80000000;

    /* Initialise controller registers */

    mpp->frep = 0x004f0002;

    mpp->veni = VENI;

    mpp->pint = 0x00000000;

    mpp->spve = 0x0000FFFF;

    /* Initialise IRQ sources */

    for (i = 0; i < mpp->max_irq; i++) {

        mpp->src[i].ipvp = 0x80800000;

        mpp->src[i].ide  = 0x00000001;

    }

    /* Set IDE for IPIs to 0 so we don't get spurious interrupts */

    for (i = mpp->irq_ipi0; i < (mpp->irq_ipi0 + MAX_IPI); i++) {

        mpp->src[i].ide = 0;

    }

    /* Initialise IRQ destinations */

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

        mpp->dst[i].pctp      = 0x0000000F;

        mpp->dst[i].tfrr      = 0x00000000;

        memset(&mpp->dst[i].raised, 0, sizeof(IRQ_queue_t));

        mpp->dst[i].raised.next = -1;

        memset(&mpp->dst[i].servicing, 0, sizeof(IRQ_queue_t));

        mpp->dst[i].servicing.next = -1;

    }

    /* Initialise timers */

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

        mpp->timers[i].ticc = 0x00000000;

        mpp->timers[i].tibc = 0x80000000;

    }

    /* Go out of RESET state */

    mpp->glbc = 0x00000000;

}

static void mpic_reset (void *opaque)

{

    openpic_t *mpp = (openpic_t *)opaque;

    int i;



    mpp->glbc = 0x80000000;

    

    mpp->frep = 0x004f0002;

    mpp->veni = VENI;

    mpp->pint = 0x00000000;

    mpp->spve = 0x0000FFFF;

    

    for (i = 0; i < mpp->max_irq; i++) {

        mpp->src[i].ipvp = 0x80800000;

        mpp->src[i].ide  = 0x00000001;

    }

    

    for (i = mpp->irq_ipi0; i < (mpp->irq_ipi0 + MAX_IPI); i++) {

        mpp->src[i].ide = 0;

    }

    

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

        mpp->dst[i].pctp      = 0x0000000F;

        mpp->dst[i].tfrr      = 0x00000000;

        memset(&mpp->dst[i].raised, 0, sizeof(IRQ_queue_t));

        mpp->dst[i].raised.next = -1;

        memset(&mpp->dst[i].servicing, 0, sizeof(IRQ_queue_t));

        mpp->dst[i].servicing.next = -1;

    }

    

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

        mpp->timers[i].ticc = 0x00000000;

        mpp->timers[i].tibc = 0x80000000;

    }

    

    mpp->glbc = 0x00000000;

}

    mpp->frep = 0x004f0002;
static void FUNC_0 (void *VAR_0)

{

    openpic_t *mpp = (openpic_t *)VAR_0;

    int VAR_1;



    mpp->glbc = 0x80000000;

    

    mpp->frep = 0x004f0002;

    mpp->veni = VENI;

    mpp->pint = 0x00000000;

    mpp->spve = 0x0000FFFF;

    

    for (VAR_1 = 0; VAR_1 < mpp->max_irq; VAR_1++) {

        mpp->src[VAR_1].ipvp = 0x80800000;

        mpp->src[VAR_1].ide  = 0x00000001;

    }

    

    for (VAR_1 = mpp->irq_ipi0; VAR_1 < (mpp->irq_ipi0 + MAX_IPI); VAR_1++) {

        mpp->src[VAR_1].ide = 0;

    }

    

    for (VAR_1 = 0; VAR_1 < MAX_CPU; VAR_1++) {

        mpp->dst[VAR_1].pctp      = 0x0000000F;

        mpp->dst[VAR_1].tfrr      = 0x00000000;

        memset(&mpp->dst[VAR_1].raised, 0, sizeof(IRQ_queue_t));

        mpp->dst[VAR_1].raised.next = -1;

        memset(&mpp->dst[VAR_1].servicing, 0, sizeof(IRQ_queue_t));

        mpp->dst[VAR_1].servicing.next = -1;

    }

    

    for (VAR_1 = 0; VAR_1 < MAX_TMR; VAR_1++) {

        mpp->timers[VAR_1].ticc = 0x00000000;

        mpp->timers[VAR_1].tibc = 0x80000000;

    }

    

    mpp->glbc = 0x00000000;

}

static void FUNC_0 (void *VAR_0)
{ openpic_t *mpp = (openpic_t *)VAR_0; int VAR_1; mpp->glbc = 0x80000000; mpp->frep = 0x004f0002; mpp->veni = VENI; mpp->pint = 0x00000000; mpp->spve = 0x0000FFFF; for (VAR_1 = 0; VAR_1 < mpp->max_irq; VAR_1++) { mpp->src[VAR_1].ipvp = 0x80800000; mpp->src[VAR_1].ide  = 0x00000001; } for (VAR_1 = mpp->irq_ipi0; VAR_1 < (mpp->irq_ipi0 + MAX_IPI); VAR_1++) { mpp->src[VAR_1].ide = 0; } for (VAR_1 = 0; VAR_1 < MAX_CPU; VAR_1++) { mpp->dst[VAR_1].pctp      = 0x0000000F; mpp->dst[VAR_1].tfrr      = 0x00000000; memset(&mpp->dst[VAR_1].raised, 0, sizeof(IRQ_queue_t)); mpp->dst[VAR_1].raised.next = -1; memset(&mpp->dst[VAR_1].servicing, 0, sizeof(IRQ_queue_t)); mpp->dst[VAR_1].servicing.next = -1; } for (VAR_1 = 0; VAR_1 < MAX_TMR; VAR_1++) { mpp->timers[VAR_1].ticc = 0x00000000; mpp->timers[VAR_1].tibc = 0x80000000; } mpp->glbc = 0x00000000; }