static void arm_gic_common_reset(DeviceState *dev)

{

    GICState *s = ARM_GIC_COMMON(dev);

    int i;

    memset(s->irq_state, 0, GIC_MAXIRQ * sizeof(gic_irq_state));

    for (i = 0 ; i < s->num_cpu; i++) {

        if (s->revision == REV_11MPCORE) {

            s->priority_mask[i] = 0xf0;

        } else {

            s->priority_mask[i] = 0;

        }

        s->current_pending[i] = 1023;

        s->running_irq[i] = 1023;

        s->running_priority[i] = 0x100;

        s->cpu_enabled[i] = false;

    }

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

        GIC_SET_ENABLED(i, ALL_CPU_MASK);

        GIC_SET_EDGE_TRIGGER(i);

    }

    if (s->num_cpu == 1) {

        /* For uniprocessor GICs all interrupts always target the sole CPU */

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

            s->irq_target[i] = 1;

        }

    }

    s->ctlr = 0;

}

static void arm_gic_common_reset(DeviceState *dev)

{

    GICState *s = ARM_GIC_COMMON(dev);

    int i;

    memset(s->irq_state, 0, GIC_MAXIRQ * sizeof(gic_irq_state));

    for (i = 0 ; i < s->num_cpu; i++) {

        if (s->revision == REV_11MPCORE) {

            s->priority_mask[i] = 0xf0;

        } else {

            s->priority_mask[i] = 0;

        }

        s->current_pending[i] = 1023;

        s->running_irq[i] = 1023;

        s->running_priority[i] = 0x100;

        s->cpu_enabled[i] = false;

    }

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

        GIC_SET_ENABLED(i, ALL_CPU_MASK);

        GIC_SET_EDGE_TRIGGER(i);

    }

    if (s->num_cpu == 1) {

        

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

            s->irq_target[i] = 1;

        }

    }

    s->ctlr = 0;

}

static void FUNC_0(DeviceState *VAR_0)

{

    GICState *s = ARM_GIC_COMMON(VAR_0);

    int VAR_1;

    memset(s->irq_state, 0, GIC_MAXIRQ * sizeof(gic_irq_state));

    for (VAR_1 = 0 ; VAR_1 < s->num_cpu; VAR_1++) {

        if (s->revision == REV_11MPCORE) {

            s->priority_mask[VAR_1] = 0xf0;

        } else {

            s->priority_mask[VAR_1] = 0;

        }

        s->current_pending[VAR_1] = 1023;

        s->running_irq[VAR_1] = 1023;

        s->running_priority[VAR_1] = 0x100;

        s->cpu_enabled[VAR_1] = false;

    }

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

        GIC_SET_ENABLED(VAR_1, ALL_CPU_MASK);

        GIC_SET_EDGE_TRIGGER(VAR_1);

    }

    if (s->num_cpu == 1) {

        

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

            s->irq_target[VAR_1] = 1;

        }

    }

    s->ctlr = 0;

}

static void FUNC_0(DeviceState *VAR_0)
{ GICState *s = ARM_GIC_COMMON(VAR_0); int VAR_1; memset(s->irq_state, 0, GIC_MAXIRQ * sizeof(gic_irq_state)); for (VAR_1 = 0 ; VAR_1 < s->num_cpu; VAR_1++) { if (s->revision == REV_11MPCORE) { s->priority_mask[VAR_1] = 0xf0; } else { s->priority_mask[VAR_1] = 0; } s->current_pending[VAR_1] = 1023; s->running_irq[VAR_1] = 1023; s->running_priority[VAR_1] = 0x100; s->cpu_enabled[VAR_1] = false; } for (VAR_1 = 0; VAR_1 < GIC_NR_SGIS; VAR_1++) { GIC_SET_ENABLED(VAR_1, ALL_CPU_MASK); GIC_SET_EDGE_TRIGGER(VAR_1); } if (s->num_cpu == 1) { for (VAR_1 = 0; VAR_1 < GIC_MAXIRQ; VAR_1++) { s->irq_target[VAR_1] = 1; } } s->ctlr = 0; }