static int openpic_load(QEMUFile* f, void *opaque, int version_id)

{

    OpenPICState *opp = (OpenPICState *)opaque;

    unsigned int i;



    if (version_id != 1)

        return -EINVAL;



    qemu_get_be32s(f, &opp->glbc);

    qemu_get_be32s(f, &opp->veni);

    qemu_get_be32s(f, &opp->pint);

    qemu_get_be32s(f, &opp->spve);

    qemu_get_be32s(f, &opp->tifr);



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

        qemu_get_be32s(f, &opp->src[i].ipvp);

        qemu_get_be32s(f, &opp->src[i].ide);

        qemu_get_sbe32s(f, &opp->src[i].last_cpu);

        qemu_get_sbe32s(f, &opp->src[i].pending);

    }



    qemu_get_be32s(f, &opp->nb_cpus);



    for (i = 0; i < opp->nb_cpus; i++) {

        qemu_get_be32s(f, &opp->dst[i].pctp);

        qemu_get_be32s(f, &opp->dst[i].pcsr);

        openpic_load_IRQ_queue(f, &opp->dst[i].raised);

        openpic_load_IRQ_queue(f, &opp->dst[i].servicing);

    }



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

        qemu_get_be32s(f, &opp->timers[i].ticc);

        qemu_get_be32s(f, &opp->timers[i].tibc);

    }



    return 0;

}

static int openpic_load(QEMUFile* f, void *opaque, int version_id)

{

    OpenPICState *opp = (OpenPICState *)opaque;

    unsigned int i;



    if (version_id != 1)

        return -EINVAL;



    qemu_get_be32s(f, &opp->glbc);

    qemu_get_be32s(f, &opp->veni);

    qemu_get_be32s(f, &opp->pint);

    qemu_get_be32s(f, &opp->spve);

    qemu_get_be32s(f, &opp->tifr);



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

        qemu_get_be32s(f, &opp->src[i].ipvp);

        qemu_get_be32s(f, &opp->src[i].ide);

        qemu_get_sbe32s(f, &opp->src[i].last_cpu);

        qemu_get_sbe32s(f, &opp->src[i].pending);

    }



    qemu_get_be32s(f, &opp->nb_cpus);



    for (i = 0; i < opp->nb_cpus; i++) {

        qemu_get_be32s(f, &opp->dst[i].pctp);

        qemu_get_be32s(f, &opp->dst[i].pcsr);

        openpic_load_IRQ_queue(f, &opp->dst[i].raised);

        openpic_load_IRQ_queue(f, &opp->dst[i].servicing);

    }



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

        qemu_get_be32s(f, &opp->timers[i].ticc);

        qemu_get_be32s(f, &opp->timers[i].tibc);

    }



    return 0;

}

static int FUNC_0(QEMUFile* VAR_0, void *VAR_1, int VAR_2)

{

    OpenPICState *opp = (OpenPICState *)VAR_1;

    unsigned int VAR_3;



    if (VAR_2 != 1)

        return -EINVAL;



    qemu_get_be32s(VAR_0, &opp->glbc);

    qemu_get_be32s(VAR_0, &opp->veni);

    qemu_get_be32s(VAR_0, &opp->pint);

    qemu_get_be32s(VAR_0, &opp->spve);

    qemu_get_be32s(VAR_0, &opp->tifr);



    for (VAR_3 = 0; VAR_3 < opp->max_irq; VAR_3++) {

        qemu_get_be32s(VAR_0, &opp->src[VAR_3].ipvp);

        qemu_get_be32s(VAR_0, &opp->src[VAR_3].ide);

        qemu_get_sbe32s(VAR_0, &opp->src[VAR_3].last_cpu);

        qemu_get_sbe32s(VAR_0, &opp->src[VAR_3].pending);

    }



    qemu_get_be32s(VAR_0, &opp->nb_cpus);



    for (VAR_3 = 0; VAR_3 < opp->nb_cpus; VAR_3++) {

        qemu_get_be32s(VAR_0, &opp->dst[VAR_3].pctp);

        qemu_get_be32s(VAR_0, &opp->dst[VAR_3].pcsr);

        openpic_load_IRQ_queue(VAR_0, &opp->dst[VAR_3].raised);

        openpic_load_IRQ_queue(VAR_0, &opp->dst[VAR_3].servicing);

    }



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

        qemu_get_be32s(VAR_0, &opp->timers[VAR_3].ticc);

        qemu_get_be32s(VAR_0, &opp->timers[VAR_3].tibc);

    }



    return 0;

}

static int FUNC_0(QEMUFile* VAR_0, void *VAR_1, int VAR_2)
{ OpenPICState *opp = (OpenPICState *)VAR_1; unsigned int VAR_3; if (VAR_2 != 1)
return -EINVAL; qemu_get_be32s(VAR_0, &opp->glbc); qemu_get_be32s(VAR_0, &opp->veni); qemu_get_be32s(VAR_0, &opp->pint); qemu_get_be32s(VAR_0, &opp->spve); qemu_get_be32s(VAR_0, &opp->tifr); for (VAR_3 = 0; VAR_3 < opp->max_irq; VAR_3++) { qemu_get_be32s(VAR_0, &opp->src[VAR_3].ipvp); qemu_get_be32s(VAR_0, &opp->src[VAR_3].ide); qemu_get_sbe32s(VAR_0, &opp->src[VAR_3].last_cpu); qemu_get_sbe32s(VAR_0, &opp->src[VAR_3].pending); } qemu_get_be32s(VAR_0, &opp->nb_cpus); for (VAR_3 = 0; VAR_3 < opp->nb_cpus; VAR_3++) { qemu_get_be32s(VAR_0, &opp->dst[VAR_3].pctp); qemu_get_be32s(VAR_0, &opp->dst[VAR_3].pcsr); openpic_load_IRQ_queue(VAR_0, &opp->dst[VAR_3].raised); openpic_load_IRQ_queue(VAR_0, &opp->dst[VAR_3].servicing); } for (VAR_3 = 0; VAR_3 < MAX_TMR; VAR_3++) { qemu_get_be32s(VAR_0, &opp->timers[VAR_3].ticc); qemu_get_be32s(VAR_0, &opp->timers[VAR_3].tibc); } return 0; }