ia64/linux-2.6.18-xen.hg

changeset 687:7d2d7b1deda4

[IA64] xencomm: support DOM0VP_get_memmap

add xencomm support for DOM0VP_get_memmap.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri Oct 03 13:08:44 2008 +0900 (2008-10-03)
parents 96655d262fa5
children 55ec2b18fe7f
files arch/ia64/xen/xcom_privcmd.c include/asm-ia64/hypercall.h
line diff
     1.1 --- a/arch/ia64/xen/xcom_privcmd.c	Fri Oct 03 13:07:57 2008 +0900
     1.2 +++ b/arch/ia64/xen/xcom_privcmd.c	Fri Oct 03 13:08:44 2008 +0900
     1.3 @@ -799,6 +799,23 @@ xencomm_privcmd_sched_op(privcmd_hyperca
     1.4  }
     1.5  
     1.6  static int
     1.7 +xencomm_privcmd_dom0vp_get_memmap(domid_t domid,
     1.8 +				  char* __user buf, unsigned long bufsize)
     1.9 +{
    1.10 +	int ret;
    1.11 +	struct xencomm_handle *desc;
    1.12 +
    1.13 +	desc = xencomm_map(buf, bufsize);
    1.14 +	if (bufsize > 0 && desc == NULL)
    1.15 +		return -ENOMEM;
    1.16 +
    1.17 +	ret = xencomm_arch_hypercall_get_memmap((domid_t)domid, desc);
    1.18 +
    1.19 +	xencomm_free(desc);
    1.20 +	return ret;
    1.21 +}
    1.22 +
    1.23 +static int
    1.24  xencomm_privcmd_ia64_dom0vp_op(privcmd_hypercall_t *hypercall)
    1.25  {
    1.26  	int cmd = hypercall->arg[0];
    1.27 @@ -827,6 +844,11 @@ xencomm_privcmd_ia64_dom0vp_op(privcmd_h
    1.28  		ret = xen_foreign_p2m_expose(hypercall);
    1.29  		break;
    1.30  #endif
    1.31 +	case IA64_DOM0VP_get_memmap:
    1.32 +		ret = xencomm_privcmd_dom0vp_get_memmap(
    1.33 +			(domid_t)hypercall->arg[1],
    1.34 +			(char* __user)hypercall->arg[2], hypercall->arg[3]);
    1.35 +		break;
    1.36  	default:
    1.37  		printk("%s: unknown IA64 DOM0VP op %d\n", __func__, cmd);
    1.38  		ret = -EINVAL;
     2.1 --- a/include/asm-ia64/hypercall.h	Fri Oct 03 13:07:57 2008 +0900
     2.2 +++ b/include/asm-ia64/hypercall.h	Fri Oct 03 13:08:44 2008 +0900
     2.3 @@ -391,6 +391,13 @@ HYPERVISOR_unexpose_foreign_p2m(unsigned
     2.4  	return _hypercall3(int, ia64_dom0vp_op,
     2.5  			   IA64_DOM0VP_unexpose_foreign_p2m, gpfn, domid);
     2.6  }
     2.7 +
     2.8 +static inline int
     2.9 +xencomm_arch_hypercall_get_memmap(domid_t domid, struct xencomm_handle *arg)
    2.10 +{
    2.11 +	return _hypercall3(int, ia64_dom0vp_op,
    2.12 +			   IA64_DOM0VP_get_memmap, domid, arg);
    2.13 +}
    2.14  #endif
    2.15  
    2.16  static inline int