static int fb_initialise(struct XenDevice *xendev)

{

    struct XenFB *fb = container_of(xendev, struct XenFB, c.xendev);

    struct xenfb_page *fb_page;

    int videoram;

    int rc;



    if (xenstore_read_fe_int(xendev, "videoram", &videoram) == -1)

	videoram = 0;



    rc = common_bind(&fb->c);

    if (rc != 0)

	return rc;



    fb_page = fb->c.page;

    rc = xenfb_configure_fb(fb, videoram * 1024 * 1024U,

			    fb_page->width, fb_page->height, fb_page->depth,

			    fb_page->mem_length, 0, fb_page->line_length);

    if (rc != 0)

	return rc;



    rc = xenfb_map_fb(fb);

    if (rc != 0)

	return rc;



#if 0  /* handled in xen_init_display() for now */

    if (!fb->have_console) {

        fb->c.ds = graphic_console_init(xenfb_update,

                                        xenfb_invalidate,

                                        NULL,

                                        NULL,

                                        fb);

        fb->have_console = 1;

    }

#endif



    if (xenstore_read_fe_int(xendev, "feature-update", &fb->feature_update) == -1)

	fb->feature_update = 0;

    if (fb->feature_update)

	xenstore_write_be_int(xendev, "request-update", 1);



    xen_pv_printf(xendev, 1, "feature-update=%d, videoram=%d\n",

		  fb->feature_update, videoram);

    return 0;

}

static int fb_initialise(struct XenDevice *xendev)

{

    struct XenFB *fb = container_of(xendev, struct XenFB, c.xendev);

    struct xenfb_page *fb_page;

    int videoram;

    int rc;



    if (xenstore_read_fe_int(xendev, "videoram", &videoram) == -1)

	videoram = 0;



    rc = common_bind(&fb->c);

    if (rc != 0)

	return rc;



    fb_page = fb->c.page;

    rc = xenfb_configure_fb(fb, videoram * 1024 * 1024U,

			    fb_page->width, fb_page->height, fb_page->depth,

			    fb_page->mem_length, 0, fb_page->line_length);

    if (rc != 0)

	return rc;



    rc = xenfb_map_fb(fb);

    if (rc != 0)

	return rc;



#if 0  

    if (!fb->have_console) {

        fb->c.ds = graphic_console_init(xenfb_update,

                                        xenfb_invalidate,

                                        NULL,

                                        NULL,

                                        fb);

        fb->have_console = 1;

    }

#endif



    if (xenstore_read_fe_int(xendev, "feature-update", &fb->feature_update) == -1)

	fb->feature_update = 0;

    if (fb->feature_update)

	xenstore_write_be_int(xendev, "request-update", 1);



    xen_pv_printf(xendev, 1, "feature-update=%d, videoram=%d\n",

		  fb->feature_update, videoram);

    return 0;

}

static int FUNC_0(struct XenDevice *VAR_0)

{

    struct XenFB *VAR_1 = container_of(VAR_0, struct XenFB, c.VAR_0);

    struct xenfb_page *VAR_2;

    int VAR_3;

    int VAR_4;



    if (xenstore_read_fe_int(VAR_0, "VAR_3", &VAR_3) == -1)

	VAR_3 = 0;



    VAR_4 = common_bind(&VAR_1->c);

    if (VAR_4 != 0)

	return VAR_4;



    VAR_2 = VAR_1->c.page;

    VAR_4 = xenfb_configure_fb(VAR_1, VAR_3 * 1024 * 1024U,

			    VAR_2->width, VAR_2->height, VAR_2->depth,

			    VAR_2->mem_length, 0, VAR_2->line_length);

    if (VAR_4 != 0)

	return VAR_4;



    VAR_4 = xenfb_map_fb(VAR_1);

    if (VAR_4 != 0)

	return VAR_4;



#if 0  

    if (!VAR_1->have_console) {

        VAR_1->c.ds = graphic_console_init(xenfb_update,

                                        xenfb_invalidate,

                                        NULL,

                                        NULL,

                                        VAR_1);

        VAR_1->have_console = 1;

    }

#endif



    if (xenstore_read_fe_int(VAR_0, "feature-update", &VAR_1->feature_update) == -1)

	VAR_1->feature_update = 0;

    if (VAR_1->feature_update)

	xenstore_write_be_int(VAR_0, "request-update", 1);



    xen_pv_printf(VAR_0, 1, "feature-update=%d, VAR_3=%d\n",

		  VAR_1->feature_update, VAR_3);

    return 0;

}

static int FUNC_0(struct XenDevice *VAR_0)
{ struct XenFB *VAR_1 = container_of(VAR_0, struct XenFB, c.VAR_0); struct xenfb_page *VAR_2; int VAR_3; int VAR_4; if (xenstore_read_fe_int(VAR_0, "VAR_3", &VAR_3) == -1)
VAR_3 = 0; VAR_4 = common_bind(&VAR_1->c); if (VAR_4 != 0)
return VAR_4; VAR_2 = VAR_1->c.page; VAR_4 = xenfb_configure_fb(VAR_1, VAR_3 * 1024 * 1024U,
VAR_2->width, VAR_2->height, VAR_2->depth,
VAR_2->mem_length, 0, VAR_2->line_length); if (VAR_4 != 0)
return VAR_4; VAR_4 = xenfb_map_fb(VAR_1); if (VAR_4 != 0)
return VAR_4; #if 0
if (!VAR_1->have_console) { VAR_1->c.ds = graphic_console_init(xenfb_update,
xenfb_invalidate,
NULL,
NULL,
VAR_1); VAR_1->have_console = 1; } #endif
if (xenstore_read_fe_int(VAR_0, "feature-update", &VAR_1->feature_update) == -1)
VAR_1->feature_update = 0; if (VAR_1->feature_update)
xenstore_write_be_int(VAR_0, "request-update", 1); xen_pv_printf(VAR_0, 1, "feature-update=%d, VAR_3=%d\n",
VAR_1->feature_update, VAR_3); return 0; }