Module Name: src
Committed By: cherry
Date: Thu Jan 24 04:16:16 UTC 2019
Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h
Log Message:
The event_channel_op hypercall uses a newer API since
__XEN_INTERFACE_VERSION__ 0x00030202
Since hvm_op only supports event_channel_op via the newer API, we
can't get away with our current event_channel_op_compat shim.
We thus introduce the new API to our internal hypercall C API
interface.
This change should have no effect on the PV kernels, since they will
continue to use the pre 0x00030202 API.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/xen/include/i386/hypercalls.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.9 src/sys/arch/xen/include/amd64/hypercalls.h:1.10
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.9 Thu Jan 24 04:11:38 2019
+++ src/sys/arch/xen/include/amd64/hypercalls.h Thu Jan 24 04:16:16 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.9 2019/01/24 04:11:38 cherry Exp $ */
+/* $NetBSD: hypercalls.h,v 1.10 2019/01/24 04:16:16 cherry Exp $ */
/******************************************************************************
* hypercall.h
*
@@ -242,9 +242,14 @@ HYPERVISOR_update_va_mapping(
}
static inline int
-HYPERVISOR_event_channel_op(void *op)
+HYPERVISOR_event_channel_op(evtchn_op_t *op)
{
+ KASSERT(op != NULL);
+#if __XEN_INTERFACE_VERSION__ < 0x00030202
return _hypercall1(int, event_channel_op, op);
+#else
+ return _hypercall2(int, event_channel_op, op->cmd, &op->u);
+#endif
}
static inline int
Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.16 src/sys/arch/xen/include/i386/hypercalls.h:1.17
--- src/sys/arch/xen/include/i386/hypercalls.h:1.16 Thu Jul 26 17:20:08 2018
+++ src/sys/arch/xen/include/i386/hypercalls.h Thu Jan 24 04:16:16 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.16 2018/07/26 17:20:08 maxv Exp $ */
+/* $NetBSD: hypercalls.h,v 1.17 2019/01/24 04:16:16 cherry Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -457,14 +457,20 @@ HYPERVISOR_multicall(void *call_list, in
static __inline int
-HYPERVISOR_event_channel_op(void *op)
+HYPERVISOR_event_channel_op(evtchn_op_t *op)
{
int ret;
unsigned long ign1;
+#if __XEN_INTERFACE_VERSION__ < 0x00030202
_hypercall(__HYPERVISOR_event_channel_op, _harg("1" (op)),
_harg("=a" (ret), "=b" (ign1)));
+#else
+ unsigned long ign2;
+ _hypercall(__HYPERVISOR_event_channel_op, _harg("1" (op->cmd), "2" (&op->u)),
+ _harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
+#endif
return ret;
}