# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1181649851 -32400 # Node ID 287794cccd22e7de3ea3f96beff87a4c114bbf30 # Parent 245902ee7ce0c1499c172b3a9240b8e2ede45a5f xencomm update for acm interface change by c/s 15189:96915ca8d5f2 of xen-unstable.h PATCHNAME: xencom_update_for_acm Signed-off-by: Isaku Yamahata diff -r 245902ee7ce0 -r 287794cccd22 arch/ia64/xen/xcom_privcmd.c --- a/arch/ia64/xen/xcom_privcmd.c Mon Jun 11 14:59:53 2007 -0600 +++ b/arch/ia64/xen/xcom_privcmd.c Tue Jun 12 21:04:11 2007 +0900 @@ -338,40 +338,39 @@ static int static int xencomm_privcmd_acm_op(privcmd_hypercall_t *hypercall) { - int cmd = hypercall->arg[0]; - void __user *arg = (void __user *)hypercall->arg[1]; + void __user *arg = (void __user *)hypercall->arg[0]; + xen_acmctl_t kern_arg; struct xencomm_handle *op_desc; struct xencomm_handle *desc = NULL; int ret; - switch (cmd) { - case ACMOP_getssid: - { - struct acm_getssid kern_arg; - - if (copy_from_user(&kern_arg, arg, sizeof (kern_arg))) + if (copy_from_user(&kern_arg, arg, sizeof(kern_arg))) + return -EFAULT; + if (kern_arg.interface_version != ACM_INTERFACE_VERSION) + return -ENOSYS; + + switch (kern_arg.cmd) { + case ACMOP_getssid: { + op_desc = xencomm_create_inline(&kern_arg); + + ret = xencomm_create( + xen_guest_handle(kern_arg.u.getssid.ssidbuf), + kern_arg.u.getssid.ssidbuf_size, &desc, GFP_KERNEL); + if (ret) + return ret; + + set_xen_guest_handle(kern_arg.u.getssid.ssidbuf, (void *)desc); + + ret = xencomm_arch_hypercall_acm_op(op_desc); + + xencomm_free(desc); + + if (copy_to_user(arg, &kern_arg, sizeof(kern_arg))) return -EFAULT; - - op_desc = xencomm_create_inline(&kern_arg); - - ret = xencomm_create(xen_guest_handle(kern_arg.ssidbuf), - kern_arg.ssidbuf_size, &desc, GFP_KERNEL); - if (ret) - return ret; - - set_xen_guest_handle(kern_arg.ssidbuf, (void *)desc); - - ret = xencomm_arch_hypercall_acm_op(cmd, op_desc); - - xencomm_free(desc); - - if (copy_to_user(arg, &kern_arg, sizeof (kern_arg))) - return -EFAULT; - - return ret; - } - default: - printk("%s: unknown acm_op cmd %d\n", __func__, cmd); + return ret; + } + default: + printk("%s: unknown acm_op cmd %d\n", __func__, kern_arg.cmd); return -ENOSYS; } diff -r 245902ee7ce0 -r 287794cccd22 include/asm-ia64/hypercall.h --- a/include/asm-ia64/hypercall.h Mon Jun 11 14:59:53 2007 -0600 +++ b/include/asm-ia64/hypercall.h Tue Jun 12 21:04:11 2007 +0900 @@ -157,9 +157,9 @@ xencomm_arch_hypercall_event_channel_op( } static inline int -xencomm_arch_hypercall_acm_op(unsigned int cmd, struct xencomm_handle *arg) -{ - return _hypercall2(int, acm_op, cmd, arg); +xencomm_arch_hypercall_acm_op(struct xencomm_handle *arg) +{ + return _hypercall1(int, acm_op, arg); } static inline int