Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/xen/include The event_channel_op hypercall uses a n...
details: https://anonhg.NetBSD.org/src/rev/a655fe8b99ec
branches: trunk
changeset: 447799:a655fe8b99ec
user: cherry <cherry%NetBSD.org@localhost>
date: Thu Jan 24 04:16:16 2019 +0000
description:
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.
diffstat:
sys/arch/xen/include/amd64/hypercalls.h | 9 +++++++--
sys/arch/xen/include/i386/hypercalls.h | 10 ++++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
diffs (56 lines):
diff -r 59fed75a67f6 -r a655fe8b99ec sys/arch/xen/include/amd64/hypercalls.h
--- a/sys/arch/xen/include/amd64/hypercalls.h Thu Jan 24 04:11:38 2019 +0000
+++ b/sys/arch/xen/include/amd64/hypercalls.h Thu Jan 24 04:16:16 2019 +0000
@@ -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 @@
}
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
diff -r 59fed75a67f6 -r a655fe8b99ec sys/arch/xen/include/i386/hypercalls.h
--- a/sys/arch/xen/include/i386/hypercalls.h Thu Jan 24 04:11:38 2019 +0000
+++ b/sys/arch/xen/include/i386/hypercalls.h Thu Jan 24 04:16:16 2019 +0000
@@ -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 @@
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;
}
Home |
Main Index |
Thread Index |
Old Index