DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height,

                                                    pixman_format_code_t format,

                                                    int linesize, uint64_t addr)

{

    DisplaySurface *surface;

    hwaddr size;

    void *data;



    if (linesize == 0) {

        linesize = width * PIXMAN_FORMAT_BPP(format) / 8;

    }



    size = linesize * height;

    data = cpu_physical_memory_map(addr, &size, 0);

    if (size != linesize * height) {

        cpu_physical_memory_unmap(data, size, 0, 0);

        return NULL;

    }



    surface = qemu_create_displaysurface_from

        (width, height, format, linesize, data);

    pixman_image_set_destroy_function

        (surface->image, qemu_unmap_displaysurface_guestmem, NULL);



    return surface;

}

DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height,

                                                    pixman_format_code_t format,

                                                    int linesize, uint64_t addr)

{

    DisplaySurface *surface;

    hwaddr size;

    void *data;



    if (linesize == 0) {

        linesize = width * PIXMAN_FORMAT_BPP(format) / 8;

    }



    size = linesize * height;

    data = cpu_physical_memory_map(addr, &size, 0);

    if (size != linesize * height) {

        cpu_physical_memory_unmap(data, size, 0, 0);

        return NULL;

    }



    surface = qemu_create_displaysurface_from

        (width, height, format, linesize, data);

    pixman_image_set_destroy_function

        (surface->image, qemu_unmap_displaysurface_guestmem, NULL);



    return surface;

}

    size = linesize * height;     if (size != linesize * height) {
DisplaySurface *FUNC_0(int width, int height,

                                                    pixman_format_code_t format,

                                                    int linesize, uint64_t addr)

{

    DisplaySurface *surface;

    hwaddr size;

    void *VAR_0;



    if (linesize == 0) {

        linesize = width * PIXMAN_FORMAT_BPP(format) / 8;

    }



    size = linesize * height;

    VAR_0 = cpu_physical_memory_map(addr, &size, 0);

    if (size != linesize * height) {

        cpu_physical_memory_unmap(VAR_0, size, 0, 0);

        return NULL;

    }



    surface = qemu_create_displaysurface_from

        (width, height, format, linesize, VAR_0);

    pixman_image_set_destroy_function

        (surface->image, qemu_unmap_displaysurface_guestmem, NULL);



    return surface;

}

DisplaySurface *FUNC_0(int width, int height,
pixman_format_code_t format,
int linesize, uint64_t addr)
{ DisplaySurface *surface; hwaddr size; void *VAR_0; if (linesize == 0) { linesize = width * PIXMAN_FORMAT_BPP(format) / 8; } size = linesize * height; VAR_0 = cpu_physical_memory_map(addr, &size, 0); if (size != linesize * height) { cpu_physical_memory_unmap(VAR_0, size, 0, 0); return NULL; } surface = qemu_create_displaysurface_from
(width, height, format, linesize, VAR_0); pixman_image_set_destroy_function
(surface->image, qemu_unmap_displaysurface_guestmem, NULL); return surface; }