summaryrefslogtreecommitdiff
path: root/hw/display/xenfb.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2013-12-18 19:17:32 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2014-07-07 10:37:40 +0000
commit643f59322432d77165329dfabe2d040d7e30dae8 (patch)
tree768ec853126b43325b43f4dfa05ffa69a94961d0 /hw/display/xenfb.c
parent4aba9eb138e5d68c400de0b116f15217d7a92d3a (diff)
downloadqemu-643f59322432d77165329dfabe2d040d7e30dae8.zip
xen: build on ARM
Collection of fixes to build QEMU with Xen support on ARM: - use xenstore_read_fe_uint64 to retrieve the page-ref (xenfb); - use xen_pfn_t instead of unsigned long in xenfb; - unsigned long/xenpfn_t in xen_remove_from_physmap; - in xen-mapcache.c use HOST_LONG_BITS to check for QEMU's address space size. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/display/xenfb.c')
-rw-r--r--hw/display/xenfb.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 032eb7a9a5..07ddc9deba 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -93,10 +93,12 @@ struct XenFB {
static int common_bind(struct common *c)
{
- int mfn;
+ uint64_t mfn;
- if (xenstore_read_fe_int(&c->xendev, "page-ref", &mfn) == -1)
+ if (xenstore_read_fe_uint64(&c->xendev, "page-ref", &mfn) == -1)
return -1;
+ assert(mfn == (xen_pfn_t)mfn);
+
if (xenstore_read_fe_int(&c->xendev, "event-channel", &c->xendev.remote_port) == -1)
return -1;
@@ -107,7 +109,7 @@ static int common_bind(struct common *c)
return -1;
xen_be_bind_evtchn(&c->xendev);
- xen_be_printf(&c->xendev, 1, "ring mfn %d, remote-port %d, local-port %d\n",
+ xen_be_printf(&c->xendev, 1, "ring mfn %"PRIx64", remote-port %d, local-port %d\n",
mfn, c->xendev.remote_port, c->xendev.local_port);
return 0;
@@ -409,7 +411,7 @@ static void input_event(struct XenDevice *xendev)
/* -------------------------------------------------------------------- */
-static void xenfb_copy_mfns(int mode, int count, unsigned long *dst, void *src)
+static void xenfb_copy_mfns(int mode, int count, xen_pfn_t *dst, void *src)
{
uint32_t *src32 = src;
uint64_t *src64 = src;
@@ -424,8 +426,8 @@ static int xenfb_map_fb(struct XenFB *xenfb)
struct xenfb_page *page = xenfb->c.page;
char *protocol = xenfb->c.xendev.protocol;
int n_fbdirs;
- unsigned long *pgmfns = NULL;
- unsigned long *fbmfns = NULL;
+ xen_pfn_t *pgmfns = NULL;
+ xen_pfn_t *fbmfns = NULL;
void *map, *pd;
int mode, ret = -1;
@@ -483,8 +485,8 @@ static int xenfb_map_fb(struct XenFB *xenfb)
n_fbdirs = xenfb->fbpages * mode / 8;
n_fbdirs = (n_fbdirs + (XC_PAGE_SIZE - 1)) / XC_PAGE_SIZE;
- pgmfns = g_malloc0(sizeof(unsigned long) * n_fbdirs);
- fbmfns = g_malloc0(sizeof(unsigned long) * xenfb->fbpages);
+ pgmfns = g_malloc0(sizeof(xen_pfn_t) * n_fbdirs);
+ fbmfns = g_malloc0(sizeof(xen_pfn_t) * xenfb->fbpages);
xenfb_copy_mfns(mode, n_fbdirs, pgmfns, pd);
map = xc_map_foreign_pages(xen_xc, xenfb->c.xendev.dom,