aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_domain.c
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-10-06 17:02:38 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-10-06 17:02:38 +0100
commit07a233ac7c228b36a4c2a9abc09abbbeb04aab81 (patch)
treeb632f65b28354172cdd71aed4caad902deb06e22 /tools/xenstore/xenstored_domain.c
parentc804adf4b64a5755c885b681c32591d2e67aa636 (diff)
downloadxen-07a233ac7c228b36a4c2a9abc09abbbeb04aab81.tar.gz
xen-07a233ac7c228b36a4c2a9abc09abbbeb04aab81.tar.bz2
xen-07a233ac7c228b36a4c2a9abc09abbbeb04aab81.zip
User tools send evtchn notifications via /dev/xen/evtchn
rather than using hypercall directly. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/xenstore/xenstored_domain.c')
-rw-r--r--tools/xenstore/xenstored_domain.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 69ace083d9..a7cd4493ad 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -79,6 +79,17 @@ struct ringbuf_head
char buf[0];
} __attribute__((packed));
+#ifndef TESTING
+static void evtchn_notify(int port)
+{
+ struct ioctl_evtchn_notify notify;
+ notify.port = port;
+ (void)ioctl(event_fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+#else
+extern void evtchn_notify(int port);
+#endif
+
/* FIXME: Mark connection as broken (close it?) when this happens. */
static bool check_buffer(const struct ringbuf_head *h)
{
@@ -164,9 +175,7 @@ static int writechn(struct connection *conn, const void *data, unsigned int len)
memcpy(dest, data, len);
mb();
update_output_chunk(conn->domain->output, len);
- /* FIXME: Probably not neccessary. */
- mb();
- xc_evtchn_send(*xc_handle, conn->domain->port);
+ evtchn_notify(conn->domain->port);
return len;
}
@@ -199,7 +208,7 @@ static int readchn(struct connection *conn, void *data, unsigned int len)
/* If it was full, tell them we've taken some. */
if (was_full)
- xc_evtchn_send(*xc_handle, conn->domain->port);
+ evtchn_notify(conn->domain->port);
return len;
}
@@ -249,7 +258,7 @@ static void domain_cleanup(void)
}
/* We scan all domains rather than use the information given here. */
-void handle_event(int event_fd)
+void handle_event(void)
{
u16 port;