static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu,

                                  int smt_threads)

{

    int i, ret = 0;

    uint32_t servers_prop[smt_threads];

    uint32_t gservers_prop[smt_threads * 2];

    int index = ppc_get_vcpu_dt_id(cpu);



    if (cpu->cpu_version) {

        ret = fdt_setprop(fdt, offset, "cpu-version",

                          &cpu->cpu_version, sizeof(cpu->cpu_version));

        if (ret < 0) {

            return ret;

        }

    }



    /* Build interrupt servers and gservers properties */

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

        servers_prop[i] = cpu_to_be32(index + i);

        /* Hack, direct the group queues back to cpu 0 */

        gservers_prop[i*2] = cpu_to_be32(index + i);

        gservers_prop[i*2 + 1] = 0;

    }

    ret = fdt_setprop(fdt, offset, "ibm,ppc-interrupt-server#s",

                      servers_prop, sizeof(servers_prop));

    if (ret < 0) {

        return ret;

    }

    ret = fdt_setprop(fdt, offset, "ibm,ppc-interrupt-gserver#s",

                      gservers_prop, sizeof(gservers_prop));



    return ret;

}

static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu,

                                  int smt_threads)

{

    int i, ret = 0;

    uint32_t servers_prop[smt_threads];

    uint32_t gservers_prop[smt_threads * 2];

    int index = ppc_get_vcpu_dt_id(cpu);



    if (cpu->cpu_version) {

        ret = fdt_setprop(fdt, offset, "cpu-version",

                          &cpu->cpu_version, sizeof(cpu->cpu_version));

        if (ret < 0) {

            return ret;

        }

    }



    

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

        servers_prop[i] = cpu_to_be32(index + i);

        

        gservers_prop[i*2] = cpu_to_be32(index + i);

        gservers_prop[i*2 + 1] = 0;

    }

    ret = fdt_setprop(fdt, offset, "ibm,ppc-interrupt-server#s",

                      servers_prop, sizeof(servers_prop));

    if (ret < 0) {

        return ret;

    }

    ret = fdt_setprop(fdt, offset, "ibm,ppc-interrupt-gserver#s",

                      gservers_prop, sizeof(gservers_prop));



    return ret;

}

        ret = fdt_setprop(fdt, offset, "cpu-version",                           &cpu->cpu_version, sizeof(cpu->cpu_version));
static int FUNC_0(void *VAR_0, int VAR_1, PowerPCCPU *VAR_2,

                                  int VAR_3)

{

    int VAR_4, VAR_5 = 0;

    uint32_t servers_prop[VAR_3];

    uint32_t gservers_prop[VAR_3 * 2];

    int VAR_6 = ppc_get_vcpu_dt_id(VAR_2);



    if (VAR_2->cpu_version) {

        VAR_5 = fdt_setprop(VAR_0, VAR_1, "VAR_2-version",

                          &VAR_2->cpu_version, sizeof(VAR_2->cpu_version));

        if (VAR_5 < 0) {

            return VAR_5;

        }

    }



    

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

        servers_prop[VAR_4] = cpu_to_be32(VAR_6 + VAR_4);

        

        gservers_prop[VAR_4*2] = cpu_to_be32(VAR_6 + VAR_4);

        gservers_prop[VAR_4*2 + 1] = 0;

    }

    VAR_5 = fdt_setprop(VAR_0, VAR_1, "ibm,ppc-interrupt-server#s",

                      servers_prop, sizeof(servers_prop));

    if (VAR_5 < 0) {

        return VAR_5;

    }

    VAR_5 = fdt_setprop(VAR_0, VAR_1, "ibm,ppc-interrupt-gserver#s",

                      gservers_prop, sizeof(gservers_prop));



    return VAR_5;

}

static int FUNC_0(void *VAR_0, int VAR_1, PowerPCCPU *VAR_2,
int VAR_3)
{ int VAR_4, VAR_5 = 0; uint32_t servers_prop[VAR_3]; uint32_t gservers_prop[VAR_3 * 2]; int VAR_6 = ppc_get_vcpu_dt_id(VAR_2); if (VAR_2->cpu_version) { VAR_5 = fdt_setprop(VAR_0, VAR_1, "VAR_2-version",
&VAR_2->cpu_version, sizeof(VAR_2->cpu_version)); if (VAR_5 < 0) { return VAR_5; } } for (VAR_4 = 0; VAR_4 < VAR_3; VAR_4++) { servers_prop[VAR_4] = cpu_to_be32(VAR_6 + VAR_4); gservers_prop[VAR_4*2] = cpu_to_be32(VAR_6 + VAR_4); gservers_prop[VAR_4*2 + 1] = 0; } VAR_5 = fdt_setprop(VAR_0, VAR_1, "ibm,ppc-interrupt-server#s",
servers_prop, sizeof(servers_prop)); if (VAR_5 < 0) { return VAR_5; } VAR_5 = fdt_setprop(VAR_0, VAR_1, "ibm,ppc-interrupt-gserver#s",
gservers_prop, sizeof(gservers_prop)); return VAR_5; }