int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,

                                 hwaddr rtas_size)

{

    int ret;

    int i;



    ret = fdt_add_mem_rsv(fdt, rtas_addr, rtas_size);

    if (ret < 0) {

        fprintf(stderr, "Couldn't add RTAS reserve entry: %s\n",

                fdt_strerror(ret));

        return ret;

    }



    ret = qemu_fdt_setprop_cell(fdt, "/rtas", "linux,rtas-base",

                                rtas_addr);

    if (ret < 0) {

        fprintf(stderr, "Couldn't add linux,rtas-base property: %s\n",

                fdt_strerror(ret));

        return ret;

    }



    ret = qemu_fdt_setprop_cell(fdt, "/rtas", "linux,rtas-entry",

                                rtas_addr);

    if (ret < 0) {

        fprintf(stderr, "Couldn't add linux,rtas-entry property: %s\n",

                fdt_strerror(ret));

        return ret;

    }



    ret = qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-size",

                                rtas_size);

    if (ret < 0) {

        fprintf(stderr, "Couldn't add rtas-size property: %s\n",

                fdt_strerror(ret));

        return ret;

    }



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

        struct rtas_call *call = &rtas_table[i];



        if (!call->name) {

            continue;

        }



        ret = qemu_fdt_setprop_cell(fdt, "/rtas", call->name,

                                    i + TOKEN_BASE);

        if (ret < 0) {

            fprintf(stderr, "Couldn't add rtas token for %s: %s\n",

                    call->name, fdt_strerror(ret));

            return ret;

        }



    }

    return 0;

}

int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,

                                 hwaddr rtas_size)

{

    int ret;

    int i;



    ret = fdt_add_mem_rsv(fdt, rtas_addr, rtas_size);

    if (ret < 0) {

        fprintf(stderr, "Couldn't add RTAS reserve entry: %s\n",

                fdt_strerror(ret));

        return ret;

    }



    ret = qemu_fdt_setprop_cell(fdt, "/rtas", "linux,rtas-base",

                                rtas_addr);

    if (ret < 0) {

        fprintf(stderr, "Couldn't add linux,rtas-base property: %s\n",

                fdt_strerror(ret));

        return ret;

    }



    ret = qemu_fdt_setprop_cell(fdt, "/rtas", "linux,rtas-entry",

                                rtas_addr);

    if (ret < 0) {

        fprintf(stderr, "Couldn't add linux,rtas-entry property: %s\n",

                fdt_strerror(ret));

        return ret;

    }



    ret = qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-size",

                                rtas_size);

    if (ret < 0) {

        fprintf(stderr, "Couldn't add rtas-size property: %s\n",

                fdt_strerror(ret));

        return ret;

    }



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

        struct rtas_call *call = &rtas_table[i];



        if (!call->name) {

            continue;

        }



        ret = qemu_fdt_setprop_cell(fdt, "/rtas", call->name,

                                    i + TOKEN_BASE);

        if (ret < 0) {

            fprintf(stderr, "Couldn't add rtas token for %s: %s\n",

                    call->name, fdt_strerror(ret));

            return ret;

        }



    }

    return 0;

}

    int i;     for (i = 0; i < TOKEN_MAX; i++) {                                     i + TOKEN_BASE);
int FUNC_0(void *VAR_0, hwaddr VAR_1,

                                 hwaddr VAR_2)

{

    int VAR_3;

    int VAR_4;



    VAR_3 = fdt_add_mem_rsv(VAR_0, VAR_1, VAR_2);

    if (VAR_3 < 0) {

        fprintf(stderr, "Couldn't add RTAS reserve entry: %s\n",

                fdt_strerror(VAR_3));

        return VAR_3;

    }



    VAR_3 = qemu_fdt_setprop_cell(VAR_0, "/rtas", "linux,rtas-base",

                                VAR_1);

    if (VAR_3 < 0) {

        fprintf(stderr, "Couldn't add linux,rtas-base property: %s\n",

                fdt_strerror(VAR_3));

        return VAR_3;

    }



    VAR_3 = qemu_fdt_setprop_cell(VAR_0, "/rtas", "linux,rtas-entry",

                                VAR_1);

    if (VAR_3 < 0) {

        fprintf(stderr, "Couldn't add linux,rtas-entry property: %s\n",

                fdt_strerror(VAR_3));

        return VAR_3;

    }



    VAR_3 = qemu_fdt_setprop_cell(VAR_0, "/rtas", "rtas-size",

                                VAR_2);

    if (VAR_3 < 0) {

        fprintf(stderr, "Couldn't add rtas-size property: %s\n",

                fdt_strerror(VAR_3));

        return VAR_3;

    }



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

        struct rtas_call *call = &rtas_table[VAR_4];



        if (!call->name) {

            continue;

        }



        VAR_3 = qemu_fdt_setprop_cell(VAR_0, "/rtas", call->name,

                                    VAR_4 + TOKEN_BASE);

        if (VAR_3 < 0) {

            fprintf(stderr, "Couldn't add rtas token for %s: %s\n",

                    call->name, fdt_strerror(VAR_3));

            return VAR_3;

        }



    }

    return 0;

}

int FUNC_0(void *VAR_0, hwaddr VAR_1,
hwaddr VAR_2)
{ int VAR_3; int VAR_4; VAR_3 = fdt_add_mem_rsv(VAR_0, VAR_1, VAR_2); if (VAR_3 < 0) { fprintf(stderr, "Couldn't add RTAS reserve entry: %s\n",
fdt_strerror(VAR_3)); return VAR_3; } VAR_3 = qemu_fdt_setprop_cell(VAR_0, "/rtas", "linux,rtas-base",
VAR_1); if (VAR_3 < 0) { fprintf(stderr, "Couldn't add linux,rtas-base property: %s\n",
fdt_strerror(VAR_3)); return VAR_3; } VAR_3 = qemu_fdt_setprop_cell(VAR_0, "/rtas", "linux,rtas-entry",
VAR_1); if (VAR_3 < 0) { fprintf(stderr, "Couldn't add linux,rtas-entry property: %s\n",
fdt_strerror(VAR_3)); return VAR_3; } VAR_3 = qemu_fdt_setprop_cell(VAR_0, "/rtas", "rtas-size",
VAR_2); if (VAR_3 < 0) { fprintf(stderr, "Couldn't add rtas-size property: %s\n",
fdt_strerror(VAR_3)); return VAR_3; } for (VAR_4 = 0; VAR_4 < TOKEN_MAX; VAR_4++) { struct rtas_call *call = &rtas_table[VAR_4]; if (!call->name) { continue; } VAR_3 = qemu_fdt_setprop_cell(VAR_0, "/rtas", call->name,
VAR_4 + TOKEN_BASE); if (VAR_3 < 0) { fprintf(stderr, "Couldn't add rtas token for %s: %s\n",
call->name, fdt_strerror(VAR_3)); return VAR_3; } } return 0; }