[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 3/9] privcmd interface addition to support share operations from Dom0 userspace
Subject: privcmd interface addition to support share operations from Dom0 userspace We create to simple privcmd ops to create and grant access to shares. diff -r 6d476981e3a5 -r 07a00d96357d linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Sun May 28 14:49:17 2006 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Wed May 31 05:33:38 2006 @@ -268,6 +268,7 @@ set_bit(__HYPERVISOR_xen_version, hypercall_permission_map); set_bit(__HYPERVISOR_sched_op, hypercall_permission_map); set_bit(__HYPERVISOR_sched_op_compat, hypercall_permission_map); + set_bit(__HYPERVISOR_share_op, hypercall_permission_map); set_bit(__HYPERVISOR_event_channel_op_compat, hypercall_permission_map); diff -r 6d476981e3a5 -r 07a00d96357d tools/libxc/xc_domain.c --- a/tools/libxc/xc_domain.c Sun May 28 14:49:17 2006 +++ b/tools/libxc/xc_domain.c Wed May 31 05:33:38 2006 @@ -482,6 +482,25 @@ return rc; } + +share_ref_t xc_create_shared_pages(int xc_handle, unsigned int num_pages) +{ + DECLARE_DOM0_OP; + + op.cmd = DOM0_CREATESHAREDPAGES; + op.u.createsharedpages.num = num_pages; + return do_dom0_op(xc_handle, &op); +} + +int xc_grant_shared_pages(int xc_handle, domid_t domid, share_ref_t share_ref) +{ + DECLARE_DOM0_OP; + + op.cmd = DOM0_GRANTSHAREDPAGES; + op.u.grantsharedpages.domain = domid; + op.u.grantsharedpages.share_ref = share_ref; + return do_dom0_op(xc_handle, &op); +} int xc_domain_irq_permission(int xc_handle, uint32_t domid, diff -r 6d476981e3a5 -r 07a00d96357d tools/libxc/xenctrl.h --- a/tools/libxc/xenctrl.h Sun May 28 14:49:17 2006 +++ b/tools/libxc/xenctrl.h Wed May 31 05:33:38 2006 @@ -21,6 +21,7 @@ #include <xen/memory.h> #include <xen/acm.h> #include <xen/acm_ops.h> +#include <xen/share.h> #ifdef __ia64__ #define XC_PAGE_SHIFT 14 @@ -584,6 +585,10 @@ int xc_version(int xc_handle, int cmd, void *arg); +/* Create & add permissions to sharable pages. */ +share_ref_t xc_create_shared_pages(int xc_handle, unsigned int num_pages); +int xc_grant_shared_pages(int xc_handle, domid_t domid, share_ref_t share_ref); + /* * MMU updates. */ -- ccontrol: http://ccontrol.ozlabs.org _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |