WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [pushed] [ppc] implement HYPERVISOR_grant_table_op()

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [pushed] [ppc] implement HYPERVISOR_grant_table_op()
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Wed, 24 May 2006 15:02:35 -0500
Delivery-date: Wed, 24 May 2006 13:02:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Hollis Blanchard <hollisb@xxxxxxxxxx>
# Node ID cf43edb4abe5691e0214d7ca354591cdede8c3a4
# Parent  f77f8c43a9091dc9db869f927eb348f5bde1f165
[ppc] implement HYPERVISOR_grant_table_op()
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>

diff -r f77f8c43a909 -r cf43edb4abe5 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.c        Wed May 24 13:17:46 2006 -0500
+++ b/arch/powerpc/platforms/xen/hcall.c        Wed May 24 15:00:05 2006 -0500
@@ -11,6 +11,7 @@
 #include <xen/interface/sched.h>
 #include <xen/interface/event_channel.h>
 #include <xen/interface/physdev.h>
+#include <xen/interface/grant_table.h>
 #include <xen/public/privcmd.h>
 #include <asm/hypercall.h>
 #include <asm/page.h>
@@ -122,6 +123,62 @@ int HYPERVISOR_physdev_op(int cmd, void 
        return rc;
 }
 EXPORT_SYMBOL(HYPERVISOR_physdev_op);
+
+int HYPERVISOR_grant_table_op(unsigned int cmd, void *op, unsigned int count)
+{
+       struct xencomm_desc *desc;
+       struct xencomm_desc *frame_list;
+       long rc;
+       int argsize;
+
+       switch (cmd) {
+       case GNTTABOP_map_grant_ref:
+               argsize = sizeof(struct gnttab_map_grant_ref);
+               break;
+       case GNTTABOP_unmap_grant_ref:
+               argsize = sizeof(struct gnttab_unmap_grant_ref);
+               break;
+       case GNTTABOP_setup_table: {
+               struct gnttab_setup_table setup;
+
+               memcpy(&setup, op, sizeof(setup));
+               argsize = sizeof(setup);
+
+               rc = xencomm_create(xen_guest_handle(setup.frame_list),
+                               setup.nr_frames * 
sizeof(*xen_guest_handle(setup.frame_list)),
+                               &frame_list, GFP_KERNEL);
+               if (rc)
+                       return rc;
+
+               set_xen_guest_handle(setup.frame_list, (void 
*)__pa(frame_list));
+               op = &setup;
+               }
+               break;
+       case GNTTABOP_dump_table:
+               argsize = sizeof(struct gnttab_dump_table);
+               break;
+       case GNTTABOP_transfer:
+               argsize = sizeof(struct gnttab_transfer);
+               break;
+       default:
+               printk("%s: unknown grant table op %d\n", __func__, cmd);
+               return -ENOSYS;
+       }
+
+       rc = xencomm_create(op, argsize, &desc, GFP_KERNEL);
+       if (rc)
+               return rc;
+
+       rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_grant_table_op), cmd,
+                       __pa(desc), count);
+
+       if (cmd == GNTTABOP_setup_table)
+               xencomm_free(frame_list);
+       xencomm_free(desc);
+
+       return rc;
+}
+EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
 
 static int xenppc_privcmd_dom0_op(privcmd_hypercall_t *hypercall)
 {
diff -r f77f8c43a909 -r cf43edb4abe5 include/asm-powerpc/xen/asm/hypercall.h
--- a/include/asm-powerpc/xen/asm/hypercall.h   Wed May 24 13:17:46 2006 -0500
+++ b/include/asm-powerpc/xen/asm/hypercall.h   Wed May 24 15:00:05 2006 -0500
@@ -41,6 +41,8 @@ extern int HYPERVISOR_event_channel_op(i
 extern int HYPERVISOR_event_channel_op(int cmd, void *op);
 extern int HYPERVISOR_xen_version(int cmd, void *arg);
 extern int HYPERVISOR_physdev_op(int cmd, void *op);
+extern int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop,
+               unsigned int count);
 
 static inline int HYPERVISOR_sched_op(int cmd, unsigned long arg)
 {



_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [pushed] [ppc] implement HYPERVISOR_grant_table_op(), Hollis Blanchard <=