|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Merge
# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1331654870 0
# Node ID 6ba199b5fd7f591dc6db3060e281986326d0d6da
# Parent e0d02f48a6123a137b8d9c91bbaa3d1963064b7f
# Parent b8a5e8100c5d5d4e162a99f4582186fa77080391
Merge
---
diff -r e0d02f48a612 -r 6ba199b5fd7f xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c Tue Mar 13 15:40:42 2012 +0000
+++ b/xen/arch/arm/traps.c Tue Mar 13 16:07:50 2012 +0000
@@ -367,7 +367,6 @@
}
typedef unsigned long arm_hypercall_t(
- unsigned int, unsigned int, unsigned int, unsigned int, unsigned int,
unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
#define HYPERCALL(x) \
@@ -407,18 +406,30 @@
static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss)
{
+ arm_hypercall_t *call = NULL;
local_irq_enable();
- regs->r0 = arm_hypercall_table[iss](regs->r0,
- regs->r1,
- regs->r2,
- regs->r3,
- regs->r4,
- regs->r5,
- regs->r6,
- regs->r7,
- regs->r8,
- regs->r9);
+ if ( iss != XEN_HYPERCALL_TAG )
+ {
+ printk("%s %d: received an alien hypercall iss=%lx\n", __func__ ,
+ __LINE__ , iss);
+ regs->r0 = -EINVAL;
+ return;
+ }
+
+ call = arm_hypercall_table[regs->r12];
+ if ( call == NULL )
+ {
+ regs->r0 = -ENOSYS;
+ return;
+ }
+
+ regs->r0 = call(regs->r0, regs->r1, regs->r2, regs->r3, regs->r4);
+
+#ifndef NDEBUG
+ /* clobber registers */
+ regs->r1 = regs->r2 = regs->r3 = regs->r4 = regs->r12 = 0xDEADBEEF;
+#endif
}
static void do_cp15_32(struct cpu_user_regs *regs,
diff -r e0d02f48a612 -r 6ba199b5fd7f xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h Tue Mar 13 15:40:42 2012 +0000
+++ b/xen/include/public/arch-arm.h Tue Mar 13 16:07:50 2012 +0000
@@ -27,6 +27,29 @@
#ifndef __XEN_PUBLIC_ARCH_ARM_H__
#define __XEN_PUBLIC_ARCH_ARM_H__
+/* hypercall calling convention
+ * ----------------------------
+ *
+ * A hypercall is issued using the ARM HVC instruction.
+ *
+ * A hypercall can take up to 5 arguments. These are passed in
+ * registers, the first argument in r0, the second argument in r1, the
+ * third in r2, the forth in r3 and the fifth in r4.
+ *
+ * The hypercall number is passed in r12.
+ *
+ * The HVC ISS must contain a Xen specific TAG: XEN_HYPERCALL_TAG.
+ *
+ * The return value is in r0.
+ *
+ * The hypercall will always clobber r0, r1, r2, r3, r4 and r12,
+ * regardless of how many arguments the particular hypercall takes.
+ *
+ */
+
+#define XEN_HYPERCALL_TAG 0XEA1
+
+
#ifndef __ASSEMBLY__
#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
typedef struct { type *p; } __guest_handle_ ## name
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |