ia64/xen-unstable

changeset 15759:cb3c7f006077

[IA64] Use common xencomm.c and remove ia64 xencomm.c

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Thu Aug 16 13:03:41 2007 -0600 (2007-08-16)
parents 778985f246a0
children 049d4baa9965
files config/ia64.mk xen/arch/ia64/xen/Makefile xen/arch/ia64/xen/mm.c xen/arch/ia64/xen/xencomm.c xen/include/asm-ia64/guest_access.h xen/include/asm-ia64/mm.h xen/include/public/arch-ia64.h
line diff
     1.1 --- a/config/ia64.mk	Thu Aug 16 10:47:33 2007 -0600
     1.2 +++ b/config/ia64.mk	Thu Aug 16 13:03:41 2007 -0600
     1.3 @@ -3,5 +3,6 @@ CONFIG_IA64_$(XEN_OS) := y
     1.4  
     1.5  CONFIG_IOEMU := y
     1.6  CONFIG_XCUTILS := y
     1.7 +CONFIG_XENCOMM := y
     1.8  
     1.9  LIBDIR := lib
     2.1 --- a/xen/arch/ia64/xen/Makefile	Thu Aug 16 10:47:33 2007 -0600
     2.2 +++ b/xen/arch/ia64/xen/Makefile	Thu Aug 16 13:03:41 2007 -0600
     2.3 @@ -35,7 +35,6 @@ obj-y += xentime.o
     2.4  obj-y += flushd.o
     2.5  obj-y += privop_stat.o
     2.6  obj-y += xenpatch.o
     2.7 -obj-y += xencomm.o
     2.8  
     2.9  obj-$(crash_debug) += gdbstub.o
    2.10  obj-$(xen_ia64_tlb_track) += tlb_track.o
     3.1 --- a/xen/arch/ia64/xen/mm.c	Thu Aug 16 10:47:33 2007 -0600
     3.2 +++ b/xen/arch/ia64/xen/mm.c	Thu Aug 16 13:03:41 2007 -0600
     3.3 @@ -744,7 +744,7 @@ void *domain_mpa_to_imva(struct domain *
     3.4  #endif
     3.5  
     3.6  unsigned long
     3.7 -xencomm_paddr_to_maddr(unsigned long paddr)
     3.8 +paddr_to_maddr(unsigned long paddr)
     3.9  {
    3.10      struct vcpu *v = current;
    3.11      struct domain *d = v->domain;
    3.12 @@ -756,7 +756,7 @@ xencomm_paddr_to_maddr(unsigned long pad
    3.13                 __func__, paddr, vcpu_regs(v)->cr_iip);
    3.14          return 0;
    3.15      }
    3.16 -    return __va_ul((pa & _PFN_MASK) | (paddr & ~PAGE_MASK));
    3.17 +    return (pa & _PFN_MASK) | (paddr & ~PAGE_MASK);
    3.18  }
    3.19  
    3.20  /* Allocate a new page for domain and map it to the specified metaphysical
     4.1 --- a/xen/arch/ia64/xen/xencomm.c	Thu Aug 16 10:47:33 2007 -0600
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,387 +0,0 @@
     4.4 -/*
     4.5 - * This program is free software; you can redistribute it and/or modify
     4.6 - * it under the terms of the GNU General Public License as published by
     4.7 - * the Free Software Foundation; either version 2 of the License, or
     4.8 - * (at your option) any later version.
     4.9 - *
    4.10 - * This program is distributed in the hope that it will be useful,
    4.11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.13 - * GNU General Public License for more details.
    4.14 - *
    4.15 - * You should have received a copy of the GNU General Public License
    4.16 - * along with this program; if not, write to the Free Software
    4.17 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    4.18 - *
    4.19 - * Copyright (C) IBM Corp. 2006
    4.20 - *
    4.21 - * Authors: Hollis Blanchard <hollisb@us.ibm.com>
    4.22 - *          Tristan Gingold <tristan.gingold@bull.net>
    4.23 - */
    4.24 -
    4.25 -#include <xen/config.h>
    4.26 -#include <xen/mm.h>
    4.27 -#include <xen/sched.h>
    4.28 -#include <asm/current.h>
    4.29 -#include <asm/guest_access.h>
    4.30 -#include <public/xen.h>
    4.31 -#include <public/xencomm.h>
    4.32 -#include <xen/errno.h>
    4.33 -
    4.34 -#undef DEBUG
    4.35 -#ifdef DEBUG
    4.36 -static int xencomm_debug = 1; /* extremely verbose */
    4.37 -#else
    4.38 -#define xencomm_debug 0
    4.39 -#endif
    4.40 -
    4.41 -static int
    4.42 -xencomm_copy_chunk_from(
    4.43 -    unsigned long to,
    4.44 -    unsigned long paddr,
    4.45 -    unsigned int  len)
    4.46 -{
    4.47 -    unsigned long maddr;
    4.48 -    struct page_info *page;
    4.49 -
    4.50 -    while (1) {
    4.51 -	maddr = xencomm_paddr_to_maddr(paddr);
    4.52 -	if (xencomm_debug > 1)
    4.53 -	    printk("%lx[%d] -> %lx\n", maddr, len, to);
    4.54 -	if (maddr == 0)
    4.55 -	    return -EFAULT;
    4.56 -
    4.57 -	page = virt_to_page(maddr);
    4.58 -	if (get_page(page, current->domain) == 0) {
    4.59 -	    if (page_get_owner(page) != current->domain) {
    4.60 -		/* This page might be a page granted by another domain  */
    4.61 -		panic_domain(NULL, "copy_from_guest from foreign domain\n");
    4.62 -	    }
    4.63 -	    /* Try again.  */
    4.64 -	    continue;
    4.65 -	}
    4.66 -	memcpy((void *)to, (void *)maddr, len);
    4.67 -	put_page(page);
    4.68 -	return 0;
    4.69 -    }
    4.70 -}
    4.71 -
    4.72 -/**
    4.73 - * xencomm_copy_from_guest: Copy a block of data from domain space.
    4.74 - * @to:   Machine address.
    4.75 - * @from: Physical address to a xencomm buffer descriptor.
    4.76 - * @n:    Number of bytes to copy.
    4.77 - * @skip: Number of bytes from the start to skip.
    4.78 - *
    4.79 - * Copy data from domain to hypervisor.
    4.80 - *
    4.81 - * Returns number of bytes that could not be copied.
    4.82 - * On success, this will be zero.
    4.83 - */
    4.84 -unsigned long
    4.85 -xencomm_copy_from_guest(
    4.86 -    void         *to,
    4.87 -    const void   *from,
    4.88 -    unsigned int n,
    4.89 -    unsigned int skip)
    4.90 -{
    4.91 -    struct xencomm_desc *desc;
    4.92 -    unsigned long desc_addr;
    4.93 -    unsigned int from_pos = 0;
    4.94 -    unsigned int to_pos = 0;
    4.95 -    unsigned int i = 0;
    4.96 -
    4.97 -    if (xencomm_debug)
    4.98 -        printk("xencomm_copy_from_guest: from=%lx+%u n=%u\n",
    4.99 -               (unsigned long)from, skip, n);
   4.100 -
   4.101 -    if (XENCOMM_IS_INLINE(from)) {
   4.102 -        unsigned long src_paddr = XENCOMM_INLINE_ADDR(from);
   4.103 -            
   4.104 -        src_paddr += skip;
   4.105 -
   4.106 -        while (n > 0) {
   4.107 -            unsigned int chunksz;
   4.108 -            unsigned int bytes;
   4.109 -	    int res;
   4.110 -            
   4.111 -            chunksz = PAGE_SIZE - (src_paddr % PAGE_SIZE);
   4.112 -            
   4.113 -            bytes = min(chunksz, n);
   4.114 -
   4.115 -            res = xencomm_copy_chunk_from((unsigned long)to, src_paddr, bytes);
   4.116 -	    if (res != 0)
   4.117 -		return -EFAULT;
   4.118 -            src_paddr += bytes;
   4.119 -            to += bytes;
   4.120 -            n -= bytes;
   4.121 -        }
   4.122 -        
   4.123 -        /* Always successful.  */
   4.124 -        return 0;
   4.125 -    }
   4.126 -
   4.127 -    /* first we need to access the descriptor */
   4.128 -    desc_addr = xencomm_paddr_to_maddr((unsigned long)from);
   4.129 -    if (desc_addr == 0)
   4.130 -        return -EFAULT;
   4.131 -
   4.132 -    desc = (struct xencomm_desc *)desc_addr;
   4.133 -    if (desc->magic != XENCOMM_MAGIC) {
   4.134 -        printk("%s: error: %p magic was 0x%x\n",
   4.135 -               __func__, desc, desc->magic);
   4.136 -        return -EFAULT;
   4.137 -    }
   4.138 -
   4.139 -    /* iterate through the descriptor, copying up to a page at a time */
   4.140 -    while ((to_pos < n) && (i < desc->nr_addrs)) {
   4.141 -        unsigned long src_paddr = desc->address[i];
   4.142 -        unsigned int pgoffset;
   4.143 -        unsigned int chunksz;
   4.144 -        unsigned int chunk_skip;
   4.145 -
   4.146 -        if (src_paddr == XENCOMM_INVALID) {
   4.147 -            i++;
   4.148 -            continue;
   4.149 -        }
   4.150 -
   4.151 -        pgoffset = src_paddr % PAGE_SIZE;
   4.152 -        chunksz = PAGE_SIZE - pgoffset;
   4.153 -
   4.154 -        chunk_skip = min(chunksz, skip);
   4.155 -        from_pos += chunk_skip;
   4.156 -        chunksz -= chunk_skip;
   4.157 -        skip -= chunk_skip;
   4.158 -
   4.159 -        if (skip == 0 && chunksz > 0) {
   4.160 -            unsigned int bytes = min(chunksz, n - to_pos);
   4.161 -	    int res;
   4.162 -
   4.163 -            if (xencomm_debug > 1)
   4.164 -                printk ("src_paddr=%lx i=%d, skip=%d\n",
   4.165 -                        src_paddr, i, chunk_skip);
   4.166 -
   4.167 -            res = xencomm_copy_chunk_from((unsigned long)to + to_pos,
   4.168 -                                          src_paddr + chunk_skip, bytes);
   4.169 -            if (res != 0)
   4.170 -                return -EFAULT;
   4.171 -
   4.172 -            from_pos += bytes;
   4.173 -            to_pos += bytes;
   4.174 -        }
   4.175 -
   4.176 -        i++;
   4.177 -    }
   4.178 -
   4.179 -    return n - to_pos;
   4.180 -}
   4.181 -
   4.182 -static int
   4.183 -xencomm_copy_chunk_to(
   4.184 -    unsigned long paddr,
   4.185 -    unsigned long from,
   4.186 -    unsigned int  len)
   4.187 -{
   4.188 -    unsigned long maddr;
   4.189 -    struct page_info *page;
   4.190 -
   4.191 -    while (1) {
   4.192 -	maddr = xencomm_paddr_to_maddr(paddr);
   4.193 -	if (xencomm_debug > 1)
   4.194 -	    printk("%lx[%d] -> %lx\n", from, len, maddr);
   4.195 -	if (maddr == 0)
   4.196 -	    return -EFAULT;
   4.197 -
   4.198 -	page = virt_to_page(maddr);
   4.199 -	if (get_page(page, current->domain) == 0) {
   4.200 -	    if (page_get_owner(page) != current->domain) {
   4.201 -		/* This page might be a page granted by another domain  */
   4.202 -		panic_domain(NULL, "copy_to_guest to foreign domain\n");
   4.203 -	    }
   4.204 -	    /* Try again.  */
   4.205 -	    continue;
   4.206 -	}
   4.207 -	memcpy((void *)maddr, (void *)from, len);
   4.208 -	put_page(page);
   4.209 -	return 0;
   4.210 -    }
   4.211 -}
   4.212 -
   4.213 -/**
   4.214 - * xencomm_copy_to_guest: Copy a block of data to domain space.
   4.215 - * @to:     Physical address to xencomm buffer descriptor.
   4.216 - * @from:   Machine address.
   4.217 - * @n:      Number of bytes to copy.
   4.218 - * @skip: Number of bytes from the start to skip.
   4.219 - *
   4.220 - * Copy data from hypervisor to domain.
   4.221 - *
   4.222 - * Returns number of bytes that could not be copied.
   4.223 - * On success, this will be zero.
   4.224 - */
   4.225 -unsigned long
   4.226 -xencomm_copy_to_guest(
   4.227 -    void         *to,
   4.228 -    const void   *from,
   4.229 -    unsigned int n,
   4.230 -    unsigned int skip)
   4.231 -{
   4.232 -    struct xencomm_desc *desc;
   4.233 -    unsigned long desc_addr;
   4.234 -    unsigned int from_pos = 0;
   4.235 -    unsigned int to_pos = 0;
   4.236 -    unsigned int i = 0;
   4.237 -
   4.238 -    if (xencomm_debug)
   4.239 -        printk ("xencomm_copy_to_guest: to=%lx+%u n=%u\n",
   4.240 -                (unsigned long)to, skip, n);
   4.241 -
   4.242 -    if (XENCOMM_IS_INLINE(to)) {
   4.243 -        unsigned long dest_paddr = XENCOMM_INLINE_ADDR(to);
   4.244 -            
   4.245 -        dest_paddr += skip;
   4.246 -
   4.247 -        while (n > 0) {
   4.248 -            unsigned int chunksz;
   4.249 -            unsigned int bytes;
   4.250 -            int res;
   4.251 -
   4.252 -            chunksz = PAGE_SIZE - (dest_paddr % PAGE_SIZE);
   4.253 -            
   4.254 -            bytes = min(chunksz, n);
   4.255 -
   4.256 -            res = xencomm_copy_chunk_to(dest_paddr, (unsigned long)from, bytes);
   4.257 -            if (res != 0)
   4.258 -                return res;
   4.259 -
   4.260 -            dest_paddr += bytes;
   4.261 -            from += bytes;
   4.262 -            n -= bytes;
   4.263 -        }
   4.264 -
   4.265 -        /* Always successful.  */
   4.266 -        return 0;
   4.267 -    }
   4.268 -
   4.269 -    /* first we need to access the descriptor */
   4.270 -    desc_addr = xencomm_paddr_to_maddr((unsigned long)to);
   4.271 -    if (desc_addr == 0)
   4.272 -        return -EFAULT;
   4.273 -
   4.274 -    desc = (struct xencomm_desc *)desc_addr;
   4.275 -    if (desc->magic != XENCOMM_MAGIC) {
   4.276 -        printk("%s error: %p magic was 0x%x\n", __func__, desc, desc->magic);
   4.277 -        return -EFAULT;
   4.278 -    }
   4.279 -
   4.280 -    /* iterate through the descriptor, copying up to a page at a time */
   4.281 -    while ((from_pos < n) && (i < desc->nr_addrs)) {
   4.282 -        unsigned long dest_paddr = desc->address[i];
   4.283 -        unsigned int pgoffset;
   4.284 -        unsigned int chunksz;
   4.285 -        unsigned int chunk_skip;
   4.286 -
   4.287 -        if (dest_paddr == XENCOMM_INVALID) {
   4.288 -            i++;
   4.289 -            continue;
   4.290 -        }
   4.291 -
   4.292 -        pgoffset = dest_paddr % PAGE_SIZE;
   4.293 -        chunksz = PAGE_SIZE - pgoffset;
   4.294 -
   4.295 -        chunk_skip = min(chunksz, skip);
   4.296 -        to_pos += chunk_skip;
   4.297 -        chunksz -= chunk_skip;
   4.298 -        skip -= chunk_skip;
   4.299 -        dest_paddr += chunk_skip;
   4.300 -
   4.301 -        if (skip == 0 && chunksz > 0) {
   4.302 -            unsigned int bytes = min(chunksz, n - from_pos);
   4.303 -            int res;
   4.304 -
   4.305 -            res = xencomm_copy_chunk_to(dest_paddr,
   4.306 -                                        (unsigned long)from + from_pos, bytes);
   4.307 -            if (res != 0)
   4.308 -                return res;
   4.309 -
   4.310 -            from_pos += bytes;
   4.311 -            to_pos += bytes;
   4.312 -        }
   4.313 -
   4.314 -        i++;
   4.315 -    }
   4.316 -    return n - from_pos;
   4.317 -}
   4.318 -
   4.319 -/* Offset page addresses in 'handle' to skip 'bytes' bytes. Set completely
   4.320 - * exhausted pages to XENCOMM_INVALID. */
   4.321 -void *
   4.322 -xencomm_add_offset(
   4.323 -    void         *handle,
   4.324 -    unsigned int bytes)
   4.325 -{
   4.326 -    struct xencomm_desc *desc;
   4.327 -    unsigned long desc_addr;
   4.328 -    int i = 0;
   4.329 -
   4.330 -    if (XENCOMM_IS_INLINE(handle))
   4.331 -        return (void *)((unsigned long)handle + bytes);
   4.332 -
   4.333 -    /* first we need to access the descriptor */
   4.334 -    desc_addr = xencomm_paddr_to_maddr((unsigned long)handle);
   4.335 -    if (desc_addr == 0)
   4.336 -        return NULL;
   4.337 -
   4.338 -    desc = (struct xencomm_desc *)desc_addr;
   4.339 -    if (desc->magic != XENCOMM_MAGIC) {
   4.340 -        printk("%s error: %p magic was 0x%x\n", __func__, desc, desc->magic);
   4.341 -        return NULL;
   4.342 -    }
   4.343 -
   4.344 -    /* iterate through the descriptor incrementing addresses */
   4.345 -    while ((bytes > 0) && (i < desc->nr_addrs)) {
   4.346 -        unsigned long dest_paddr = desc->address[i];
   4.347 -        unsigned int pgoffset;
   4.348 -        unsigned int chunksz;
   4.349 -        unsigned int chunk_skip;
   4.350 -
   4.351 -        if (dest_paddr == XENCOMM_INVALID) {
   4.352 -            i++;
   4.353 -            continue;
   4.354 -        }
   4.355 -
   4.356 -        pgoffset = dest_paddr % PAGE_SIZE;
   4.357 -        chunksz = PAGE_SIZE - pgoffset;
   4.358 -
   4.359 -        chunk_skip = min(chunksz, bytes);
   4.360 -        if (chunk_skip == chunksz) {
   4.361 -            /* exhausted this page */
   4.362 -            desc->address[i] = XENCOMM_INVALID;
   4.363 -        } else {
   4.364 -            desc->address[i] += chunk_skip;
   4.365 -        }
   4.366 -        bytes -= chunk_skip;
   4.367 -	
   4.368 -	i++;
   4.369 -    }
   4.370 -    return handle;
   4.371 -}
   4.372 -
   4.373 -int
   4.374 -xencomm_handle_is_null(
   4.375 -   void *ptr)
   4.376 -{
   4.377 -    if (XENCOMM_IS_INLINE(ptr))
   4.378 -        return XENCOMM_INLINE_ADDR(ptr) == 0;
   4.379 -    else {
   4.380 -        struct xencomm_desc *desc;
   4.381 -        unsigned long desc_addr;
   4.382 -
   4.383 -        desc_addr = xencomm_paddr_to_maddr((unsigned long)ptr);
   4.384 -        if (desc_addr == 0)
   4.385 -            return 1;
   4.386 -
   4.387 -        desc = (struct xencomm_desc *)desc_addr;
   4.388 -        return (desc->nr_addrs == 0);
   4.389 -    }
   4.390 -}
     5.1 --- a/xen/include/asm-ia64/guest_access.h	Thu Aug 16 10:47:33 2007 -0600
     5.2 +++ b/xen/include/asm-ia64/guest_access.h	Thu Aug 16 13:03:41 2007 -0600
     5.3 @@ -22,89 +22,9 @@
     5.4  #ifndef __ASM_GUEST_ACCESS_H__
     5.5  #define __ASM_GUEST_ACCESS_H__
     5.6  
     5.7 -extern unsigned long xencomm_copy_to_guest(void *to, const void *from,
     5.8 -        unsigned int len, unsigned int skip); 
     5.9 -extern unsigned long xencomm_copy_from_guest(void *to, const void *from,
    5.10 -        unsigned int len, unsigned int skip); 
    5.11 -extern void *xencomm_add_offset(void *handle, unsigned int bytes);
    5.12 -extern int xencomm_handle_is_null(void *ptr);
    5.13 -
    5.14 -
    5.15 -/* Is the guest handle a NULL reference? */
    5.16 -#define guest_handle_is_null(hnd)                          \
    5.17 -    ((hnd).p == NULL || xencomm_handle_is_null((hnd).p))
    5.18 -
    5.19 -/* Offset the given guest handle into the array it refers to. */
    5.20 -#define guest_handle_add_offset(hnd, nr) ({                   \
    5.21 -    const typeof((hnd).p) _ptr = (hnd).p;                     \
    5.22 -    (hnd).p = xencomm_add_offset(_ptr, nr * sizeof(*_ptr));   \
    5.23 -})
    5.24 -
    5.25 -/* Cast a guest handle to the specified type of handle. */
    5.26 -#define guest_handle_cast(hnd, type) ({   \
    5.27 -    type *_x = (hnd).p;                   \
    5.28 -    XEN_GUEST_HANDLE(type) _y;            \
    5.29 -    set_xen_guest_handle(_y, _x);         \
    5.30 -    _y;                                   \
    5.31 -})
    5.32 -
    5.33 -
    5.34 -/* Since we run in real mode, we can safely access all addresses. That also
    5.35 - * means our __routines are identical to our "normal" routines. */
    5.36 -#define guest_handle_okay(hnd, nr) 1
    5.37 -
    5.38 -/*
    5.39 - * Copy an array of objects to guest context via a guest handle.
    5.40 - * Optionally specify an offset into the guest array.
    5.41 - */
    5.42 -#define copy_to_guest_offset(hnd, idx, ptr, nr) \
    5.43 -    __copy_to_guest_offset(hnd, idx, ptr, nr)
    5.44 -
    5.45 -/* Copy sub-field of a structure to guest context via a guest handle. */
    5.46 -#define copy_field_to_guest(hnd, ptr, field) \
    5.47 -    __copy_field_to_guest(hnd, ptr, field)
    5.48 -
    5.49 -/*
    5.50 - * Copy an array of objects from guest context via a guest handle.
    5.51 - * Optionally specify an offset into the guest array.
    5.52 - */
    5.53 -#define copy_from_guest_offset(ptr, hnd, idx, nr) \
    5.54 -    __copy_from_guest_offset(ptr, hnd, idx, nr)
    5.55 -
    5.56 -/* Copy sub-field of a structure from guest context via a guest handle. */
    5.57 -#define copy_field_from_guest(ptr, hnd, field) \
    5.58 -    __copy_field_from_guest(ptr, hnd, field)
    5.59 -
    5.60 -#define __copy_to_guest_offset(hnd, idx, ptr, nr) ({                    \
    5.61 -    const typeof(*(ptr)) *_s = (ptr);                                   \
    5.62 -    void *_d = (hnd).p;                                                 \
    5.63 -    ((void)((hnd).p == (ptr)));                                         \
    5.64 -    xencomm_copy_to_guest(_d, _s, sizeof(*_s)*(nr), sizeof(*_s)*(idx)); \
    5.65 -})
    5.66 -
    5.67 -#define __copy_field_to_guest(hnd, ptr, field) ({                   \
    5.68 -    unsigned int _off = offsetof(typeof(*(hnd).p), field);          \
    5.69 -    const typeof(&(ptr)->field) _s = &(ptr)->field;                 \
    5.70 -    void *_d = (hnd).p;                                             \
    5.71 -    ((void)(&(hnd).p->field == &(ptr)->field));                     \
    5.72 -    xencomm_copy_to_guest(_d, _s, sizeof(*_s), _off);               \
    5.73 -})
    5.74 -
    5.75 -#define __copy_from_guest_offset(ptr, hnd, idx, nr) ({                    \
    5.76 -    const typeof(*(ptr)) *_s = (hnd).p;                                   \
    5.77 -    typeof(*(ptr)) *_d = (ptr);                                           \
    5.78 -    xencomm_copy_from_guest(_d, _s, sizeof(*_d)*(nr), sizeof(*_d)*(idx)); \
    5.79 -})
    5.80 -
    5.81 -#define __copy_field_from_guest(ptr, hnd, field) ({                 \
    5.82 -    unsigned int _off = offsetof(typeof(*(hnd).p), field);          \
    5.83 -    const void *_s = (hnd).p;                                       \
    5.84 -    typeof(&(ptr)->field) _d = &(ptr)->field;                       \
    5.85 -    ((void)(&(hnd).p->field == &(ptr)->field));                     \
    5.86 -    xencomm_copy_from_guest(_d, _s, sizeof(*_d), _off);             \
    5.87 -})
    5.88 -
    5.89 -/* Internal use only: returns 0 in case of bad address.  */
    5.90 -extern unsigned long xencomm_paddr_to_maddr(unsigned long paddr);
    5.91 +#include <xen/types.h>	/* arch-ia64.h which is included by xen.h 
    5.92 +			   requires uint64_t */
    5.93 +#include <public/xen.h>	/* for XENCOMM_INLINE_FLAG */
    5.94 +#include <xen/xencomm.h>
    5.95  
    5.96  #endif /* __ASM_GUEST_ACCESS_H__ */
     6.1 --- a/xen/include/asm-ia64/mm.h	Thu Aug 16 10:47:33 2007 -0600
     6.2 +++ b/xen/include/asm-ia64/mm.h	Thu Aug 16 13:03:41 2007 -0600
     6.3 @@ -499,6 +499,9 @@ extern u64 translate_domain_pte(u64 ptev
     6.4      ((get_gpfn_from_mfn((madr) >> PAGE_SHIFT) << PAGE_SHIFT) | \
     6.5      ((madr) & ~PAGE_MASK))
     6.6  
     6.7 +/* Internal use only: returns 0 in case of bad address.  */
     6.8 +extern unsigned long paddr_to_maddr(unsigned long paddr);
     6.9 +
    6.10  /* Arch-specific portion of memory_op hypercall. */
    6.11  long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg);
    6.12  
     7.1 --- a/xen/include/public/arch-ia64.h	Thu Aug 16 10:47:33 2007 -0600
     7.2 +++ b/xen/include/public/arch-ia64.h	Thu Aug 16 13:03:41 2007 -0600
     7.3 @@ -553,11 +553,6 @@ struct xen_ia64_boot_param {
     7.4  #define XENCOMM_INLINE_MASK 0xf800000000000000UL
     7.5  #define XENCOMM_INLINE_FLAG 0x8000000000000000UL
     7.6  
     7.7 -#define XENCOMM_IS_INLINE(addr) \
     7.8 -  (((unsigned long)(addr) & XENCOMM_INLINE_MASK) == XENCOMM_INLINE_FLAG)
     7.9 -#define XENCOMM_INLINE_ADDR(addr) \
    7.10 -  ((unsigned long)(addr) & ~XENCOMM_INLINE_MASK)
    7.11 -
    7.12  #ifndef __ASSEMBLY__
    7.13  
    7.14  /*