direct-io.hg

changeset 6289:eb9df2c3a478

Local merge of two headed repo.
author sd386@font.cl.cam.ac.uk
date Fri Aug 19 18:12:48 2005 +0000 (2005-08-19)
parents 42f0160093ff 5e8123554d15
children 46e43646cd16
files linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6-xen-sparse/arch/xen/i386/kernel/init_task.c linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c linux-2.6-xen-sparse/arch/xen/i386/mm/init.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/process.c linux-2.6-xen-sparse/drivers/xen/blkback/common.h linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h linux-2.6-xen-sparse/drivers/xen/netback/common.h linux-2.6-xen-sparse/drivers/xen/netback/netback.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h linux-2.6-xen-sparse/include/asm-xen/xenbus.h tools/debugger/libxendebug/xendebug.c tools/debugger/libxendebug/xendebug.h tools/debugger/pdb/linux-2.6-module/debug.c tools/debugger/pdb/linux-2.6-module/module.c tools/debugger/pdb/linux-2.6-module/pdb_debug.h tools/debugger/pdb/pdb_caml_domain.c tools/debugger/pdb/pdb_caml_process.c tools/debugger/pdb/pdb_caml_xcs.c tools/libxc/xc.h tools/libxc/xc_gnttab.c tools/python/xen/lowlevel/xu/xu.c tools/python/xen/xm/main.py tools/xentrace/xentrace.c xen/arch/x86/physdev.c xen/common/trace.c xen/include/public/arch-ia64.h xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/public/dom0_ops.h xen/include/public/grant_table.h xen/include/public/io/domain_controller.h xen/include/public/io/netif.h xen/include/public/physdev.h xen/include/public/xen.h
line diff
     4.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c	Fri Aug 19 18:08:29 2005 +0000
     4.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c	Fri Aug 19 18:12:48 2005 +0000
     4.3 @@ -80,7 +80,7 @@ asmlinkage long sys_ioperm(unsigned long
     4.4  		t->io_bitmap_ptr = bitmap;
     4.5  
     4.6  		op.cmd = PHYSDEVOP_SET_IOBITMAP;
     4.7 -		op.u.set_iobitmap.bitmap   = (unsigned long)bitmap;
     4.8 +		op.u.set_iobitmap.bitmap   = (char *)bitmap;
     4.9  		op.u.set_iobitmap.nr_ports = IO_BITMAP_BITS;
    4.10  		HYPERVISOR_physdev_op(&op);
    4.11  	}
     5.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c	Fri Aug 19 18:08:29 2005 +0000
     5.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c	Fri Aug 19 18:12:48 2005 +0000
     5.3 @@ -547,7 +547,7 @@ struct task_struct fastcall * __switch_t
     5.4  		iobmp_op.cmd                     =
     5.5  			PHYSDEVOP_SET_IOBITMAP;
     5.6  		iobmp_op.u.set_iobitmap.bitmap   =
     5.7 -			(unsigned long)next->io_bitmap_ptr;
     5.8 +			(char *)next->io_bitmap_ptr;
     5.9  		iobmp_op.u.set_iobitmap.nr_ports =
    5.10  			next->io_bitmap_ptr ? IO_BITMAP_BITS : 0;
    5.11  		mcl->op      = __HYPERVISOR_physdev_op;
     6.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Fri Aug 19 18:08:29 2005 +0000
     6.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Fri Aug 19 18:12:48 2005 +0000
     6.3 @@ -43,20 +43,18 @@
     6.4  #define IO_TLB_SHIFT 11
     6.5  
     6.6  int swiotlb_force;
     6.7 +static char *iotlb_virt_start;
     6.8 +static unsigned long iotlb_nslabs;
     6.9  
    6.10  /*
    6.11   * Used to do a quick range check in swiotlb_unmap_single and
    6.12   * swiotlb_sync_single_*, to see if the memory was in fact allocated by this
    6.13   * API.
    6.14   */
    6.15 -static char *iotlb_virt_start, *iotlb_virt_end;
    6.16 -static dma_addr_t iotlb_bus_start, iotlb_bus_end;
    6.17 +static dma_addr_t iotlb_bus_start, iotlb_bus_mask;
    6.18  
    6.19 -/*
    6.20 - * The number of IO TLB blocks (in groups of 64) betweeen iotlb_virt_start and
    6.21 - * iotlb_virt_end.  This is command line adjustable via setup_io_tlb_npages.
    6.22 - */
    6.23 -static unsigned long iotlb_nslabs;
    6.24 +/* Does the given dma address reside within the swiotlb aperture? */
    6.25 +#define in_swiotlb_aperture(a) (!(((a) ^ iotlb_bus_start) & iotlb_bus_mask))
    6.26  
    6.27  /*
    6.28   * When the IOMMU overflows we return a fallback buffer. This sets the size.
    6.29 @@ -94,6 +92,9 @@ setup_io_tlb_npages(char *str)
    6.30  		iotlb_nslabs = simple_strtoul(str, &str, 0) <<
    6.31  			(20 - IO_TLB_SHIFT);
    6.32  		iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
    6.33 +		/* Round up to power of two (xen_create_contiguous_region). */
    6.34 +		while (iotlb_nslabs & (iotlb_nslabs-1))
    6.35 +			iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
    6.36  	}
    6.37  	if (*str == ',')
    6.38  		++str;
    6.39 @@ -120,6 +121,9 @@ swiotlb_init_with_default_size (size_t d
    6.40  	if (!iotlb_nslabs) {
    6.41  		iotlb_nslabs = (default_size >> IO_TLB_SHIFT);
    6.42  		iotlb_nslabs = ALIGN(iotlb_nslabs, IO_TLB_SEGSIZE);
    6.43 +		/* Round up to power of two (xen_create_contiguous_region). */
    6.44 +		while (iotlb_nslabs & (iotlb_nslabs-1))
    6.45 +			iotlb_nslabs += iotlb_nslabs & ~(iotlb_nslabs-1);
    6.46  	}
    6.47  
    6.48  	bytes = iotlb_nslabs * (1UL << IO_TLB_SHIFT);
    6.49 @@ -133,17 +137,12 @@ swiotlb_init_with_default_size (size_t d
    6.50  		      "Use dom0_mem Xen boot parameter to reserve\n"
    6.51  		      "some DMA memory (e.g., dom0_mem=-128M).\n");
    6.52  
    6.53 -	for (i = 0; i < iotlb_nslabs; i += IO_TLB_SEGSIZE)
    6.54 -		xen_create_contiguous_region(
    6.55 -			(unsigned long)iotlb_virt_start + (i << IO_TLB_SHIFT),
    6.56 -			get_order(IO_TLB_SEGSIZE << IO_TLB_SHIFT));
    6.57 -
    6.58 -	iotlb_virt_end = iotlb_virt_start + bytes;
    6.59 +	xen_create_contiguous_region(
    6.60 +		(unsigned long)iotlb_virt_start, get_order(bytes));
    6.61  
    6.62  	/*
    6.63  	 * Allocate and initialize the free list array.  This array is used
    6.64 -	 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
    6.65 -	 * between iotlb_virt_start and iotlb_virt_end.
    6.66 +	 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE.
    6.67  	 */
    6.68  	io_tlb_list = alloc_bootmem(iotlb_nslabs * sizeof(int));
    6.69  	for (i = 0; i < iotlb_nslabs; i++)
    6.70 @@ -156,15 +155,19 @@ swiotlb_init_with_default_size (size_t d
    6.71  	 * Get the overflow emergency buffer
    6.72  	 */
    6.73  	io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
    6.74 +
    6.75  	iotlb_bus_start = virt_to_bus(iotlb_virt_start);
    6.76 -	iotlb_bus_end   = iotlb_bus_start + bytes;
    6.77 +	iotlb_bus_mask  = ~(dma_addr_t)(bytes - 1);
    6.78 +
    6.79  	printk(KERN_INFO "Software IO TLB enabled: \n"
    6.80  	       " Aperture:     %lu megabytes\n"
    6.81  	       " Bus range:    0x%016lx - 0x%016lx\n"
    6.82  	       " Kernel range: 0x%016lx - 0x%016lx\n",
    6.83  	       bytes >> 20,
    6.84 -	       (unsigned long)iotlb_bus_start, (unsigned long)iotlb_bus_end,
    6.85 -	       (unsigned long)iotlb_virt_start, (unsigned long)iotlb_virt_end);
    6.86 +	       (unsigned long)iotlb_bus_start,
    6.87 +	       (unsigned long)iotlb_bus_start + bytes,
    6.88 +	       (unsigned long)iotlb_virt_start,
    6.89 +	       (unsigned long)iotlb_virt_start + bytes);
    6.90  }
    6.91  
    6.92  void
    6.93 @@ -444,7 +447,7 @@ swiotlb_unmap_single(struct device *hwde
    6.94  		     int dir)
    6.95  {
    6.96  	BUG_ON(dir == DMA_NONE);
    6.97 -	if ((dev_addr >= iotlb_bus_start) && (dev_addr < iotlb_bus_end))
    6.98 +	if (in_swiotlb_aperture(dev_addr))
    6.99  		unmap_single(hwdev, bus_to_virt(dev_addr), size, dir);
   6.100  }
   6.101  
   6.102 @@ -463,7 +466,7 @@ swiotlb_sync_single_for_cpu(struct devic
   6.103  			    size_t size, int dir)
   6.104  {
   6.105  	BUG_ON(dir == DMA_NONE);
   6.106 -	if ((dev_addr >= iotlb_bus_start) && (dev_addr < iotlb_bus_end))
   6.107 +	if (in_swiotlb_aperture(dev_addr))
   6.108  		sync_single(hwdev, bus_to_virt(dev_addr), size, dir);
   6.109  }
   6.110  
   6.111 @@ -472,7 +475,7 @@ swiotlb_sync_single_for_device(struct de
   6.112  			       size_t size, int dir)
   6.113  {
   6.114  	BUG_ON(dir == DMA_NONE);
   6.115 -	if ((dev_addr >= iotlb_bus_start) && (dev_addr < iotlb_bus_end))
   6.116 +	if (in_swiotlb_aperture(dev_addr))
   6.117  		sync_single(hwdev, bus_to_virt(dev_addr), size, dir);
   6.118  }
   6.119  
   6.120 @@ -610,7 +613,7 @@ swiotlb_unmap_page(struct device *hwdev,
   6.121  		   size_t size, enum dma_data_direction direction)
   6.122  {
   6.123  	BUG_ON(direction == DMA_NONE);
   6.124 -	if ((dma_address >= iotlb_bus_start) && (dma_address < iotlb_bus_end))
   6.125 +	if (in_swiotlb_aperture(dma_address))
   6.126  		unmap_single(hwdev, bus_to_virt(dma_address), size, direction);
   6.127  }
   6.128  
     8.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/process.c	Fri Aug 19 18:08:29 2005 +0000
     8.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/process.c	Fri Aug 19 18:12:48 2005 +0000
     8.3 @@ -474,7 +474,7 @@ struct task_struct *__switch_to(struct t
     8.4  		iobmp_op.cmd                     =
     8.5  			PHYSDEVOP_SET_IOBITMAP;
     8.6  		iobmp_op.u.set_iobitmap.bitmap   =
     8.7 -			(unsigned long)next->io_bitmap_ptr;
     8.8 +			(char *)next->io_bitmap_ptr;
     8.9  		iobmp_op.u.set_iobitmap.nr_ports =
    8.10  			next->io_bitmap_ptr ? IO_BITMAP_BITS : 0;
    8.11  		mcl->op      = __HYPERVISOR_physdev_op;
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h	Fri Aug 19 18:08:29 2005 +0000
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h	Fri Aug 19 18:12:48 2005 +0000
     9.3 @@ -71,7 +71,7 @@ typedef struct blkif_st {
     9.4      struct work_struct work;
     9.5  #ifdef CONFIG_XEN_BLKDEV_GRANT
     9.6      u16 shmem_handle;
     9.7 -    memory_t shmem_vaddr;
     9.8 +    unsigned long shmem_vaddr;
     9.9      grant_ref_t shmem_ref;
    9.10  #endif
    9.11  } blkif_t;
    10.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Fri Aug 19 18:08:29 2005 +0000
    10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Fri Aug 19 18:12:48 2005 +0000
    10.3 @@ -182,16 +182,20 @@ static void backend_changed(struct xenbu
    10.4  			    "frontend-id", "%li", &be->frontend_id,
    10.5  			    "frontend", NULL, &frontend,
    10.6  			    NULL);
    10.7 -	if (err == -ENOENT || err == -ERANGE ||
    10.8 +	if (XENBUS_EXIST_ERR(err) ||
    10.9  	    strlen(frontend) == 0 || !xenbus_exists(frontend, "")) {
   10.10 -		if (frontend)
   10.11 -			kfree(frontend);
   10.12  		/* If we can't get a frontend path and a frontend-id,
   10.13  		 * then our bus-id is no longer valid and we need to
   10.14  		 * destroy the backend device.
   10.15  		 */
   10.16  		goto device_fail;
   10.17  	}
   10.18 +	if (err < 0) {
   10.19 +		xenbus_dev_error(dev, err,
   10.20 +				 "reading %s/frontend or frontend-id",
   10.21 +				 dev->nodename);
   10.22 +		goto device_fail;
   10.23 +	}
   10.24  
   10.25  	if (!be->frontpath || strcmp(frontend, be->frontpath)) {
   10.26  		if (be->watch.node)
   10.27 @@ -199,6 +203,7 @@ static void backend_changed(struct xenbu
   10.28  		if (be->frontpath)
   10.29  			kfree(be->frontpath);
   10.30  		be->frontpath = frontend;
   10.31 +		frontend = NULL;
   10.32  		be->watch.node = be->frontpath;
   10.33  		be->watch.callback = frontend_changed;
   10.34  		err = register_xenbus_watch(&be->watch);
   10.35 @@ -206,14 +211,13 @@ static void backend_changed(struct xenbu
   10.36  			be->watch.node = NULL;
   10.37  			goto device_fail;
   10.38  		}
   10.39 -	} else
   10.40 -		kfree(frontend);
   10.41 +	}
   10.42  
   10.43  	err = xenbus_scanf(dev->nodename, "physical-device", "%li", &pdev);
   10.44 -	if (err == -ENOENT || err == -ERANGE)
   10.45 +	if (XENBUS_EXIST_ERR(err))
   10.46  		goto out;
   10.47  	if (err < 0) {
   10.48 -		xenbus_dev_error(dev, err, "Reading physical-device");
   10.49 +		xenbus_dev_error(dev, err, "reading physical-device");
   10.50  		goto device_fail;
   10.51  	}
   10.52  	if (be->pdev && be->pdev != pdev) {
   10.53 @@ -253,12 +257,14 @@ static void backend_changed(struct xenbu
   10.54  		frontend_changed(&be->watch, be->frontpath);
   10.55  	}
   10.56  
   10.57 + out:
   10.58 +	if (frontend)
   10.59 +		kfree(frontend);
   10.60  	return;
   10.61  
   10.62   device_fail:
   10.63  	device_unregister(&be->dev->dev);
   10.64 - out:
   10.65 -	return;
   10.66 +	goto out;
   10.67  }
   10.68  
   10.69  static int blkback_probe(struct xenbus_device *dev,
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Aug 19 18:08:29 2005 +0000
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Aug 19 18:12:48 2005 +0000
    11.3 @@ -1134,25 +1134,24 @@ static void watch_for_status(struct xenb
    11.4  			    "info", "%u", &binfo,
    11.5  			    "sector-size", "%lu", &sector_size,
    11.6  			    NULL);
    11.7 -
    11.8 -	if (err)
    11.9 +	if (err) {
   11.10  		xenbus_dev_error(info->dev, err, "reading backend fields");
   11.11 -	else {
   11.12 -		xlvbd_add(sectors, info->vdevice, info->handle, binfo,
   11.13 -			  sector_size);
   11.14 -		info->connected = 1;
   11.15 +		return;
   11.16 +	}
   11.17 +
   11.18 +	xlvbd_add(sectors, info->vdevice, info->handle, binfo, sector_size);
   11.19 +	info->connected = 1;
   11.20  
   11.21 -		/* First to connect?  blkif is now connected. */
   11.22 -		if (blkif_vbds_connected++ == 0)
   11.23 -			blkif_state = BLKIF_STATE_CONNECTED;
   11.24 -
   11.25 -		xenbus_dev_ok(info->dev);
   11.26 +	/* First to connect?  blkif is now connected. */
   11.27 +	if (blkif_vbds_connected++ == 0)
   11.28 +		blkif_state = BLKIF_STATE_CONNECTED;
   11.29  
   11.30 -		/* Kick pending requests. */
   11.31 -		spin_lock_irq(&blkif_io_lock);
   11.32 -		kick_pending_request_queues();
   11.33 -		spin_unlock_irq(&blkif_io_lock);
   11.34 -	}
   11.35 +	xenbus_dev_ok(info->dev);
   11.36 +
   11.37 +	/* Kick pending requests. */
   11.38 +	spin_lock_irq(&blkif_io_lock);
   11.39 +	kick_pending_request_queues();
   11.40 +	spin_unlock_irq(&blkif_io_lock);
   11.41  }
   11.42  
   11.43  static int setup_blkring(struct xenbus_device *dev, unsigned int backend_id)
   11.44 @@ -1199,36 +1198,28 @@ static int talk_to_backend(struct xenbus
   11.45  	const char *message;
   11.46  	int err, backend_id;
   11.47  
   11.48 -	backend = xenbus_read(dev->nodename, "backend", NULL);
   11.49 -	if (IS_ERR(backend)) {
   11.50 -		err = PTR_ERR(backend);
   11.51 -		if (err == -ENOENT)
   11.52 -			goto out;
   11.53 -		xenbus_dev_error(dev, err, "reading %s/backend",
   11.54 +	backend = NULL;
   11.55 +	err = xenbus_gather(dev->nodename,
   11.56 +			    "backend-id", "%i", &backend_id,
   11.57 +			    "backend", NULL, &backend,
   11.58 +			    NULL);
   11.59 +	if (XENBUS_EXIST_ERR(err))
   11.60 +		goto out;
   11.61 +	if (backend && strlen(backend) == 0) {
   11.62 +		err = -ENOENT;
   11.63 +		goto out;
   11.64 +	}
   11.65 +	if (err < 0) {
   11.66 +		xenbus_dev_error(dev, err, "reading %s/backend or backend-id",
   11.67  				 dev->nodename);
   11.68  		goto out;
   11.69  	}
   11.70 -	if (strlen(backend) == 0) {
   11.71 -		err = -ENOENT;
   11.72 -		goto free_backend;
   11.73 -	}
   11.74 -
   11.75 -	/* FIXME: This driver can't handle backends on different
   11.76 -	 * domains.  Check and fail gracefully. */
   11.77 -	err = xenbus_scanf(dev->nodename, "backend-id", "%i", &backend_id);
   11.78 -	if (err == -ENOENT)
   11.79 -		goto free_backend;
   11.80 - 	if (err < 0) {
   11.81 -		xenbus_dev_error(dev, err, "reading %s/backend-id",
   11.82 -				 dev->nodename);
   11.83 - 		goto free_backend;
   11.84 - 	}
   11.85  
   11.86  	/* First device?  We create shared ring, alloc event channel. */
   11.87  	if (blkif_vbds == 0) {
   11.88  		err = setup_blkring(dev, backend_id);
   11.89  		if (err)
   11.90 -			goto free_backend;
   11.91 +			goto out;
   11.92  	}
   11.93  
   11.94  	err = xenbus_transaction_start(dev->nodename);
   11.95 @@ -1258,9 +1249,11 @@ static int talk_to_backend(struct xenbus
   11.96  		goto abort_transaction;
   11.97  	}
   11.98  
   11.99 -	info->watch.node = info->backend = backend;
  11.100 +	info->backend = backend;
  11.101 +	backend = NULL;
  11.102 +
  11.103 +	info->watch.node = info->backend;
  11.104  	info->watch.callback = watch_for_status;
  11.105 -
  11.106  	err = register_xenbus_watch(&info->watch);
  11.107  	if (err) {
  11.108  		message = "registering watch on backend";
  11.109 @@ -1272,20 +1265,20 @@ static int talk_to_backend(struct xenbus
  11.110  		xenbus_dev_error(dev, err, "completing transaction");
  11.111  		goto destroy_blkring;
  11.112  	}
  11.113 -	return 0;
  11.114  
  11.115 -abort_transaction:
  11.116 + out:
  11.117 +	if (backend)
  11.118 +		kfree(backend);
  11.119 +	return err;
  11.120 +
  11.121 + abort_transaction:
  11.122  	xenbus_transaction_end(1);
  11.123  	/* Have to do this *outside* transaction.  */
  11.124  	xenbus_dev_error(dev, err, "%s", message);
  11.125 -destroy_blkring:
  11.126 + destroy_blkring:
  11.127  	if (blkif_vbds == 0)
  11.128  		blkif_free();
  11.129 -free_backend:
  11.130 -	kfree(backend);
  11.131 -out:
  11.132 -	printk("%s:%u = %i\n", __FILE__, __LINE__, err);
  11.133 -	return err;
  11.134 +	goto out;
  11.135  }
  11.136  
  11.137  /* Setup supplies the backend dir, virtual device.
  11.138 @@ -1301,7 +1294,7 @@ static int blkfront_probe(struct xenbus_
  11.139  
  11.140  	/* FIXME: Use dynamic device id if this is not set. */
  11.141  	err = xenbus_scanf(dev->nodename, "virtual-device", "%i", &vdevice);
  11.142 -	if (err == -ENOENT)
  11.143 +	if (XENBUS_EXIST_ERR(err))
  11.144  		return err;
  11.145  	if (err < 0) {
  11.146  		xenbus_dev_error(dev, err, "reading virtual-device");
  11.147 @@ -1316,6 +1309,7 @@ static int blkfront_probe(struct xenbus_
  11.148  	info->dev = dev;
  11.149  	info->vdevice = vdevice;
  11.150  	info->connected = 0;
  11.151 +
  11.152  	/* Front end dir is a number, which is used as the id. */
  11.153  	info->handle = simple_strtoul(strrchr(dev->nodename,'/')+1, NULL, 0);
  11.154  	dev->data = info;
  11.155 @@ -1427,8 +1421,8 @@ static int __init xlblk_init(void)
  11.156  
  11.157  #ifdef CONFIG_XEN_BLKDEV_GRANT
  11.158      /* A grant for every ring slot, plus one for the ring itself. */
  11.159 -    if ( 0 > gnttab_alloc_grant_references(MAXIMUM_OUTSTANDING_BLOCK_REQS + 1,
  11.160 -                                           &gref_head, &gref_terminal) )
  11.161 +    if (gnttab_alloc_grant_references(MAXIMUM_OUTSTANDING_BLOCK_REQS + 1,
  11.162 +				      &gref_head, &gref_terminal) < 0)
  11.163          return 1;
  11.164      printk(KERN_ALERT "Blkif frontend is using grant tables.\n");
  11.165  #endif
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h	Fri Aug 19 18:08:29 2005 +0000
    12.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h	Fri Aug 19 18:12:48 2005 +0000
    12.3 @@ -87,7 +87,7 @@ typedef struct blkif_st {
    12.4      struct work_struct work;
    12.5  #ifdef CONFIG_XEN_BLKDEV_GRANT
    12.6      u16 shmem_handle;
    12.7 -    memory_t shmem_vaddr;
    12.8 +    unsigned long shmem_vaddr;
    12.9      grant_ref_t shmem_ref;
   12.10  #endif
   12.11  } blkif_t;
    13.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/common.h	Fri Aug 19 18:08:29 2005 +0000
    13.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/common.h	Fri Aug 19 18:12:48 2005 +0000
    13.3 @@ -49,13 +49,13 @@ typedef struct netif_st {
    13.4      unsigned long    tx_shmem_frame;
    13.5  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
    13.6      u16              tx_shmem_handle;
    13.7 -    memory_t         tx_shmem_vaddr; 
    13.8 +    unsigned long    tx_shmem_vaddr; 
    13.9      grant_ref_t      tx_shmem_ref; 
   13.10  #endif
   13.11      unsigned long    rx_shmem_frame;
   13.12  #ifdef CONFIG_XEN_NETDEV_GRANT_RX
   13.13      u16              rx_shmem_handle;
   13.14 -    memory_t         rx_shmem_vaddr; 
   13.15 +    unsigned long    rx_shmem_vaddr; 
   13.16      grant_ref_t      rx_shmem_ref; 
   13.17  #endif
   13.18      unsigned int     evtchn;
    14.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Fri Aug 19 18:08:29 2005 +0000
    14.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Fri Aug 19 18:12:48 2005 +0000
    14.3 @@ -43,7 +43,7 @@ static void make_tx_response(netif_t *ne
    14.4  static int  make_rx_response(netif_t *netif, 
    14.5                               u16      id, 
    14.6                               s8       st,
    14.7 -                             memory_t addr,
    14.8 +                             unsigned long addr,
    14.9                               u16      size,
   14.10                               u16      csum_valid);
   14.11  
   14.12 @@ -887,7 +887,7 @@ static void make_tx_response(netif_t *ne
   14.13  static int make_rx_response(netif_t *netif, 
   14.14                              u16      id, 
   14.15                              s8       st,
   14.16 -                            memory_t addr,
   14.17 +                            unsigned long addr,
   14.18                              u16      size,
   14.19                              u16      csum_valid)
   14.20  {
    16.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h	Fri Aug 19 18:08:29 2005 +0000
    16.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h	Fri Aug 19 18:12:48 2005 +0000
    16.3 @@ -507,14 +507,14 @@ HYPERVISOR_vcpu_pickle(
    16.4      int vcpu, vcpu_guest_context_t *ctxt)
    16.5  {
    16.6      int ret;
    16.7 -    unsigned long ign1, ign2;
    16.8 +
    16.9      __asm__ __volatile__ (
   16.10          TRAP_INSTR
   16.11 -        : "=a" (ret), "=b" (ign1), "=c" (ign2)
   16.12 -	: "0" (__HYPERVISOR_sched_op),
   16.13 -	  "1" (SCHEDOP_vcpu_pickle | (vcpu << SCHEDOP_vcpushift)),
   16.14 -	  "2" (ctxt)
   16.15 -        : __syscall_clobber );
   16.16 +        : "=a" (ret)
   16.17 +	: "0" ((unsigned long)__HYPERVISOR_sched_op),
   16.18 +	"D" ((unsigned long)SCHEDOP_vcpu_pickle | (vcpu << SCHEDOP_vcpushift)),
   16.19 +	"S" ((unsigned long)ctxt)
   16.20 +	: __syscall_clobber );
   16.21  
   16.22      return ret;
   16.23  }
    17.1 --- a/linux-2.6-xen-sparse/include/asm-xen/xenbus.h	Fri Aug 19 18:08:29 2005 +0000
    17.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/xenbus.h	Fri Aug 19 18:12:48 2005 +0000
    17.3 @@ -128,4 +128,14 @@ void reregister_xenbus_watches(void);
    17.4  void xenbus_suspend(void);
    17.5  void xenbus_resume(void);
    17.6  
    17.7 +#define XENBUS_IS_ERR_READ(str) ({			\
    17.8 +	if (!IS_ERR(str) && strlen(str) == 0) {		\
    17.9 +		kfree(str);				\
   17.10 +		str = ERR_PTR(-ERANGE);			\
   17.11 +	}						\
   17.12 +	IS_ERR(str);					\
   17.13 +})
   17.14 +
   17.15 +#define XENBUS_EXIST_ERR(err) ((err) == -ENOENT || (err) == -ERANGE)
   17.16 +
   17.17  #endif /* _ASM_XEN_XENBUS_H */
    18.1 --- a/tools/debugger/libxendebug/xendebug.c	Fri Aug 19 18:08:29 2005 +0000
    18.2 +++ b/tools/debugger/libxendebug/xendebug.c	Fri Aug 19 18:12:48 2005 +0000
    18.3 @@ -40,7 +40,7 @@ typedef int boolean;
    18.4  typedef struct bwcpoint                           /* break/watch/catch point */
    18.5  {
    18.6      struct list_head list;
    18.7 -    memory_t address;
    18.8 +    unsigned long address;
    18.9      u32 domain;
   18.10      u8 old_value;                             /* old value for software bkpt */
   18.11  } bwcpoint_t, *bwcpoint_p;
   18.12 @@ -311,7 +311,7 @@ xendebug_continue(int xc_handle,
   18.13  /* access to one page */
   18.14  static int
   18.15  xendebug_memory_page (domain_context_p ctxt, int xc_handle, u32 vcpu,
   18.16 -                      int protection, memory_t address, int length, u8 *buffer)
   18.17 +                      int protection, unsigned long address, int length, u8 *buffer)
   18.18  {
   18.19      vcpu_guest_context_t *vcpu_ctxt = &ctxt->context[vcpu];
   18.20      unsigned long pde, page;
   18.21 @@ -407,7 +407,7 @@ xendebug_memory_page (domain_context_p c
   18.22  /* divide a memory operation into accesses to individual pages */
   18.23  static int
   18.24  xendebug_memory_op (domain_context_p ctxt, int xc_handle, u32 vcpu,
   18.25 -                    int protection, memory_t address, int length, u8 *buffer)
   18.26 +                    int protection, unsigned long address, int length, u8 *buffer)
   18.27  {
   18.28      int      remain;              /* number of bytes to touch past this page */
   18.29      int      bytes   = 0;
   18.30 @@ -431,7 +431,7 @@ int
   18.31  xendebug_read_memory(int xc_handle,
   18.32                       u32 domid,
   18.33                       u32 vcpu,
   18.34 -                     memory_t address,
   18.35 +                     unsigned long address,
   18.36                       u32 length,
   18.37                       u8 *data)
   18.38  {
   18.39 @@ -451,7 +451,7 @@ int
   18.40  xendebug_write_memory(int xc_handle,
   18.41                        u32 domid,
   18.42                        u32 vcpu,
   18.43 -                      memory_t address,
   18.44 +                      unsigned long address,
   18.45                        u32 length,
   18.46                        u8 *data)
   18.47  {
   18.48 @@ -471,7 +471,7 @@ int
   18.49  xendebug_insert_memory_breakpoint(int xc_handle,
   18.50                                    u32 domid,
   18.51                                    u32 vcpu,
   18.52 -                                  memory_t address,
   18.53 +                                  unsigned long address,
   18.54                                    u32 length)
   18.55  {
   18.56      bwcpoint_p bkpt;
   18.57 @@ -517,7 +517,7 @@ int
   18.58  xendebug_remove_memory_breakpoint(int xc_handle,
   18.59                                    u32 domid,
   18.60                                    u32 vcpu,
   18.61 -                                  memory_t address,
   18.62 +                                  unsigned long address,
   18.63                                    u32 length)
   18.64  {
   18.65      bwcpoint_p bkpt = NULL;
    19.1 --- a/tools/debugger/libxendebug/xendebug.h	Fri Aug 19 18:08:29 2005 +0000
    19.2 +++ b/tools/debugger/libxendebug/xendebug.h	Fri Aug 19 18:12:48 2005 +0000
    19.3 @@ -45,7 +45,7 @@ int xendebug_continue(int xc_handle,
    19.4  int xendebug_read_memory(int xc_handle,
    19.5  			 u32 domid,
    19.6  			 u32 vcpu,
    19.7 -			 memory_t address,
    19.8 +			 unsigned long address,
    19.9  			 u32 length,
   19.10  			 u8 *data);
   19.11  
   19.12 @@ -53,7 +53,7 @@ int xendebug_read_memory(int xc_handle,
   19.13  int xendebug_write_memory(int xc_handle,
   19.14  			  u32 domid,
   19.15  			  u32 vcpu,
   19.16 -			  memory_t address,
   19.17 +			  unsigned long address,
   19.18  			  u32 length,
   19.19  			  u8 *data);
   19.20  
   19.21 @@ -61,13 +61,13 @@ int xendebug_write_memory(int xc_handle,
   19.22  int xendebug_insert_memory_breakpoint(int xc_handle,
   19.23  				      u32 domid,
   19.24  				      u32 vcpu,
   19.25 -				      memory_t address,
   19.26 +				      unsigned long address,
   19.27  				      u32 length);
   19.28  
   19.29  int xendebug_remove_memory_breakpoint(int xc_handle,
   19.30  				      u32 domid,
   19.31  				      u32 vcpu,
   19.32 -				      memory_t address,
   19.33 +				      unsigned long address,
   19.34  				      u32 length);
   19.35  
   19.36  int xendebug_query_domain_stop(int xc_handle,
    20.1 --- a/tools/debugger/pdb/linux-2.6-module/debug.c	Fri Aug 19 18:08:29 2005 +0000
    20.2 +++ b/tools/debugger/pdb/linux-2.6-module/debug.c	Fri Aug 19 18:12:48 2005 +0000
    20.3 @@ -26,7 +26,7 @@ static int pdb_page_fault_fn (struct pt_
    20.4  typedef struct bwcpoint                           /* break/watch/catch point */
    20.5  {
    20.6      struct list_head list;
    20.7 -    memory_t address;
    20.8 +    unsigned long address;
    20.9      int length;
   20.10  
   20.11      u8  type;                                                     /* BWC_??? */
   20.12 @@ -109,7 +109,7 @@ pdb_bwc_print_list (void)
   20.13  }
   20.14  
   20.15  bwcpoint_p
   20.16 -pdb_search_watchpoint (u32 process, memory_t address)
   20.17 +pdb_search_watchpoint (u32 process, unsigned long address)
   20.18  {
   20.19      bwcpoint_p bwc_watch = (bwcpoint_p) 0;
   20.20      bwcpoint_p bwc_entry = (bwcpoint_p) 0;
   20.21 @@ -364,7 +364,7 @@ pdb_step (struct task_struct *target)
   20.22  
   20.23  int
   20.24  pdb_insert_memory_breakpoint (struct task_struct *target, 
   20.25 -                              memory_t address, u32 length)
   20.26 +                              unsigned long address, u32 length)
   20.27  {
   20.28      int rc = 0;
   20.29      bwcpoint_p bkpt;
   20.30 @@ -399,7 +399,7 @@ pdb_insert_memory_breakpoint (struct tas
   20.31  
   20.32  int
   20.33  pdb_remove_memory_breakpoint (struct task_struct *target,
   20.34 -                              memory_t address, u32 length)
   20.35 +                              unsigned long address, u32 length)
   20.36  {
   20.37      int rc = 0;
   20.38      bwcpoint_p bkpt = NULL;
   20.39 @@ -760,7 +760,7 @@ pdb_int3_fn (struct pt_regs *regs, long 
   20.40  {
   20.41      pdb_response_t resp;
   20.42      bwcpoint_p bkpt = NULL;
   20.43 -    memory_t address = regs->eip - 1;
   20.44 +    unsigned long address = regs->eip - 1;
   20.45  
   20.46      struct list_head *entry;
   20.47      list_for_each(entry, &bwcpoint_list)
    21.1 --- a/tools/debugger/pdb/linux-2.6-module/module.c	Fri Aug 19 18:08:29 2005 +0000
    21.2 +++ b/tools/debugger/pdb/linux-2.6-module/module.c	Fri Aug 19 18:12:48 2005 +0000
    21.3 @@ -199,7 +199,7 @@ pdb_interrupt (int irq, void *dev_id, st
    21.4  }
    21.5  
    21.6  static void
    21.7 -pdb_send_connection_status(int status, memory_t ring)
    21.8 +pdb_send_connection_status(int status, unsigned long ring)
    21.9  {
   21.10      ctrl_msg_t cmsg = 
   21.11      {
    22.1 --- a/tools/debugger/pdb/linux-2.6-module/pdb_debug.h	Fri Aug 19 18:08:29 2005 +0000
    22.2 +++ b/tools/debugger/pdb/linux-2.6-module/pdb_debug.h	Fri Aug 19 18:12:48 2005 +0000
    22.3 @@ -18,9 +18,9 @@ int pdb_continue (struct task_struct *ta
    22.4  int pdb_step (struct task_struct *target);
    22.5  
    22.6  int pdb_insert_memory_breakpoint (struct task_struct *target, 
    22.7 -                                  memory_t address, u32 length);
    22.8 +                                  unsigned long address, u32 length);
    22.9  int pdb_remove_memory_breakpoint (struct task_struct *target,
   22.10 -                                  memory_t address, u32 length);
   22.11 +                                  unsigned long address, u32 length);
   22.12  int pdb_insert_watchpoint (struct task_struct *target,
   22.13                             pdb_op_watchpt_p watchpt);
   22.14  int pdb_remove_watchpoint (struct task_struct *target,
    23.1 --- a/tools/debugger/pdb/pdb_caml_domain.c	Fri Aug 19 18:08:29 2005 +0000
    23.2 +++ b/tools/debugger/pdb/pdb_caml_domain.c	Fri Aug 19 18:12:48 2005 +0000
    23.3 @@ -203,7 +203,7 @@ dom_read_memory (value context, value ad
    23.4      context_t ctx;
    23.5      int loop;
    23.6      char *buffer;
    23.7 -    memory_t my_address = Int32_val(address);
    23.8 +    unsigned long my_address = Int32_val(address);
    23.9      u32 my_length = Int_val(length);
   23.10  
   23.11      printf ("(pdb) read memory\n");
   23.12 @@ -259,7 +259,7 @@ dom_write_memory (value context, value a
   23.13      context_t ctx;
   23.14  
   23.15      char buffer[4096];  /* a big buffer */
   23.16 -    memory_t  my_address;
   23.17 +    unsigned long  my_address;
   23.18      u32 length = 0;
   23.19  
   23.20      printf ("(pdb) write memory\n");
   23.21 @@ -279,7 +279,7 @@ dom_write_memory (value context, value a
   23.22      }
   23.23      buffer[length++] = Int_val(Field(node, 0));
   23.24  
   23.25 -    my_address = (memory_t) Int32_val(address);
   23.26 +    my_address = (unsigned long) Int32_val(address);
   23.27  
   23.28      if ( xendebug_write_memory(xc_handle, ctx.domain, ctx.vcpu,
   23.29                                 my_address, length, buffer) )
   23.30 @@ -344,7 +344,7 @@ dom_insert_memory_breakpoint (value cont
   23.31      CAMLparam3(context, address, length);
   23.32  
   23.33      context_t ctx;
   23.34 -    memory_t my_address = (memory_t) Int32_val(address);
   23.35 +    unsigned long my_address = (unsigned long) Int32_val(address);
   23.36      int my_length = Int_val(length);
   23.37  
   23.38      decode_context(&ctx, context);
   23.39 @@ -373,7 +373,7 @@ dom_remove_memory_breakpoint (value cont
   23.40  
   23.41      context_t ctx;
   23.42  
   23.43 -    memory_t my_address = (memory_t) Int32_val(address);
   23.44 +    unsigned long my_address = (unsigned long) Int32_val(address);
   23.45      int my_length = Int_val(length);
   23.46  
   23.47      printf ("(pdb) remove memory breakpoint 0x%lx %d\n",
    24.1 --- a/tools/debugger/pdb/pdb_caml_process.c	Fri Aug 19 18:08:29 2005 +0000
    24.2 +++ b/tools/debugger/pdb/pdb_caml_process.c	Fri Aug 19 18:12:48 2005 +0000
    24.3 @@ -495,7 +495,7 @@ proc_insert_memory_breakpoint (value con
    24.4  
    24.5      req.operation = PDB_OPCODE_SET_BKPT;
    24.6      req.process = ctx.process;
    24.7 -    req.u.bkpt.address = (memory_t) Int32_val(address);
    24.8 +    req.u.bkpt.address = (unsigned long) Int32_val(address);
    24.9      req.u.bkpt.length  =  Int_val(length);
   24.10  
   24.11      send_request(ctx.ring, ctx.evtchn, &req);
   24.12 @@ -518,7 +518,7 @@ proc_remove_memory_breakpoint (value con
   24.13  
   24.14      req.operation = PDB_OPCODE_CLR_BKPT;
   24.15      req.process = ctx.process;
   24.16 -    req.u.bkpt.address = (memory_t) Int32_val(address);
   24.17 +    req.u.bkpt.address = (unsigned long) Int32_val(address);
   24.18      req.u.bkpt.length  =  Int_val(length);
   24.19  
   24.20      send_request(ctx.ring, ctx.evtchn, &req);
   24.21 @@ -542,7 +542,7 @@ proc_insert_watchpoint (value context, v
   24.22      req.operation = PDB_OPCODE_SET_WATCHPT;
   24.23      req.process = ctx.process;
   24.24      req.u.watchpt.type    =  Int_val(kind);
   24.25 -    req.u.watchpt.address = (memory_t) Int32_val(address);
   24.26 +    req.u.watchpt.address = (unsigned long) Int32_val(address);
   24.27      req.u.watchpt.length  =  Int_val(length);
   24.28  
   24.29      send_request(ctx.ring, ctx.evtchn, &req);
   24.30 @@ -566,7 +566,7 @@ proc_remove_watchpoint (value context, v
   24.31      req.operation = PDB_OPCODE_CLR_WATCHPT;
   24.32      req.process = ctx.process;
   24.33      req.u.watchpt.type    =  Int_val(kind);
   24.34 -    req.u.watchpt.address = (memory_t) Int32_val(address);
   24.35 +    req.u.watchpt.address = (unsigned long) Int32_val(address);
   24.36      req.u.watchpt.length  =  Int_val(length);
   24.37  
   24.38      send_request(ctx.ring, ctx.evtchn, &req);
    25.1 --- a/tools/debugger/pdb/pdb_caml_xcs.c	Fri Aug 19 18:08:29 2005 +0000
    25.2 +++ b/tools/debugger/pdb/pdb_caml_xcs.c	Fri Aug 19 18:12:48 2005 +0000
    25.3 @@ -50,7 +50,7 @@ xcs_initialize_ring (value domain, value
    25.4  {
    25.5      CAMLparam2(domain, ring);
    25.6      int my_domain = Int_val(domain);
    25.7 -    memory_t my_ring = Int32_val(ring);
    25.8 +    unsigned long my_ring = Int32_val(ring);
    25.9  
   25.10      pdb_front_ring_t *front_ring;
   25.11      pdb_sring_t *sring;
    26.1 --- a/tools/libxc/xc.h	Fri Aug 19 18:08:29 2005 +0000
    26.2 +++ b/tools/libxc/xc.h	Fri Aug 19 18:12:48 2005 +0000
    26.3 @@ -515,25 +515,25 @@ int xc_grant_interface_open(void);
    26.4   */
    26.5  int xc_grant_interface_close(int xc_handle);
    26.6  
    26.7 -int xc_gnttab_map_grant_ref(int         xc_handle,
    26.8 -                            memory_t    host_virt_addr,
    26.9 -                            u32         dom,
   26.10 -                            u16         ref,
   26.11 -                            u16         flags,
   26.12 -                            s16        *handle,
   26.13 -                            memory_t   *dev_bus_addr);
   26.14 +int xc_gnttab_map_grant_ref(int  xc_handle,
   26.15 +                            u64  host_virt_addr,
   26.16 +                            u32  dom,
   26.17 +                            u16  ref,
   26.18 +                            u16  flags,
   26.19 +                            s16 *handle,
   26.20 +                            u64 *dev_bus_addr);
   26.21  
   26.22 -int xc_gnttab_unmap_grant_ref(int       xc_handle,
   26.23 -                              memory_t  host_virt_addr,
   26.24 -                              memory_t  dev_bus_addr,
   26.25 -                              u16       handle,
   26.26 -                              s16      *status);
   26.27 +int xc_gnttab_unmap_grant_ref(int  xc_handle,
   26.28 +                              u64  host_virt_addr,
   26.29 +                              u64  dev_bus_addr,
   26.30 +                              u16  handle,
   26.31 +                              s16 *status);
   26.32  
   26.33  int xc_gnttab_setup_table(int        xc_handle,
   26.34                            u32        dom,
   26.35                            u16        nr_frames,
   26.36                            s16       *status,
   26.37 -                          memory_t **frame_list);
   26.38 +                          unsigned long **frame_list);
   26.39  
   26.40  /* Grant debug builds only: */
   26.41  int xc_gnttab_dump_table(int        xc_handle,
    27.1 --- a/tools/libxc/xc_gnttab.c	Fri Aug 19 18:08:29 2005 +0000
    27.2 +++ b/tools/libxc/xc_gnttab.c	Fri Aug 19 18:12:48 2005 +0000
    27.3 @@ -40,12 +40,12 @@ do_gnttab_op(int xc_handle,
    27.4  
    27.5  
    27.6  int xc_gnttab_map_grant_ref(int         xc_handle,
    27.7 -                            memory_t    host_virt_addr,
    27.8 +                            u64    host_virt_addr,
    27.9                              u32         dom,
   27.10                              u16         ref,
   27.11                              u16         flags,
   27.12                              s16        *handle,
   27.13 -                            memory_t   *dev_bus_addr)
   27.14 +                            u64   *dev_bus_addr)
   27.15  {
   27.16      struct gnttab_map_grant_ref op;
   27.17      int rc;
   27.18 @@ -67,8 +67,8 @@ int xc_gnttab_map_grant_ref(int         
   27.19  
   27.20  
   27.21  int xc_gnttab_unmap_grant_ref(int       xc_handle,
   27.22 -                              memory_t  host_virt_addr,
   27.23 -                              memory_t  dev_bus_addr,
   27.24 +                              u64  host_virt_addr,
   27.25 +                              u64  dev_bus_addr,
   27.26                                u16       handle,
   27.27                                s16      *status)
   27.28  {
   27.29 @@ -92,7 +92,7 @@ int xc_gnttab_setup_table(int        xc_
   27.30                            u32        dom,
   27.31                            u16        nr_frames,
   27.32                            s16       *status,
   27.33 -                          memory_t **frame_list)
   27.34 +                          unsigned long **frame_list)
   27.35  {
   27.36      struct gnttab_setup_table op;
   27.37      int rc, i;
    28.1 --- a/tools/python/xen/lowlevel/xu/xu.c	Fri Aug 19 18:08:29 2005 +0000
    28.2 +++ b/tools/python/xen/lowlevel/xu/xu.c	Fri Aug 19 18:12:48 2005 +0000
    28.3 @@ -844,7 +844,7 @@ static PyObject *xu_message_new(PyObject
    28.4      case TYPE(CMSG_BLKIF_BE, CMSG_BLKIF_BE_CONNECT):
    28.5          P2C(blkif_be_connect_t, domid,        u32);
    28.6          P2C(blkif_be_connect_t, blkif_handle, u32);
    28.7 -        P2C(blkif_be_connect_t, shmem_frame,  memory_t);
    28.8 +        P2C(blkif_be_connect_t, shmem_frame,  unsigned long);
    28.9          P2C(blkif_be_connect_t, shmem_ref,    u32);
   28.10          P2C(blkif_be_connect_t, evtchn,       u16);
   28.11          break;
   28.12 @@ -906,9 +906,9 @@ static PyObject *xu_message_new(PyObject
   28.13      case TYPE(CMSG_NETIF_BE, CMSG_NETIF_BE_CONNECT):
   28.14          P2C(netif_be_connect_t, domid,          u32);
   28.15          P2C(netif_be_connect_t, netif_handle,   u32);
   28.16 -        P2C(netif_be_connect_t, tx_shmem_frame, memory_t);
   28.17 +        P2C(netif_be_connect_t, tx_shmem_frame, unsigned long);
   28.18          P2C(netif_be_connect_t, tx_shmem_ref,   u32); 
   28.19 -        P2C(netif_be_connect_t, rx_shmem_frame, memory_t);
   28.20 +        P2C(netif_be_connect_t, rx_shmem_frame, unsigned long);
   28.21          P2C(netif_be_connect_t, rx_shmem_ref,   u32); 
   28.22          P2C(netif_be_connect_t, evtchn,         u16); 
   28.23          break;
   28.24 @@ -942,7 +942,7 @@ static PyObject *xu_message_new(PyObject
   28.25          P2C(usbif_fe_driver_status_changed_t, status, u32);
   28.26          break;
   28.27      case TYPE(CMSG_USBIF_FE, CMSG_USBIF_FE_INTERFACE_CONNECT):
   28.28 -        P2C(usbif_fe_interface_connect_t, shmem_frame, memory_t);
   28.29 +        P2C(usbif_fe_interface_connect_t, shmem_frame, unsigned long);
   28.30          break;
   28.31      case TYPE(CMSG_USBIF_FE, CMSG_USBIF_FE_INTERFACE_DISCONNECT):
   28.32          break;
   28.33 @@ -956,7 +956,7 @@ static PyObject *xu_message_new(PyObject
   28.34          break;
   28.35      case TYPE(CMSG_USBIF_BE, CMSG_USBIF_BE_CONNECT):
   28.36          P2C(usbif_be_connect_t, domid, domid_t);
   28.37 -        P2C(usbif_be_connect_t, shmem_frame, memory_t);
   28.38 +        P2C(usbif_be_connect_t, shmem_frame, unsigned long);
   28.39          P2C(usbif_be_connect_t, evtchn, u32);
   28.40          P2C(usbif_be_connect_t, bandwidth, u32);
   28.41          P2C(usbif_be_connect_t, status, u32);
    30.1 --- a/tools/xentrace/xentrace.c	Fri Aug 19 18:08:29 2005 +0000
    30.2 +++ b/tools/xentrace/xentrace.c	Fri Aug 19 18:12:48 2005 +0000
    30.3 @@ -95,13 +95,13 @@ void write_rec(unsigned int cpu, struct 
    30.4  
    30.5  /**
    30.6   * get_tbufs - get pointer to and size of the trace buffers
    30.7 - * @mach_addr: location to store machine address if the trace buffers to
    30.8 - * @size:      location to store the size of a trace buffer to
    30.9 + * @mfn:  location to store mfn of the trace buffers to
   30.10 + * @size: location to store the size of a trace buffer to
   30.11   *
   30.12   * Gets the machine address of the trace pointer area and the size of the
   30.13   * per CPU buffers.
   30.14   */
   30.15 -void get_tbufs(unsigned long *mach_addr, unsigned long *size)
   30.16 +void get_tbufs(unsigned long *mfn, unsigned long *size)
   30.17  {
   30.18      int ret;
   30.19      dom0_op_t op;                        /* dom0 op we'll build             */
   30.20 @@ -121,19 +121,19 @@ void get_tbufs(unsigned long *mach_addr,
   30.21          exit(EXIT_FAILURE);
   30.22      }
   30.23  
   30.24 -    *mach_addr = op.u.tbufcontrol.mach_addr;
   30.25 -    *size      = op.u.tbufcontrol.size;
   30.26 +    *mfn  = op.u.tbufcontrol.buffer_mfn;
   30.27 +    *size = op.u.tbufcontrol.size;
   30.28  }
   30.29  
   30.30  /**
   30.31   * map_tbufs - memory map Xen trace buffers into user space
   30.32 - * @tbufs:     machine address of the trace buffers
   30.33 + * @tbufs_mfn: mfn of the trace buffers
   30.34   * @num:       number of trace buffers to map
   30.35   * @size:      size of each trace buffer
   30.36   *
   30.37   * Maps the Xen trace buffers them into process address space.
   30.38   */
   30.39 -struct t_buf *map_tbufs(unsigned long tbufs_mach, unsigned int num,
   30.40 +struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
   30.41                          unsigned long size)
   30.42  {
   30.43      int xc_handle;                  /* file descriptor for /proc/xen/privcmd */
   30.44 @@ -149,7 +149,7 @@ struct t_buf *map_tbufs(unsigned long tb
   30.45  
   30.46      tbufs_mapped = xc_map_foreign_range(xc_handle, 0 /* Dom 0 ID */,
   30.47                                          size * num, PROT_READ,
   30.48 -                                        tbufs_mach >> PAGE_SHIFT);
   30.49 +                                        tbufs_mfn);
   30.50  
   30.51      xc_interface_close(xc_handle);
   30.52  
   30.53 @@ -231,7 +231,7 @@ struct t_buf **init_bufs_ptrs(void *bufs
   30.54  
   30.55  /**
   30.56   * init_rec_ptrs - initialises data area pointers to locations in user space
   30.57 - * @tbufs_mach:    machine base address of the trace buffer area
   30.58 + * @tbufs_mfn:     base mfn of the trace buffer area
   30.59   * @tbufs_mapped:  user virtual address of base of trace buffer area
   30.60   * @meta:          array of user-space pointers to struct t_buf's of metadata
   30.61   * @num:           number of trace buffers
   30.62 @@ -240,7 +240,7 @@ struct t_buf **init_bufs_ptrs(void *bufs
   30.63   * mapped in user space.  Note that the trace buffer metadata contains machine
   30.64   * pointers - the array returned allows more convenient access to them.
   30.65   */
   30.66 -struct t_rec **init_rec_ptrs(unsigned long tbufs_mach,
   30.67 +struct t_rec **init_rec_ptrs(unsigned long tbufs_mfn,
   30.68                               struct t_buf *tbufs_mapped,
   30.69                               struct t_buf **meta,
   30.70                               unsigned int num)
   30.71 @@ -256,7 +256,7 @@ struct t_rec **init_rec_ptrs(unsigned lo
   30.72      }
   30.73  
   30.74      for ( i = 0; i < num; i++ )
   30.75 -        data[i] = (struct t_rec *)(meta[i]->rec_addr - tbufs_mach
   30.76 +        data[i] = (struct t_rec *)(meta[i]->rec_addr - (tbufs_mfn<<XC_PAGE_SHIFT) /* XXX */
   30.77                                     + (unsigned long)tbufs_mapped);
   30.78  
   30.79      return data;
   30.80 @@ -330,7 +330,7 @@ int monitor_tbufs(FILE *logfile)
   30.81      struct t_rec **data;         /* pointers to the trace buffer data areas
   30.82                                    * where they are mapped into user space.   */
   30.83      unsigned long *cons;         /* store tail indexes for the trace buffers */
   30.84 -    unsigned long tbufs_mach;    /* machine address of the tbufs             */
   30.85 +    unsigned long tbufs_mfn;     /* mfn of the tbufs                         */
   30.86      unsigned int  num;           /* number of trace buffers / logical CPUS   */
   30.87      unsigned long size;          /* size of a single trace buffer            */
   30.88  
   30.89 @@ -340,14 +340,14 @@ int monitor_tbufs(FILE *logfile)
   30.90      num = get_num_cpus();
   30.91  
   30.92      /* setup access to trace buffers */
   30.93 -    get_tbufs(&tbufs_mach, &size);
   30.94 -    tbufs_mapped = map_tbufs(tbufs_mach, num, size);
   30.95 +    get_tbufs(&tbufs_mfn, &size);
   30.96 +    tbufs_mapped = map_tbufs(tbufs_mfn, num, size);
   30.97  
   30.98      size_in_recs = (size - sizeof(struct t_buf)) / sizeof(struct t_rec);
   30.99  
  30.100      /* build arrays of convenience ptrs */
  30.101      meta  = init_bufs_ptrs (tbufs_mapped, num, size);
  30.102 -    data  = init_rec_ptrs  (tbufs_mach, tbufs_mapped, meta, num);
  30.103 +    data  = init_rec_ptrs  (tbufs_mfn, tbufs_mapped, meta, num);
  30.104      cons  = init_tail_idxs (meta, num);
  30.105  
  30.106      /* now, scan buffers for events */
    31.1 --- a/xen/arch/x86/physdev.c	Fri Aug 19 18:08:29 2005 +0000
    31.2 +++ b/xen/arch/x86/physdev.c	Fri Aug 19 18:12:48 2005 +0000
    31.3 @@ -106,7 +106,7 @@ long do_physdev_op(physdev_op_t *uop)
    31.4               (op.u.set_iobitmap.nr_ports > 65536) )
    31.5              break;
    31.6          ret = 0;
    31.7 -        current->arch.iobmp       = (u8 *)op.u.set_iobitmap.bitmap;
    31.8 +        current->arch.iobmp       = op.u.set_iobitmap.bitmap;
    31.9          current->arch.iobmp_limit = op.u.set_iobitmap.nr_ports;
   31.10          break;
   31.11      default:
    32.1 --- a/xen/common/trace.c	Fri Aug 19 18:08:29 2005 +0000
    32.2 +++ b/xen/common/trace.c	Fri Aug 19 18:12:48 2005 +0000
    32.3 @@ -113,10 +113,10 @@ int tb_control(dom0_tbufcontrol_t *tbc)
    32.4      switch ( tbc->op)
    32.5      {
    32.6      case DOM0_TBUF_GET_INFO:
    32.7 -        tbc->cpu_mask  = tb_cpu_mask;
    32.8 -        tbc->evt_mask  = tb_event_mask;
    32.9 -        tbc->mach_addr = __pa(t_bufs[0]);
   32.10 -        tbc->size      = opt_tbuf_size * PAGE_SIZE;
   32.11 +        tbc->cpu_mask   = tb_cpu_mask;
   32.12 +        tbc->evt_mask   = tb_event_mask;
   32.13 +        tbc->buffer_mfn = __pa(t_bufs[0]) >> PAGE_SHIFT;
   32.14 +        tbc->size       = opt_tbuf_size * PAGE_SIZE;
   32.15          break;
   32.16      case DOM0_TBUF_SET_CPU_MASK:
   32.17          tb_cpu_mask = tbc->cpu_mask;
    33.1 --- a/xen/include/public/arch-ia64.h	Fri Aug 19 18:08:29 2005 +0000
    33.2 +++ b/xen/include/public/arch-ia64.h	Fri Aug 19 18:12:48 2005 +0000
    33.3 @@ -13,9 +13,6 @@
    33.4  
    33.5  #ifndef __ASSEMBLY__
    33.6  
    33.7 -/* NB. Both the following are 64 bits each. */
    33.8 -typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
    33.9 -
   33.10  #define MAX_NR_SECTION  32  // at most 32 memory holes
   33.11  typedef struct {
   33.12      unsigned long	start; 	/* start of memory hole */
    34.1 --- a/xen/include/public/arch-x86_32.h	Fri Aug 19 18:08:29 2005 +0000
    34.2 +++ b/xen/include/public/arch-x86_32.h	Fri Aug 19 18:12:48 2005 +0000
    34.3 @@ -63,9 +63,6 @@
    34.4  
    34.5  #ifndef __ASSEMBLY__
    34.6  
    34.7 -/* NB. Both the following are 32 bits each. */
    34.8 -typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
    34.9 -
   34.10  /*
   34.11   * Send an array of these to HYPERVISOR_set_trap_table()
   34.12   */
   34.13 @@ -74,10 +71,10 @@ typedef unsigned long memory_t;   /* Ful
   34.14  #define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
   34.15  #define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
   34.16  typedef struct trap_info {
   34.17 -    u8       vector;  /* exception vector                              */
   34.18 -    u8       flags;   /* 0-3: privilege level; 4: clear event enable?  */
   34.19 -    u16      cs;      /* code selector                                 */
   34.20 -    memory_t address; /* code address                                  */
   34.21 +    u8       vector;       /* exception vector                              */
   34.22 +    u8       flags;        /* 0-3: privilege level; 4: clear event enable?  */
   34.23 +    u16      cs;           /* code selector                                 */
   34.24 +    unsigned long address; /* code offset                                   */
   34.25  } trap_info_t;
   34.26  
   34.27  typedef struct cpu_user_regs {
    35.1 --- a/xen/include/public/arch-x86_64.h	Fri Aug 19 18:08:29 2005 +0000
    35.2 +++ b/xen/include/public/arch-x86_64.h	Fri Aug 19 18:12:48 2005 +0000
    35.3 @@ -103,9 +103,6 @@ struct switch_to_user {
    35.4      /* Bottom of switch_to_user stack frame. */
    35.5  };
    35.6  
    35.7 -/* NB. Both the following are 64 bits each. */
    35.8 -typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
    35.9 -
   35.10  /*
   35.11   * Send an array of these to HYPERVISOR_set_trap_table().
   35.12   * N.B. As in x86/32 mode, the privilege level specifies which modes may enter
   35.13 @@ -121,10 +118,10 @@ typedef unsigned long memory_t;   /* Ful
   35.14  #define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
   35.15  #define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
   35.16  typedef struct trap_info {
   35.17 -    u8       vector;  /* exception vector                              */
   35.18 -    u8       flags;   /* 0-3: privilege level; 4: clear event enable?  */
   35.19 -    u16      cs;      /* code selector                                 */
   35.20 -    memory_t address; /* code address                                  */
   35.21 +    u8       vector;       /* exception vector                              */
   35.22 +    u8       flags;        /* 0-3: privilege level; 4: clear event enable?  */
   35.23 +    u16      cs;           /* code selector                                 */
   35.24 +    unsigned long address; /* code offset                                   */
   35.25  } trap_info_t;
   35.26  
   35.27  typedef struct cpu_user_regs {
    36.1 --- a/xen/include/public/dom0_ops.h	Fri Aug 19 18:08:29 2005 +0000
    36.2 +++ b/xen/include/public/dom0_ops.h	Fri Aug 19 18:12:48 2005 +0000
    36.3 @@ -19,7 +19,7 @@
    36.4   * This makes sure that old versions of dom0 tools will stop working in a
    36.5   * well-defined way (rather than crashing the machine, for instance).
    36.6   */
    36.7 -#define DOM0_INTERFACE_VERSION   0xAAAA100E
    36.8 +#define DOM0_INTERFACE_VERSION   0xAAAA100F
    36.9  
   36.10  /************************************************************************/
   36.11  
   36.12 @@ -27,10 +27,10 @@
   36.13  typedef struct {
   36.14      /* IN variables. */
   36.15      domid_t       domain;
   36.16 -    memory_t      max_pfns;
   36.17 +    unsigned long max_pfns;
   36.18      void         *buffer;
   36.19      /* OUT variables. */
   36.20 -    memory_t      num_pfns;
   36.21 +    unsigned long num_pfns;
   36.22  } dom0_getmemlist_t;
   36.23  
   36.24  #define DOM0_SCHEDCTL          6
   36.25 @@ -83,9 +83,9 @@ typedef struct {
   36.26  #define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code.  */
   36.27  #define DOMFLAGS_SHUTDOWNSHIFT 16
   36.28      u32      flags;
   36.29 -    memory_t tot_pages;
   36.30 -    memory_t max_pages;
   36.31 -    memory_t shared_info_frame;       /* MFN of shared_info struct */
   36.32 +    unsigned long tot_pages;
   36.33 +    unsigned long max_pages;
   36.34 +    unsigned long shared_info_frame;       /* MFN of shared_info struct */
   36.35      u64      cpu_time;
   36.36      u32      n_vcpu;
   36.37      s32      vcpu_to_cpu[MAX_VIRT_CPUS];  /* current mapping   */
   36.38 @@ -155,7 +155,7 @@ typedef struct {
   36.39  
   36.40  typedef struct {
   36.41      /* IN variables. */
   36.42 -    memory_t pfn;          /* Machine page frame number to query.       */
   36.43 +    unsigned long pfn;     /* Machine page frame number to query.       */
   36.44      domid_t domain;        /* To which domain does the frame belong?    */
   36.45      /* OUT variables. */
   36.46      /* Is the page PINNED to a type? */
   36.47 @@ -197,7 +197,7 @@ typedef struct {
   36.48      unsigned long cpu_mask;
   36.49      u32           evt_mask;
   36.50      /* OUT variables */
   36.51 -    memory_t mach_addr;
   36.52 +    unsigned long buffer_mfn;
   36.53      u32      size;
   36.54  } dom0_tbufcontrol_t;
   36.55  
   36.56 @@ -211,8 +211,8 @@ typedef struct {
   36.57      u32      sockets_per_node;
   36.58      u32      nr_nodes;
   36.59      u32      cpu_khz;
   36.60 -    memory_t total_pages;
   36.61 -    memory_t free_pages;
   36.62 +    unsigned long total_pages;
   36.63 +    unsigned long free_pages;
   36.64  } dom0_physinfo_t;
   36.65  
   36.66  /*
   36.67 @@ -252,7 +252,7 @@ typedef struct {
   36.68      u32            op;
   36.69      unsigned long *dirty_bitmap; /* pointer to locked buffer */
   36.70      /* IN/OUT variables. */
   36.71 -    memory_t       pages;        /* size of buffer, updated with actual size */
   36.72 +    unsigned long  pages;        /* size of buffer, updated with actual size */
   36.73      /* OUT variables. */
   36.74      dom0_shadow_control_stats_t stats;
   36.75  } dom0_shadow_control_t;
   36.76 @@ -260,15 +260,15 @@ typedef struct {
   36.77  #define DOM0_SETDOMAINMAXMEM   28
   36.78  typedef struct {
   36.79      /* IN variables. */
   36.80 -    domid_t     domain;
   36.81 -    memory_t    max_memkb;
   36.82 +    domid_t       domain;
   36.83 +    unsigned long max_memkb;
   36.84  } dom0_setdomainmaxmem_t;
   36.85  
   36.86  #define DOM0_GETPAGEFRAMEINFO2 29   /* batched interface */
   36.87  typedef struct {
   36.88      /* IN variables. */
   36.89 -    domid_t  domain;
   36.90 -    memory_t num;
   36.91 +    domid_t        domain;
   36.92 +    unsigned long  num;
   36.93      /* IN/OUT variables. */
   36.94      unsigned long *array;
   36.95  } dom0_getpageframeinfo2_t;
   36.96 @@ -283,12 +283,12 @@ typedef struct {
   36.97  #define DOM0_ADD_MEMTYPE         31
   36.98  typedef struct {
   36.99      /* IN variables. */
  36.100 -    memory_t pfn;
  36.101 -    memory_t nr_pfns;
  36.102 -    u32      type;
  36.103 +    unsigned long pfn;
  36.104 +    unsigned long nr_pfns;
  36.105 +    u32           type;
  36.106      /* OUT variables. */
  36.107 -    u32      handle;
  36.108 -    u32      reg;
  36.109 +    u32           handle;
  36.110 +    u32           reg;
  36.111  } dom0_add_memtype_t;
  36.112  
  36.113  /*
  36.114 @@ -311,8 +311,8 @@ typedef struct {
  36.115      /* IN variables. */
  36.116      u32      reg;
  36.117      /* OUT variables. */
  36.118 -    memory_t pfn;
  36.119 -    memory_t nr_pfns;
  36.120 +    unsigned long pfn;
  36.121 +    unsigned long nr_pfns;
  36.122      u32      type;
  36.123  } dom0_read_memtype_t;
  36.124  
  36.125 @@ -361,10 +361,10 @@ typedef struct {
  36.126  typedef struct {
  36.127      /* IN variables. */
  36.128      domid_t               first_domain;
  36.129 -    memory_t              max_domains;
  36.130 +    unsigned int          max_domains;
  36.131      dom0_getdomaininfo_t *buffer;
  36.132      /* OUT variables. */
  36.133 -    memory_t              num_domains;
  36.134 +    unsigned int          num_domains;
  36.135  } dom0_getdomaininfolist_t;
  36.136  
  36.137  #define DOM0_PLATFORM_QUIRK      39  
    37.1 --- a/xen/include/public/grant_table.h	Fri Aug 19 18:08:29 2005 +0000
    37.2 +++ b/xen/include/public/grant_table.h	Fri Aug 19 18:12:48 2005 +0000
    37.3 @@ -153,13 +153,13 @@ typedef u16 grant_ref_t;
    37.4  #define GNTTABOP_map_grant_ref        0
    37.5  typedef struct gnttab_map_grant_ref {
    37.6      /* IN parameters. */
    37.7 -    memory_t    host_addr;
    37.8 +    u64         host_addr;
    37.9      domid_t     dom;
   37.10      grant_ref_t ref;
   37.11      u16         flags;                /* GNTMAP_* */
   37.12      /* OUT parameters. */
   37.13      s16         handle;               /* +ve: handle; -ve: GNTST_* */
   37.14 -    memory_t    dev_bus_addr;
   37.15 +    u64         dev_bus_addr;
   37.16  } gnttab_map_grant_ref_t;
   37.17  
   37.18  /*
   37.19 @@ -176,8 +176,8 @@ typedef struct gnttab_map_grant_ref {
   37.20  #define GNTTABOP_unmap_grant_ref      1
   37.21  typedef struct gnttab_unmap_grant_ref {
   37.22      /* IN parameters. */
   37.23 -    memory_t    host_addr;
   37.24 -    memory_t    dev_bus_addr;
   37.25 +    u64         host_addr;
   37.26 +    u64         dev_bus_addr;
   37.27      u16         handle;
   37.28      /* OUT parameters. */
   37.29      s16         status;               /* GNTST_* */
   37.30 @@ -223,7 +223,7 @@ typedef struct gnttab_dump_table {
   37.31   */
   37.32  #define GNTTABOP_donate                4
   37.33  typedef struct {
   37.34 -    memory_t    mfn;		      /*  0 */
   37.35 +    unsigned long mfn;		      /*  0 */
   37.36      domid_t     domid;		      /*  4 */
   37.37      u16         handle;               /*  8 */
   37.38      s16         status;               /*  10: GNTST_* */
    38.1 --- a/xen/include/public/io/domain_controller.h	Fri Aug 19 18:08:29 2005 +0000
    38.2 +++ b/xen/include/public/io/domain_controller.h	Fri Aug 19 18:12:48 2005 +0000
    38.3 @@ -139,7 +139,7 @@ typedef struct blkif_fe_driver_status {
    38.4   */
    38.5  typedef struct blkif_fe_interface_connect {
    38.6      u32      handle;
    38.7 -    memory_t shmem_frame;
    38.8 +    unsigned long shmem_frame;
    38.9      int      shmem_ref;
   38.10  } blkif_fe_interface_connect_t;
   38.11  
   38.12 @@ -249,7 +249,7 @@ typedef struct blkif_be_connect {
   38.13      /* IN */
   38.14      domid_t    domid;         /* Domain attached to new interface.   */
   38.15      u32        blkif_handle;  /* Domain-specific interface handle.   */
   38.16 -    memory_t   shmem_frame;   /* Page cont. shared comms window.     */
   38.17 +    unsigned long shmem_frame;/* Page cont. shared comms window.     */
   38.18      int        shmem_ref;     /* Grant table reference.              */
   38.19      u32        evtchn;        /* Event channel for notifications.    */
   38.20      /* OUT */
   38.21 @@ -364,11 +364,11 @@ typedef struct netif_fe_driver_status {
   38.22   *  STATUS_CONNECTED message.
   38.23   */
   38.24  typedef struct netif_fe_interface_connect {
   38.25 -    u32        handle;
   38.26 -    memory_t   tx_shmem_frame; 
   38.27 -    int        tx_shmem_ref;
   38.28 -    memory_t   rx_shmem_frame;
   38.29 -    int        rx_shmem_ref;
   38.30 +    u32           handle;
   38.31 +    unsigned long tx_shmem_frame; 
   38.32 +    int           tx_shmem_ref;
   38.33 +    unsigned long rx_shmem_frame;
   38.34 +    int           rx_shmem_ref;
   38.35  } netif_fe_interface_connect_t;
   38.36  
   38.37  /*
   38.38 @@ -486,13 +486,13 @@ typedef struct netif_be_creditlimit {
   38.39   */
   38.40  typedef struct netif_be_connect { 
   38.41      /* IN */
   38.42 -    domid_t    domid;          /* Domain attached to new interface.   */
   38.43 -    u32        netif_handle;   /* Domain-specific interface handle.   */
   38.44 -    memory_t   tx_shmem_frame; /* Page cont. tx shared comms window.  */
   38.45 -    int        tx_shmem_ref;   /* Grant reference for above           */
   38.46 -    memory_t   rx_shmem_frame; /* Page cont. rx shared comms window.  */
   38.47 -    int        rx_shmem_ref;   /* Grant reference for above           */
   38.48 -    u16        evtchn;         /* Event channel for notifications.    */
   38.49 +    domid_t    domid;            /* Domain attached to new interface.   */
   38.50 +    u32        netif_handle;     /* Domain-specific interface handle.   */
   38.51 +    unsigned long tx_shmem_frame;/* Page cont. tx shared comms window.  */
   38.52 +    int        tx_shmem_ref;     /* Grant reference for above           */
   38.53 +    unsigned long rx_shmem_frame;/* Page cont. rx shared comms window.  */
   38.54 +    int        rx_shmem_ref;     /* Grant reference for above           */
   38.55 +    u16        evtchn;           /* Event channel for notifications.    */
   38.56      /* OUT */
   38.57      u32        status;
   38.58  } netif_be_connect_t;
   38.59 @@ -577,7 +577,7 @@ typedef struct usbif_fe_driver_status_ch
   38.60   *  STATUS_CONNECTED message.
   38.61   */
   38.62  typedef struct usbif_fe_interface_connect {
   38.63 -    memory_t shmem_frame;
   38.64 +    unsigned long shmem_frame;
   38.65  } usbif_fe_interface_connect_t;
   38.66  
   38.67  /*
   38.68 @@ -660,7 +660,7 @@ typedef struct usbif_be_destroy {
   38.69  typedef struct usbif_be_connect { 
   38.70      /* IN */
   38.71      domid_t    domid;         /* Domain attached to new interface.   */
   38.72 -    memory_t   shmem_frame;   /* Page cont. shared comms window.     */
   38.73 +    unsigned long shmem_frame;/* Page cont. shared comms window.     */
   38.74      u32        evtchn;        /* Event channel for notifications.    */
   38.75      u32        bandwidth;     /* Bandwidth allocated for isoch / int - us
   38.76                                 * per 1ms frame (ie between 0 and 900 or 800
   38.77 @@ -780,7 +780,7 @@ typedef struct pdb_Connection {
   38.78  #define PDB_CONNECTION_STATUS_UP   1
   38.79  #define PDB_CONNECTION_STATUS_DOWN 2
   38.80      u32      status;
   38.81 -    memory_t ring;       /* status: UP */
   38.82 +    unsigned long ring;  /* status: UP */
   38.83      u32      evtchn;     /* status: UP */
   38.84  } pdb_connection_t, *pdb_connection_p;
   38.85  
    39.1 --- a/xen/include/public/io/netif.h	Fri Aug 19 18:08:29 2005 +0000
    39.2 +++ b/xen/include/public/io/netif.h	Fri Aug 19 18:12:48 2005 +0000
    39.3 @@ -10,7 +10,7 @@
    39.4  #define __XEN_PUBLIC_IO_NETIF_H__
    39.5  
    39.6  typedef struct netif_tx_request {
    39.7 -    memory_t addr;   /* Machine address of packet.  */
    39.8 +    unsigned long addr;   /* Machine address of packet.  */
    39.9      u16      csum_blank:1; /* Proto csum field blank?   */
   39.10      u16      id:15;  /* Echoed in response message. */
   39.11      u16      size;   /* Packet size in bytes.       */
   39.12 @@ -32,7 +32,7 @@ typedef struct {
   39.13  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
   39.14      u32      addr;   /*  0: Offset in page of start of received packet  */
   39.15  #else
   39.16 -    memory_t addr;   /* Machine address of packet.              */
   39.17 +    unsigned long addr; /* Machine address of packet.              */
   39.18  #endif
   39.19      u16      csum_valid:1; /* Protocol checksum is validated?       */
   39.20      u16      id:15;
    40.1 --- a/xen/include/public/physdev.h	Fri Aug 19 18:08:29 2005 +0000
    40.2 +++ b/xen/include/public/physdev.h	Fri Aug 19 18:12:48 2005 +0000
    40.3 @@ -27,8 +27,8 @@ typedef struct physdevop_set_iopl {
    40.4  
    40.5  typedef struct physdevop_set_iobitmap {
    40.6      /* IN */
    40.7 -    memory_t bitmap;
    40.8 -    u32      nr_ports;
    40.9 +    char *bitmap;
   40.10 +    u32   nr_ports;
   40.11  } physdevop_set_iobitmap_t;
   40.12  
   40.13  typedef struct physdevop_apic {
    41.1 --- a/xen/include/public/xen.h	Fri Aug 19 18:08:29 2005 +0000
    41.2 +++ b/xen/include/public/xen.h	Fri Aug 19 18:12:48 2005 +0000
    41.3 @@ -171,9 +171,9 @@ struct mmuext_op {
    41.4      unsigned int cmd;
    41.5      union {
    41.6          /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR, REASSIGN_PAGE */
    41.7 -        memory_t mfn;
    41.8 +        unsigned long mfn;
    41.9          /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
   41.10 -        memory_t linear_addr;
   41.11 +        unsigned long linear_addr;
   41.12      };
   41.13      union {
   41.14          /* SET_LDT */
   41.15 @@ -438,18 +438,18 @@ typedef struct shared_info {
   41.16  #define MAX_GUEST_CMDLINE 1024
   41.17  typedef struct start_info {
   41.18      /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
   41.19 -    memory_t nr_pages;        /* Total pages allocated to this domain.    */
   41.20 -    memory_t shared_info;     /* MACHINE address of shared info struct.   */
   41.21 +    unsigned long nr_pages;   /* Total pages allocated to this domain.    */
   41.22 +    unsigned long shared_info;/* MACHINE address of shared info struct.   */
   41.23      u32      flags;           /* SIF_xxx flags.                           */
   41.24      u16      domain_controller_evtchn;
   41.25      /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
   41.26 -    memory_t pt_base;         /* VIRTUAL address of page directory.       */
   41.27 -    memory_t nr_pt_frames;    /* Number of bootstrap p.t. frames.         */
   41.28 -    memory_t mfn_list;        /* VIRTUAL address of page-frame list.      */
   41.29 -    memory_t mod_start;       /* VIRTUAL address of pre-loaded module.    */
   41.30 -    memory_t mod_len;         /* Size (bytes) of pre-loaded module.       */
   41.31 +    unsigned long pt_base;    /* VIRTUAL address of page directory.       */
   41.32 +    unsigned long nr_pt_frames;/* Number of bootstrap p.t. frames.        */
   41.33 +    unsigned long mfn_list;   /* VIRTUAL address of page-frame list.      */
   41.34 +    unsigned long mod_start;  /* VIRTUAL address of pre-loaded module.    */
   41.35 +    unsigned long mod_len;    /* Size (bytes) of pre-loaded module.       */
   41.36      s8 cmd_line[MAX_GUEST_CMDLINE];
   41.37 -    memory_t store_mfn;       /* MACHINE page number of shared page.      */
   41.38 +    unsigned long store_mfn;  /* MACHINE page number of shared page.      */
   41.39      u16      store_evtchn;    /* Event channel for store communication.   */
   41.40  } start_info_t;
   41.41