ia64/xen-unstable

changeset 8137:58d46463413e

GNTTABOP_map_grant_ref returns error status and handle as
separate fields. Update callers for new interface. Also
use int16_t as standard error code type on all public
interfaces.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Nov 30 17:24:27 2005 +0100 (2005-11-30)
parents ff95b53bd39a
children 28ce48573771
files linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c linux-2.6-xen-sparse/drivers/xen/blkback/common.h linux-2.6-xen-sparse/drivers/xen/blkback/interface.c linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c linux-2.6-xen-sparse/drivers/xen/blktap/common.h linux-2.6-xen-sparse/drivers/xen/blktap/interface.c linux-2.6-xen-sparse/drivers/xen/netback/common.h linux-2.6-xen-sparse/drivers/xen/netback/interface.c linux-2.6-xen-sparse/drivers/xen/netback/netback.c linux-2.6-xen-sparse/drivers/xen/tpmback/common.h linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c tools/libxc/xc_domain.c tools/libxc/xc_gnttab.c tools/libxc/xenctrl.h xen/common/grant_table.c xen/include/public/dom0_ops.h xen/include/public/grant_table.h xen/include/public/io/blkif.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Wed Nov 30 16:03:05 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Wed Nov 30 17:24:27 2005 +0100
     1.3 @@ -88,10 +88,10 @@ static inline void flush_plugged_queue(v
     1.4   * handle returned must be used to unmap the frame. This is needed to
     1.5   * drop the ref count on the frame.
     1.6   */
     1.7 -static u16 pending_grant_handles[MMAP_PAGES];
     1.8 +static grant_handle_t pending_grant_handles[MMAP_PAGES];
     1.9  #define pending_handle(_idx, _i) \
    1.10      (pending_grant_handles[((_idx) * BLKIF_MAX_SEGMENTS_PER_REQUEST) + (_i)])
    1.11 -#define BLKBACK_INVALID_HANDLE (0xFFFF)
    1.12 +#define BLKBACK_INVALID_HANDLE (~0)
    1.13  
    1.14  #ifdef CONFIG_XEN_BLKDEV_TAP_BE
    1.15  /*
    1.16 @@ -114,7 +114,7 @@ static void fast_flush_area(int idx, int
    1.17  {
    1.18  	struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST];
    1.19  	unsigned int i, invcount = 0;
    1.20 -	u16 handle;
    1.21 +	grant_handle_t handle;
    1.22  	int ret;
    1.23  
    1.24  	for (i = 0; i < nr_pages; i++) {
    1.25 @@ -381,7 +381,7 @@ static void dispatch_rw_block_io(blkif_t
    1.26  	BUG_ON(ret);
    1.27  
    1.28  	for (i = 0; i < nseg; i++) {
    1.29 -		if (likely(map[i].handle >= 0)) {
    1.30 +		if (likely(map[i].status == 0)) {
    1.31  			pending_handle(pending_idx, i) = map[i].handle;
    1.32  #ifdef __ia64__
    1.33  			MMAP_VADDR(pending_idx,i) = gnttab_map_vaddr(map[i]);
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h	Wed Nov 30 16:03:05 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h	Wed Nov 30 17:24:27 2005 +0100
     2.3 @@ -66,8 +66,8 @@ typedef struct blkif_st {
     2.4  
     2.5  	struct work_struct free_work;
     2.6  
     2.7 -	u16         shmem_handle;
     2.8 -	grant_ref_t shmem_ref;
     2.9 +	grant_handle_t shmem_handle;
    2.10 +	grant_ref_t    shmem_ref;
    2.11  } blkif_t;
    2.12  
    2.13  blkif_t *alloc_blkif(domid_t domid);
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Wed Nov 30 16:03:05 2005 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Wed Nov 30 17:24:27 2005 +0100
     3.3 @@ -43,9 +43,9 @@ static int map_frontend_page(blkif_t *bl
     3.4  	unlock_vm_area(blkif->blk_ring_area);
     3.5  	BUG_ON(ret);
     3.6  
     3.7 -	if (op.handle < 0) {
     3.8 +	if (op.status) {
     3.9  		DPRINTK(" Grant table operation failure !\n");
    3.10 -		return op.handle;
    3.11 +		return op.status;
    3.12  	}
    3.13  
    3.14  	blkif->shmem_ref = shared_page;
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c	Wed Nov 30 16:03:05 2005 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c	Wed Nov 30 17:24:27 2005 +0100
     4.3 @@ -177,8 +177,8 @@ extern inline domid_t ID_TO_DOM(unsigned
     4.4   */
     4.5  struct grant_handle_pair
     4.6  {
     4.7 -	u16  kernel;
     4.8 -	u16  user;
     4.9 +	grant_handle_t kernel;
    4.10 +	grant_handle_t user;
    4.11  };
    4.12  static struct grant_handle_pair pending_grant_handles[MMAP_PAGES];
    4.13  #define pending_handle(_idx, _i) \
    4.14 @@ -755,17 +755,17 @@ static void dispatch_rw_block_io(blkif_t
    4.15  		uvaddr = MMAP_VADDR(user_vstart, pending_idx, i/2);
    4.16  		kvaddr = MMAP_VADDR(mmap_vstart, pending_idx, i/2);
    4.17  
    4.18 -		if (unlikely(map[i].handle < 0)) {
    4.19 +		if (unlikely(map[i].status)) {
    4.20  			DPRINTK("Error on kernel grant mapping (%d)\n",
    4.21 -				map[i].handle);
    4.22 -			ret = map[i].handle;
    4.23 +				map[i].status);
    4.24 +			ret = map[i].status;
    4.25  			cancel = 1;
    4.26  		}
    4.27  
    4.28 -		if (unlikely(map[i+1].handle < 0)) {
    4.29 +		if (unlikely(map[i+1].status)) {
    4.30  			DPRINTK("Error on user grant mapping (%d)\n",
    4.31 -				map[i+1].handle);
    4.32 -			ret = map[i+1].handle;
    4.33 +				map[i+1].status);
    4.34 +			ret = map[i+1].status;
    4.35  			cancel = 1;
    4.36  		}
    4.37  
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/common.h	Wed Nov 30 16:03:05 2005 +0100
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/common.h	Wed Nov 30 17:24:27 2005 +0100
     5.3 @@ -64,7 +64,7 @@ typedef struct blkif_st {
     5.4  
     5.5  	struct work_struct free_work;
     5.6  
     5.7 -	u16              shmem_handle;
     5.8 +	grant_handle_t   shmem_handle;
     5.9  	grant_ref_t      shmem_ref;
    5.10  } blkif_t;
    5.11  
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/interface.c	Wed Nov 30 16:03:05 2005 +0100
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/interface.c	Wed Nov 30 17:24:27 2005 +0100
     6.3 @@ -43,9 +43,9 @@ static int map_frontend_page(blkif_t *bl
     6.4  	unlock_vm_area(blkif->blk_ring_area);
     6.5  	BUG_ON(ret);
     6.6  
     6.7 -	if (op.handle < 0) {
     6.8 +	if (op.status) {
     6.9  		DPRINTK(" Grant table operation failure !\n");
    6.10 -		return op.handle;
    6.11 +		return op.status;
    6.12  	}
    6.13  
    6.14  	blkif->shmem_ref    = shared_page;
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/common.h	Wed Nov 30 16:03:05 2005 +0100
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/common.h	Wed Nov 30 17:24:27 2005 +0100
     7.3 @@ -45,9 +45,9 @@ typedef struct netif_st {
     7.4  	u8               fe_dev_addr[6];
     7.5  
     7.6  	/* Physical parameters of the comms window. */
     7.7 -	u16              tx_shmem_handle;
     7.8 +	grant_handle_t   tx_shmem_handle;
     7.9  	grant_ref_t      tx_shmem_ref; 
    7.10 -	u16              rx_shmem_handle;
    7.11 +	grant_handle_t   rx_shmem_handle;
    7.12  	grant_ref_t      rx_shmem_ref; 
    7.13  	unsigned int     evtchn;
    7.14  	unsigned int     irq;
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Wed Nov 30 16:03:05 2005 +0100
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Wed Nov 30 17:24:27 2005 +0100
     8.3 @@ -127,9 +127,9 @@ static int map_frontend_pages(
     8.4  	unlock_vm_area(netif->comms_area);
     8.5  	BUG_ON(ret);
     8.6  
     8.7 -	if (op.handle < 0) { 
     8.8 +	if (op.status) { 
     8.9  		DPRINTK(" Gnttab failure mapping tx_ring_ref!\n");
    8.10 -		return op.handle;
    8.11 +		return op.status;
    8.12  	}
    8.13  
    8.14  	netif->tx_shmem_ref    = tx_ring_ref;
    8.15 @@ -145,9 +145,9 @@ static int map_frontend_pages(
    8.16  	unlock_vm_area(netif->comms_area);
    8.17  	BUG_ON(ret);
    8.18  
    8.19 -	if (op.handle < 0) { 
    8.20 +	if (op.status) {
    8.21  		DPRINTK(" Gnttab failure mapping rx_ring_ref!\n");
    8.22 -		return op.handle;
    8.23 +		return op.status;
    8.24  	}
    8.25  
    8.26  	netif->rx_shmem_ref    = rx_ring_ref;
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Wed Nov 30 16:03:05 2005 +0100
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Wed Nov 30 17:24:27 2005 +0100
     9.3 @@ -68,7 +68,7 @@ static PEND_RING_IDX dealloc_prod, deall
     9.4  
     9.5  static struct sk_buff_head tx_queue;
     9.6  
     9.7 -static u16 grant_tx_ref[MAX_PENDING_REQS];
     9.8 +static grant_handle_t grant_tx_handle[MAX_PENDING_REQS];
     9.9  static gnttab_unmap_grant_ref_t tx_unmap_ops[MAX_PENDING_REQS];
    9.10  static gnttab_map_grant_ref_t tx_map_ops[MAX_PENDING_REQS];
    9.11  
    9.12 @@ -412,7 +412,7 @@ inline static void net_tx_action_dealloc
    9.13  		pending_idx = dealloc_ring[MASK_PEND_IDX(dc++)];
    9.14  		gop->host_addr    = MMAP_VADDR(pending_idx);
    9.15  		gop->dev_bus_addr = 0;
    9.16 -		gop->handle       = grant_tx_ref[pending_idx];
    9.17 +		gop->handle       = grant_tx_handle[pending_idx];
    9.18  		gop++;
    9.19  	}
    9.20  	ret = HYPERVISOR_grant_table_op(
    9.21 @@ -592,7 +592,7 @@ static void net_tx_action(unsigned long 
    9.22  		       sizeof(txreq));
    9.23  
    9.24  		/* Check the remap error code. */
    9.25 -		if (unlikely(mop->handle < 0)) {
    9.26 +		if (unlikely(mop->status)) {
    9.27  			printk(KERN_ALERT "#### netback grant fails\n");
    9.28  			make_tx_response(netif, txreq.id, NETIF_RSP_ERROR);
    9.29  			netif_put(netif);
    9.30 @@ -605,7 +605,7 @@ static void net_tx_action(unsigned long 
    9.31  		set_phys_to_machine(
    9.32  			__pa(MMAP_VADDR(pending_idx)) >> PAGE_SHIFT,
    9.33  			FOREIGN_FRAME(mop->dev_bus_addr >> PAGE_SHIFT));
    9.34 -		grant_tx_ref[pending_idx] = mop->handle;
    9.35 +		grant_tx_handle[pending_idx] = mop->handle;
    9.36  
    9.37  		data_len = (txreq.size > PKT_PROT_LEN) ?
    9.38  			PKT_PROT_LEN : txreq.size;
    10.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/common.h	Wed Nov 30 16:03:05 2005 +0100
    10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/common.h	Wed Nov 30 17:24:27 2005 +0100
    10.3 @@ -54,7 +54,7 @@ typedef struct tpmif_st {
    10.4  
    10.5  	struct work_struct work;
    10.6  
    10.7 -	u16 shmem_handle;
    10.8 +	grant_handle_t shmem_handle;
    10.9  	grant_ref_t shmem_ref;
   10.10  } tpmif_t;
   10.11  
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c	Wed Nov 30 16:03:05 2005 +0100
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c	Wed Nov 30 17:24:27 2005 +0100
    11.3 @@ -91,9 +91,9 @@ map_frontend_page(tpmif_t *tpmif, unsign
    11.4  	unlock_vm_area(tpmif->tx_area);
    11.5  	BUG_ON(ret);
    11.6  
    11.7 -	if (op.handle < 0) {
    11.8 +	if (op.status) {
    11.9  		DPRINTK(" Grant table operation failure !\n");
   11.10 -		return op.handle;
   11.11 +		return op.status;
   11.12  	}
   11.13  
   11.14  	tpmif->shmem_ref = shared_page;
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c	Wed Nov 30 16:03:05 2005 +0100
    12.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c	Wed Nov 30 17:24:27 2005 +0100
    12.3 @@ -249,7 +249,7 @@ static int
    12.4  	 * and send it to the front end.
    12.5  	 */
    12.6  	tpmif_t *tpmif = pak->tpmif;
    12.7 -	u16 handle;
    12.8 +	grant_handle_t handle;
    12.9  	int rc = 0;
   12.10  	unsigned int i = 0;
   12.11  	unsigned int offset = 0;
   12.12 @@ -290,7 +290,7 @@ static int
   12.13  
   12.14  		handle = map_op.handle;
   12.15  
   12.16 -		if (map_op.handle < 0) {
   12.17 +		if (map_op.status) {
   12.18  			DPRINTK(" Grant table operation failure !\n");
   12.19  			return 0;
   12.20  		}
   12.21 @@ -427,7 +427,7 @@ packet_read_shmem(struct packet *pak,
   12.22  	u32 i = (last_read / PAGE_SIZE);
   12.23  	u32 pg_offset = last_read & (PAGE_SIZE - 1);
   12.24  	u32 to_copy;
   12.25 -	u16 handle;
   12.26 +	grant_handle_t handle;
   12.27  
   12.28  	tpmif_tx_request_t *tx;
   12.29  	tx = &tpmif->tx->ring[0].req;
   12.30 @@ -455,7 +455,7 @@ packet_read_shmem(struct packet *pak,
   12.31  			BUG();
   12.32  		}
   12.33  
   12.34 -		if (map_op.handle < 0) {
   12.35 +		if (map_op.status) {
   12.36  			DPRINTK(" Grant table operation failure !\n");
   12.37  			return -EFAULT;
   12.38  		}
    13.1 --- a/tools/libxc/xc_domain.c	Wed Nov 30 16:03:05 2005 +0100
    13.2 +++ b/tools/libxc/xc_domain.c	Wed Nov 30 17:24:27 2005 +0100
    13.3 @@ -365,9 +365,9 @@ int xc_domain_get_vcpu_info(int xc_handl
    13.4  
    13.5  int xc_domain_ioport_permission(int xc_handle,
    13.6                                  uint32_t domid,
    13.7 -                                uint16_t first_port,
    13.8 -                                uint16_t nr_ports,
    13.9 -                                uint16_t allow_access)
   13.10 +                                uint32_t first_port,
   13.11 +                                uint32_t nr_ports,
   13.12 +                                uint32_t allow_access)
   13.13  {
   13.14      DECLARE_DOM0_OP;
   13.15  
    14.1 --- a/tools/libxc/xc_gnttab.c	Wed Nov 30 16:03:05 2005 +0100
    14.2 +++ b/tools/libxc/xc_gnttab.c	Wed Nov 30 17:24:27 2005 +0100
    14.3 @@ -42,9 +42,10 @@ do_gnttab_op(int xc_handle,
    14.4  int xc_gnttab_map_grant_ref(int         xc_handle,
    14.5                              uint64_t    host_virt_addr,
    14.6                              uint32_t    dom,
    14.7 -                            uint16_t    ref,
    14.8 +                            grant_ref_t ref,
    14.9                              uint16_t    flags,
   14.10 -                            int16_t    *handle,
   14.11 +                            int16_t    *status,
   14.12 +                            grant_handle_t *handle,
   14.13                              uint64_t   *dev_bus_addr)
   14.14  {
   14.15      struct gnttab_map_grant_ref op;
   14.16 @@ -58,6 +59,7 @@ int xc_gnttab_map_grant_ref(int         
   14.17      if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_map_grant_ref,
   14.18                              &op, 1)) == 0 )
   14.19      {
   14.20 +        *status         = op.status;
   14.21          *handle         = op.handle;
   14.22          *dev_bus_addr   = op.dev_bus_addr;
   14.23      }
   14.24 @@ -69,7 +71,7 @@ int xc_gnttab_map_grant_ref(int         
   14.25  int xc_gnttab_unmap_grant_ref(int       xc_handle,
   14.26                                uint64_t  host_virt_addr,
   14.27                                uint64_t  dev_bus_addr,
   14.28 -                              uint16_t  handle,
   14.29 +                              grant_handle_t handle,
   14.30                                int16_t  *status)
   14.31  {
   14.32      struct gnttab_unmap_grant_ref op;
    15.1 --- a/tools/libxc/xenctrl.h	Wed Nov 30 16:03:05 2005 +0100
    15.2 +++ b/tools/libxc/xenctrl.h	Wed Nov 30 17:24:27 2005 +0100
    15.3 @@ -13,6 +13,7 @@
    15.4  #include <sys/ptrace.h>
    15.5  #include <xen/xen.h>
    15.6  #include <xen/dom0_ops.h>
    15.7 +#include <xen/grant_table.h>
    15.8  #include <xen/version.h>
    15.9  #include <xen/event_channel.h>
   15.10  #include <xen/sched.h>
   15.11 @@ -374,9 +375,9 @@ int xc_domain_memory_decrease_reservatio
   15.12  
   15.13  int xc_domain_ioport_permission(int xc_handle,
   15.14                                  uint32_t domid,
   15.15 -                                uint16_t first_port,
   15.16 -                                uint16_t nr_ports,
   15.17 -                                uint16_t allow_access);
   15.18 +                                uint32_t first_port,
   15.19 +                                uint32_t nr_ports,
   15.20 +                                uint32_t allow_access);
   15.21  
   15.22  unsigned long xc_make_page_below_4G(int xc_handle, uint32_t domid, 
   15.23  				    unsigned long mfn);
   15.24 @@ -475,15 +476,16 @@ int xc_grant_interface_close(int xc_hand
   15.25  int xc_gnttab_map_grant_ref(int      xc_handle,
   15.26                              uint64_t host_virt_addr,
   15.27                              uint32_t dom,
   15.28 -                            uint16_t ref,
   15.29 +                            grant_ref_t ref,
   15.30                              uint16_t flags,
   15.31 -                            int16_t *handle,
   15.32 +                            int16_t *status,
   15.33 +                            grant_handle_t *handle,
   15.34                              uint64_t *dev_bus_addr);
   15.35  
   15.36  int xc_gnttab_unmap_grant_ref(int  xc_handle,
   15.37                                uint64_t  host_virt_addr,
   15.38                                uint64_t  dev_bus_addr,
   15.39 -                              uint16_t  handle,
   15.40 +                              grant_handle_t handle,
   15.41                                int16_t *status);
   15.42  
   15.43  int xc_gnttab_setup_table(int        xc_handle,
    16.1 --- a/xen/common/grant_table.c	Wed Nov 30 16:03:05 2005 +0100
    16.2 +++ b/xen/common/grant_table.c	Wed Nov 30 17:24:27 2005 +0100
    16.3 @@ -114,13 +114,13 @@ static int
    16.4                     (GNTMAP_device_map|GNTMAP_host_map)) == 0) )
    16.5      {
    16.6          DPRINTK("Bad ref (%d) or flags (%x).\n", ref, dev_hst_ro_flags);
    16.7 -        (void)__put_user(GNTST_bad_gntref, &uop->handle);
    16.8 +        (void)__put_user(GNTST_bad_gntref, &uop->status);
    16.9          return GNTST_bad_gntref;
   16.10      }
   16.11  
   16.12      if ( acm_pre_grant_map_ref(dom) )
   16.13      {
   16.14 -        (void)__put_user(GNTST_permission_denied, &uop->handle);
   16.15 +        (void)__put_user(GNTST_permission_denied, &uop->status);
   16.16          return GNTST_permission_denied;
   16.17      }
   16.18  
   16.19 @@ -130,7 +130,7 @@ static int
   16.20          if ( rd != NULL )
   16.21              put_domain(rd);
   16.22          DPRINTK("Could not find domain %d\n", dom);
   16.23 -        (void)__put_user(GNTST_bad_domain, &uop->handle);
   16.24 +        (void)__put_user(GNTST_bad_domain, &uop->status);
   16.25          return GNTST_bad_domain;
   16.26      }
   16.27  
   16.28 @@ -145,7 +145,7 @@ static int
   16.29          {
   16.30              put_domain(rd);
   16.31              DPRINTK("Maptrack table is at maximum size.\n");
   16.32 -            (void)__put_user(GNTST_no_device_space, &uop->handle);
   16.33 +            (void)__put_user(GNTST_no_device_space, &uop->status);
   16.34              return GNTST_no_device_space;
   16.35          }
   16.36  
   16.37 @@ -155,7 +155,7 @@ static int
   16.38          {
   16.39              put_domain(rd);
   16.40              DPRINTK("No more map handles available.\n");
   16.41 -            (void)__put_user(GNTST_no_device_space, &uop->handle);
   16.42 +            (void)__put_user(GNTST_no_device_space, &uop->status);
   16.43              return GNTST_no_device_space;
   16.44          }
   16.45  
   16.46 @@ -370,6 +370,7 @@ static int
   16.47  
   16.48      (void)__put_user((u64)frame << PAGE_SHIFT, &uop->dev_bus_addr);
   16.49      (void)__put_user(handle, &uop->handle);
   16.50 +    (void)__put_user(GNTST_okay, &uop->status);
   16.51  
   16.52      put_domain(rd);
   16.53      return rc;
   16.54 @@ -377,7 +378,7 @@ static int
   16.55  
   16.56   unlock_out:
   16.57      spin_unlock(&rd->grant_table->lock);
   16.58 -    (void)__put_user(rc, &uop->handle);
   16.59 +    (void)__put_user(rc, &uop->status);
   16.60      put_maptrack_handle(ld->grant_table, handle);
   16.61      return rc;
   16.62  }
   16.63 @@ -400,7 +401,7 @@ static int
   16.64  {
   16.65      domid_t          dom;
   16.66      grant_ref_t      ref;
   16.67 -    u16              handle;
   16.68 +    grant_handle_t   handle;
   16.69      struct domain   *ld, *rd;
   16.70      active_grant_entry_t *act;
   16.71      grant_entry_t   *sha;
   16.72 @@ -957,7 +958,7 @@ gnttab_release_mappings(
   16.73      grant_table_t        *gt = d->grant_table;
   16.74      grant_mapping_t      *map;
   16.75      grant_ref_t           ref;
   16.76 -    u16                   handle;
   16.77 +    grant_handle_t        handle;
   16.78      struct domain        *rd;
   16.79      active_grant_entry_t *act;
   16.80      grant_entry_t        *sha;
    17.1 --- a/xen/include/public/dom0_ops.h	Wed Nov 30 16:03:05 2005 +0100
    17.2 +++ b/xen/include/public/dom0_ops.h	Wed Nov 30 17:24:27 2005 +0100
    17.3 @@ -19,7 +19,7 @@
    17.4   * This makes sure that old versions of dom0 tools will stop working in a
    17.5   * well-defined way (rather than crashing the machine, for instance).
    17.6   */
    17.7 -#define DOM0_INTERFACE_VERSION   0xAAAA1013
    17.8 +#define DOM0_INTERFACE_VERSION   0xAAAA1014
    17.9  
   17.10  /************************************************************************/
   17.11  
    18.1 --- a/xen/include/public/grant_table.h	Wed Nov 30 16:03:05 2005 +0100
    18.2 +++ b/xen/include/public/grant_table.h	Wed Nov 30 17:24:27 2005 +0100
    18.3 @@ -134,6 +134,11 @@ typedef struct grant_entry {
    18.4  typedef uint32_t grant_ref_t;
    18.5  
    18.6  /*
    18.7 + * Handle to track a mapping created via a grant reference.
    18.8 + */
    18.9 +typedef uint32_t grant_handle_t;
   18.10 +
   18.11 +/*
   18.12   * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
   18.13   * by devices and/or host CPUs. If successful, <handle> is a tracking number
   18.14   * that must be presented later to destroy the mapping(s). On error, <handle>
   18.15 @@ -154,11 +159,12 @@ typedef uint32_t grant_ref_t;
   18.16  typedef struct gnttab_map_grant_ref {
   18.17      /* IN parameters. */
   18.18      uint64_t host_addr;
   18.19 -    domid_t  dom;
   18.20 +    uint32_t flags;               /* GNTMAP_* */
   18.21      grant_ref_t ref;
   18.22 -    uint32_t flags;               /* GNTMAP_* */
   18.23 +    domid_t  dom;
   18.24      /* OUT parameters. */
   18.25 -    int32_t  handle;              /* +ve: handle; -ve: GNTST_* */
   18.26 +    int16_t  status;              /* GNTST_* */
   18.27 +    grant_handle_t handle;
   18.28      uint64_t dev_bus_addr;
   18.29  } gnttab_map_grant_ref_t;
   18.30  
   18.31 @@ -178,9 +184,9 @@ typedef struct gnttab_unmap_grant_ref {
   18.32      /* IN parameters. */
   18.33      uint64_t host_addr;
   18.34      uint64_t dev_bus_addr;
   18.35 -    uint32_t handle;
   18.36 +    grant_handle_t handle;
   18.37      /* OUT parameters. */
   18.38 -    int32_t  status;              /* GNTST_* */
   18.39 +    int16_t  status;              /* GNTST_* */
   18.40  } gnttab_unmap_grant_ref_t;
   18.41  
   18.42  /*
   18.43 @@ -198,7 +204,7 @@ typedef struct gnttab_setup_table {
   18.44      domid_t  dom;
   18.45      uint32_t nr_frames;
   18.46      /* OUT parameters. */
   18.47 -    int32_t  status;              /* GNTST_* */
   18.48 +    int16_t  status;              /* GNTST_* */
   18.49      unsigned long *frame_list;
   18.50  } gnttab_setup_table_t;
   18.51  
   18.52 @@ -211,7 +217,7 @@ typedef struct gnttab_dump_table {
   18.53      /* IN parameters. */
   18.54      domid_t dom;
   18.55      /* OUT parameters. */
   18.56 -    int32_t status;               /* GNTST_* */
   18.57 +    int16_t status;               /* GNTST_* */
   18.58  } gnttab_dump_table_t;
   18.59  
   18.60  /*
   18.61 @@ -229,7 +235,7 @@ typedef struct {
   18.62      domid_t       domid;
   18.63      grant_ref_t   ref;
   18.64      /* OUT parameters. */
   18.65 -    int32_t       status;
   18.66 +    int16_t       status;
   18.67  } gnttab_transfer_t;
   18.68  
   18.69  /*
    19.1 --- a/xen/include/public/io/blkif.h	Wed Nov 30 16:03:05 2005 +0100
    19.2 +++ b/xen/include/public/io/blkif.h	Wed Nov 30 17:24:27 2005 +0100
    19.3 @@ -43,7 +43,7 @@ typedef struct blkif_request {
    19.4  typedef struct blkif_response {
    19.5      uint64_t        id;              /* copied from request */
    19.6      uint8_t         operation;       /* copied from request */
    19.7 -    int32_t         status;          /* BLKIF_RSP_???       */
    19.8 +    int16_t         status;          /* BLKIF_RSP_???       */
    19.9  } blkif_response_t;
   19.10  
   19.11  #define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */