static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,

                                          sPAPRMachineState *spapr,

                                          uint32_t token, uint32_t nargs,

                                          target_ulong args,

                                          uint32_t nret, target_ulong rets)

{

    target_ulong parameter = rtas_ld(args, 0);

    target_ulong buffer = rtas_ld(args, 1);

    target_ulong length = rtas_ld(args, 2);

    target_ulong ret;



    switch (parameter) {

    case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: {

        char *param_val = g_strdup_printf("MaxEntCap=%d,"

                                          "DesMem=%llu,"

                                          "DesProcs=%d,"

                                          "MaxPlatProcs=%d",

                                          max_cpus,

                                          current_machine->ram_size / M_BYTE,

                                          smp_cpus,

                                          max_cpus);

        ret = sysparm_st(buffer, length, param_val, strlen(param_val) + 1);

        g_free(param_val);

        break;

    }

    case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE: {

        uint8_t param_val = DIAGNOSTICS_RUN_MODE_DISABLED;



        ret = sysparm_st(buffer, length, &param_val, sizeof(param_val));

        break;

    }

    case RTAS_SYSPARM_UUID:

        ret = sysparm_st(buffer, length, qemu_uuid, (qemu_uuid_set ? 16 : 0));

        break;

    default:

        ret = RTAS_OUT_NOT_SUPPORTED;

    }



    rtas_st(rets, 0, ret);

}

static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,

                                          sPAPRMachineState *spapr,

                                          uint32_t token, uint32_t nargs,

                                          target_ulong args,

                                          uint32_t nret, target_ulong rets)

{

    target_ulong parameter = rtas_ld(args, 0);

    target_ulong buffer = rtas_ld(args, 1);

    target_ulong length = rtas_ld(args, 2);

    target_ulong ret;



    switch (parameter) {

    case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: {

        char *param_val = g_strdup_printf("MaxEntCap=%d,"

                                          "DesMem=%llu,"

                                          "DesProcs=%d,"

                                          "MaxPlatProcs=%d",

                                          max_cpus,

                                          current_machine->ram_size / M_BYTE,

                                          smp_cpus,

                                          max_cpus);

        ret = sysparm_st(buffer, length, param_val, strlen(param_val) + 1);

        g_free(param_val);

        break;

    }

    case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE: {

        uint8_t param_val = DIAGNOSTICS_RUN_MODE_DISABLED;



        ret = sysparm_st(buffer, length, &param_val, sizeof(param_val));

        break;

    }

    case RTAS_SYSPARM_UUID:

        ret = sysparm_st(buffer, length, qemu_uuid, (qemu_uuid_set ? 16 : 0));

        break;

    default:

        ret = RTAS_OUT_NOT_SUPPORTED;

    }



    rtas_st(rets, 0, ret);

}

static void FUNC_0(PowerPCCPU *VAR_0,

                                          sPAPRMachineState *VAR_1,

                                          uint32_t VAR_2, uint32_t VAR_3,

                                          target_ulong VAR_4,

                                          uint32_t VAR_5, target_ulong VAR_6)

{

    target_ulong parameter = rtas_ld(VAR_4, 0);

    target_ulong buffer = rtas_ld(VAR_4, 1);

    target_ulong length = rtas_ld(VAR_4, 2);

    target_ulong ret;



    switch (parameter) {

    case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: {

        char *VAR_7 = g_strdup_printf("MaxEntCap=%d,"

                                          "DesMem=%llu,"

                                          "DesProcs=%d,"

                                          "MaxPlatProcs=%d",

                                          max_cpus,

                                          current_machine->ram_size / M_BYTE,

                                          smp_cpus,

                                          max_cpus);

        ret = sysparm_st(buffer, length, VAR_7, strlen(VAR_7) + 1);

        g_free(VAR_7);

        break;

    }

    case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE: {

        uint8_t VAR_7 = DIAGNOSTICS_RUN_MODE_DISABLED;



        ret = sysparm_st(buffer, length, &VAR_7, sizeof(VAR_7));

        break;

    }

    case RTAS_SYSPARM_UUID:

        ret = sysparm_st(buffer, length, qemu_uuid, (qemu_uuid_set ? 16 : 0));

        break;

    default:

        ret = RTAS_OUT_NOT_SUPPORTED;

    }



    rtas_st(VAR_6, 0, ret);

}

static void FUNC_0(PowerPCCPU *VAR_0,
sPAPRMachineState *VAR_1,
uint32_t VAR_2, uint32_t VAR_3,
target_ulong VAR_4,
uint32_t VAR_5, target_ulong VAR_6)
{ target_ulong parameter = rtas_ld(VAR_4, 0); target_ulong buffer = rtas_ld(VAR_4, 1); target_ulong length = rtas_ld(VAR_4, 2); target_ulong ret; switch (parameter) { case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: { char *VAR_7 = g_strdup_printf("MaxEntCap=%d,"
"DesMem=%llu,"
"DesProcs=%d,"
"MaxPlatProcs=%d",
max_cpus,
current_machine->ram_size / M_BYTE,
smp_cpus,
max_cpus); ret = sysparm_st(buffer, length, VAR_7, strlen(VAR_7) + 1); g_free(VAR_7); break; } case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE: { uint8_t VAR_7 = DIAGNOSTICS_RUN_MODE_DISABLED; ret = sysparm_st(buffer, length, &VAR_7, sizeof(VAR_7)); break; } case RTAS_SYSPARM_UUID:
ret = sysparm_st(buffer, length, qemu_uuid, (qemu_uuid_set ? 16 : 0)); break; default:
ret = RTAS_OUT_NOT_SUPPORTED; } rtas_st(VAR_6, 0, ret); }