]> xenbits.xensource.com Git - people/royger/xen-test-framework.git/commitdiff
Hypercall infrastructure needed for writing to a PV console
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 19 Mar 2015 21:13:51 +0000 (22:13 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 28 Sep 2015 13:53:02 +0000 (14:53 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/hypercall_page.S
include/xen/event_channel.h [new file with mode: 0644]
include/xen/sched.h
include/xen/xen.h
include/xtf/hypercall.h

index 725cfb2f4ce53a55ccacbfe7dd81b9cf9b4247bb..5447bc126fe4254da1ecd692f866c16de7649526 100644 (file)
@@ -11,3 +11,4 @@ GLOBAL(hypercall_page)
 
 DECLARE_HYPERCALL(console_io)
 DECLARE_HYPERCALL(sched_op)
+DECLARE_HYPERCALL(event_channel_op)
diff --git a/include/xen/event_channel.h b/include/xen/event_channel.h
new file mode 100644 (file)
index 0000000..3754f9e
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef XEN_PUBLIC_EVENT_CHANNEL_H
+#define XEN_PUBLIC_EVENT_CHANNEL_H
+
+#define EVTCHNOP_send             4
+
+typedef uint32_t evtchn_port_t;
+
+#endif /* XEN_PUBLIC_EVENT_CHANNEL_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
index bf3868badb71e5b43f37b73e9915ed19e37a5ebb..0f134695885cfa58d64906f4d45a74761e17c525 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef XEN_PUBLIC_SCHED_H
 #define XEN_PUBLIC_SCHED_H
 
+#define SCHEDOP_yield    0
 #define SCHEDOP_shutdown 2
 
 #ifndef __ASSEMBLY__
index e311a6eaab6ec2950ba7be25e6a280825d05c825..d3e226f7e1edab05ed351d638e44186d762eb955 100644 (file)
@@ -13,6 +13,7 @@
 
 #define __HYPERVISOR_console_io           18
 #define __HYPERVISOR_sched_op             29
+#define __HYPERVISOR_event_channel_op     32
 
 /* Commands to HYPERVISOR_console_io */
 #define CONSOLEIO_write                   0
index 3dca881528e2abc53b5d7eaafdd7ed19a64766f8..0de3ebf1b5e06e8fc34b320760a8e908d0bdb152 100644 (file)
@@ -22,6 +22,7 @@
 /* All Xen ABI for includers convenience .*/
 #include <xen/xen.h>
 #include <xen/sched.h>
+#include <xen/event_channel.h>
 
 /*
  * Hypercall primatives, compiled for the correct bitness
@@ -31,6 +32,11 @@ static inline long hypercall_sched_op(unsigned int cmd, void *arg)
     return HYPERCALL2(long, sched_op, cmd, arg);
 }
 
+static inline long hypercall_event_channel_op(unsigned int cmd, void *arg)
+{
+    return HYPERCALL2(long, event_channel_op, cmd, arg);
+}
+
 /*
  * Higher level hypercall helpers
  */
@@ -44,6 +50,16 @@ static inline long hypercall_shutdown(unsigned int reason)
     return hypercall_sched_op(SCHEDOP_shutdown, &reason);
 }
 
+static inline void hypercall_yield(void)
+{
+    hypercall_sched_op(SCHEDOP_yield, NULL);
+}
+
+static inline int hypercall_evtchn_send(evtchn_port_t port)
+{
+    return hypercall_event_channel_op(EVTCHNOP_send, &port);
+}
+
 #endif /* XTF_HYPERCALL_H */
 
 /*