direct-io.hg

changeset 13598:bc7363b9b892

bimodal xenfb daemon: Fixes and cleanups.
From: Gerd Hoffmann <kraxel@suse.de>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Jan 24 18:23:23 2007 +0000 (2007-01-24)
parents e68bf334ecb8
children e75107963846
files tools/xenfb/xenfb.c
line diff
     1.1 --- a/tools/xenfb/xenfb.c	Wed Jan 24 18:20:24 2007 +0000
     1.2 +++ b/tools/xenfb/xenfb.c	Wed Jan 24 18:23:23 2007 +0000
     1.3 @@ -362,12 +362,12 @@ static int xenfb_map_fb(struct xenfb_pri
     1.4  		 */
     1.5  		uint32_t *ptr32 = NULL;
     1.6  		uint32_t *ptr64 = NULL;
     1.7 -#if defined(__i386_)
     1.8 -		ptr32 = page->pd;
     1.9 +#if defined(__i386__)
    1.10 +		ptr32 = (void*)page->pd;
    1.11  		ptr64 = ((void*)page->pd) + 4;
    1.12  #elif defined(__x86_64__)
    1.13  		ptr32 = ((void*)page->pd) - 4;
    1.14 -		ptr64 = page->pd;
    1.15 +		ptr64 = (void*)page->pd;
    1.16  #endif
    1.17  		if (ptr32) {
    1.18  			if (0 == ptr32[1]) {
    1.19 @@ -383,7 +383,7 @@ static int xenfb_map_fb(struct xenfb_pri
    1.20  		/* 64bit dom0, 32bit domU */
    1.21  		mode = 32;
    1.22  		pd   = ((void*)page->pd) - 4;
    1.23 -#elif defined(__i386_)
    1.24 +#elif defined(__i386__)
    1.25  	} else if (0 == strcmp(xenfb->protocol, XEN_IO_PROTO_ABI_X86_64)) {
    1.26  		/* 32bit dom0, 64bit domU */
    1.27  		mode = 64;
    1.28 @@ -441,9 +441,6 @@ static int xenfb_bind(struct xenfb_devic
    1.29  	if (xenfb_xs_scanf1(xenfb->xsh, dev->otherend, "event-channel", "%u",
    1.30  			    &evtchn) < 0)
    1.31  		return -1;
    1.32 -	if (xenfb_xs_scanf1(xenfb->xsh, dev->otherend, "protocol", "%63s",
    1.33 -			    xenfb->protocol) < 0)
    1.34 -		xenfb->protocol[0] = '\0';
    1.35  
    1.36  	dev->port = xc_evtchn_bind_interdomain(xenfb->evt_xch,
    1.37  					       dev->otherend_id, evtchn);
    1.38 @@ -567,6 +564,9 @@ int xenfb_attach_dom(struct xenfb *xenfb
    1.39  		errno = ENOTSUP;
    1.40  		goto error;
    1.41  	}
    1.42 +	if (xenfb_xs_scanf1(xsh, xenfb->fb.otherend, "protocol", "%63s",
    1.43 +			    xenfb->protocol) < 0)
    1.44 +		xenfb->protocol[0] = '\0';
    1.45  	xenfb_xs_printf(xsh, xenfb->fb.nodename, "request-update", "1");
    1.46  
    1.47  	/* TODO check for permitted ranges */