# HG changeset patch # User Tristan Gingold # Date 1190003486 -7200 # Node ID 6b5e2fad4af609d771e63f2f034288e0c3cfc54e # Parent c80b20789f97cc27ac18d3480c6bb50e448f6269 Add support for debug_op hypercall. Signed-off-by: Tristan Gingold diff -r c80b20789f97 -r 6b5e2fad4af6 arch/ia64/xen/xcom_privcmd.c --- a/arch/ia64/xen/xcom_privcmd.c Wed Sep 12 09:38:50 2007 -0600 +++ b/arch/ia64/xen/xcom_privcmd.c Mon Sep 17 06:31:26 2007 +0200 @@ -713,7 +713,7 @@ xencomm_privcmd_ia64_dom0vp_op(privcmd_h { int cmd = hypercall->arg[0]; int ret; - + switch (cmd) { case IA64_DOM0VP_fpswa_revision: { unsigned int revision; @@ -743,6 +743,34 @@ xencomm_privcmd_ia64_dom0vp_op(privcmd_h break; } return ret; +} + +static int +xencomm_privcmd_ia64_debug_op(privcmd_hypercall_t *hypercall) +{ + int cmd = hypercall->arg[0]; + unsigned long domain = hypercall->arg[1]; + struct xencomm_handle *desc; + int ret; + + switch (cmd) { + case XEN_IA64_DEBUG_OP_SET_FLAGS: + case XEN_IA64_DEBUG_OP_GET_FLAGS: + break; + default: + printk("%s: unknown IA64 DEBUGOP %d\n", __func__, cmd); + return -EINVAL; + } + + desc = xencomm_map((void *)hypercall->arg[2], + sizeof(xen_ia64_debug_op_t)); + if (desc == NULL) + return -ENOMEM; + + ret = xencomm_arch_hypercall_ia64_debug_op(cmd, domain, desc); + + xencomm_free(desc); + return ret; } int @@ -769,6 +797,8 @@ privcmd_hypercall(privcmd_hypercall_t *h return xencomm_privcmd_sched_op(hypercall); case __HYPERVISOR_ia64_dom0vp_op: return xencomm_privcmd_ia64_dom0vp_op(hypercall); + case __HYPERVISOR_ia64_debug_op: + return xencomm_privcmd_ia64_debug_op(hypercall); default: printk("%s: unknown hcall (%ld)\n", __func__, hypercall->op); return -ENOSYS; diff -r c80b20789f97 -r 6b5e2fad4af6 include/asm-ia64/hypercall.h --- a/include/asm-ia64/hypercall.h Wed Sep 12 09:38:50 2007 -0600 +++ b/include/asm-ia64/hypercall.h Mon Sep 17 06:31:26 2007 +0200 @@ -407,6 +407,14 @@ xencomm_arch_hypercall_fpswa_revision(st { return _hypercall2(int, ia64_dom0vp_op, IA64_DOM0VP_fpswa_revision, arg); +} + +static inline int +xencomm_arch_hypercall_ia64_debug_op(unsigned long cmd, + unsigned long domain, + struct xencomm_handle *arg) +{ + return _hypercall3(int, ia64_debug_op, cmd, domain, arg); } static inline int