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-ia64-devel

[Xen-ia64-devel] [PATCH] xencomm: tmem support.

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] xencomm: tmem support.
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Fri, 19 Jun 2009 19:02:13 +0900
Delivery-date: Fri, 19 Jun 2009 03:02:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
[IA64] xencomm: tmem support.

add tmem support to xencomm.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff --git a/arch/ia64/xen/xcom_hcall.c b/arch/ia64/xen/xcom_hcall.c
--- a/arch/ia64/xen/xcom_hcall.c
+++ b/arch/ia64/xen/xcom_hcall.c
@@ -40,6 +40,7 @@
 #include <xen/interface/xenoprof.h>
 #include <xen/interface/vcpu.h>
 #include <xen/interface/kexec.h>
+#include <xen/interface/tmem.h>
 #include <asm/hypervisor.h>
 #include <asm/page.h>
 #include <asm/uaccess.h>
@@ -739,3 +740,15 @@ xencomm_hypercall_kexec_op(int cmd, void
 
        return xencomm_arch_hypercall_kexec_op(cmd, desc);
 }
+
+int
+xencomm_hypercall_tmem_op(struct tmem_op *op)
+{
+       struct xencomm_handle *desc;
+
+       desc = xencomm_map_no_alloc(op, sizeof(*op));
+       if (desc == NULL)
+               return -EINVAL;
+
+       return xencomm_arch_hypercall_tmem_op(desc);
+}
diff --git a/arch/ia64/xen/xcom_privcmd.c b/arch/ia64/xen/xcom_privcmd.c
--- a/arch/ia64/xen/xcom_privcmd.c
+++ b/arch/ia64/xen/xcom_privcmd.c
@@ -32,6 +32,7 @@
 #include <xen/interface/xsm/acm_ops.h>
 #include <xen/interface/hvm/params.h>
 #include <xen/interface/arch-ia64/debug_op.h>
+#include <xen/interface/tmem.h>
 #include <xen/public/privcmd.h>
 #include <asm/hypercall.h>
 #include <asm/page.h>
@@ -897,6 +898,22 @@ xencomm_privcmd_ia64_physdev_op(privcmd_
        return ret;
 }
 
+static int
+xencomm_privcmd_tmem_op(privcmd_hypercall_t *hypercall)
+{
+       struct xencomm_handle *desc;
+       int ret;
+
+       desc = xencomm_map((void *)hypercall->arg[0], sizeof(struct tmem_op));
+       if (desc == NULL)
+               return -ENOMEM;
+
+       ret = xencomm_arch_hypercall_tmem_op(desc);
+
+       xencomm_free(desc);
+       return ret;
+}
+
 int
 privcmd_hypercall(privcmd_hypercall_t *hypercall)
 {
@@ -925,6 +942,8 @@ privcmd_hypercall(privcmd_hypercall_t *h
                return xencomm_privcmd_ia64_debug_op(hypercall);
        case __HYPERVISOR_physdev_op:
                return xencomm_privcmd_ia64_physdev_op(hypercall);
+       case __HYPERVISOR_tmem_op:
+               return xencomm_privcmd_tmem_op(hypercall);
        default:
                printk("%s: unknown hcall (%ld)\n", __func__, hypercall->op);
                return -ENOSYS;
diff --git a/include/asm-ia64/hypercall.h b/include/asm-ia64/hypercall.h
--- a/include/asm-ia64/hypercall.h
+++ b/include/asm-ia64/hypercall.h
@@ -435,6 +435,12 @@ xencomm_arch_hypercall_kexec_op(int cmd,
        return _hypercall2(int, kexec_op, cmd, arg);
 }
 
+static inline int
+xencomm_arch_hypercall_tmem_op(struct xencomm_handle *arg)
+{
+       return _hypercall1(int, tmem_op, arg);
+}
+
 // for balloon driver
 #define HYPERVISOR_update_va_mapping(va, new_val, flags) (0)
 
@@ -455,6 +461,7 @@ xencomm_arch_hypercall_kexec_op(int cmd,
 #define HYPERVISOR_vcpu_op xencomm_hypercall_vcpu_op
 #define HYPERVISOR_opt_feature xencomm_hypercall_opt_feature
 #define HYPERVISOR_kexec_op xencomm_hypercall_kexec_op
+#define HYPERVISOR_tmem_op xencomm_hypercall_tmem_op
 
 /* to compile gnttab_copy_grant_page() in drivers/xen/core/gnttab.c */
 #define HYPERVISOR_mmu_update(req, count, success_count, domid) ({BUG();0;})


-- 
yamahata

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH] xencomm: tmem support., Isaku Yamahata <=