summaryrefslogtreecommitdiffstats
path: root/sys/xen/xenbus
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2009-03-11 15:30:12 +0000
committerdfr <dfr@FreeBSD.org>2009-03-11 15:30:12 +0000
commit598fb4217fe304b2d9dae488867c35e7213e3ba5 (patch)
tree633dc40712503605071c68975d2c972638554000 /sys/xen/xenbus
parent2ee25eb1a489668e88e623440b968811e9f6d5b3 (diff)
parent0b3e97d804d73af27fba381fd51fe0dd48a9cb06 (diff)
downloadFreeBSD-src-598fb4217fe304b2d9dae488867c35e7213e3ba5.zip
FreeBSD-src-598fb4217fe304b2d9dae488867c35e7213e3ba5.tar.gz
Merge in support for Xen HVM on amd64 architecture.
Diffstat (limited to 'sys/xen/xenbus')
-rw-r--r--sys/xen/xenbus/xenbus_probe.c1
-rw-r--r--sys/xen/xenbus/xenbus_xs.c35
2 files changed, 18 insertions, 18 deletions
diff --git a/sys/xen/xenbus/xenbus_probe.c b/sys/xen/xenbus/xenbus_probe.c
index 3d2cb4b..f04f8ec 100644
--- a/sys/xen/xenbus/xenbus_probe.c
+++ b/sys/xen/xenbus/xenbus_probe.c
@@ -565,7 +565,6 @@ xenbus_write_ivar(device_t dev, device_t child, int index, uintptr_t value)
return (ENOENT);
}
-SYSCTL_DECL(_dev);
SYSCTL_NODE(_dev, OID_AUTO, xen, CTLFLAG_RD, NULL, "Xen");
SYSCTL_INT(_dev_xen, OID_AUTO, xsd_port, CTLFLAG_RD, &xen_store_evtchn, 0, "");
SYSCTL_ULONG(_dev_xen, OID_AUTO, xsd_kva, CTLFLAG_RD, (u_long *) &xen_store, 0, "");
diff --git a/sys/xen/xenbus/xenbus_xs.c b/sys/xen/xenbus/xenbus_xs.c
index 9e0f779..8069556 100644
--- a/sys/xen/xenbus/xenbus_xs.c
+++ b/sys/xen/xenbus/xenbus_xs.c
@@ -142,21 +142,17 @@ xs_read_reply(enum xsd_sockmsg_type *type, unsigned int *len, void **result)
mtx_lock(&xs_state.reply_lock);
while (TAILQ_EMPTY(&xs_state.reply_list)) {
- while (TAILQ_EMPTY(&xs_state.reply_list)) {
- error = mtx_sleep(&xs_state.reply_waitq,
- &xs_state.reply_lock,
- PCATCH, "xswait", hz/10);
- if (error && error != EWOULDBLOCK) {
- mtx_unlock(&xs_state.reply_lock);
- return (error);
- }
-
+ while (TAILQ_EMPTY(&xs_state.reply_list)) {
+ error = mtx_sleep(&xs_state.reply_waitq,
+ &xs_state.reply_lock,
+ PCATCH, "xswait", hz/10);
+ if (error && error != EWOULDBLOCK) {
+ mtx_unlock(&xs_state.reply_lock);
+ return (error);
}
-
-
}
+ }
-
msg = TAILQ_FIRST(&xs_state.reply_list);
TAILQ_REMOVE(&xs_state.reply_list, msg, list);
@@ -202,7 +198,8 @@ xenbus_dev_request_and_reply(struct xsd_sockmsg *msg, void **result)
sx_xlock(&xs_state.request_mutex);
- error = xb_write(msg, sizeof(*msg) + msg->len, &xs_state.request_mutex.lock_object);
+ error = xb_write(msg, sizeof(*msg) + msg->len,
+ &xs_state.request_mutex.lock_object);
if (error) {
msg->type = XS_ERROR;
} else {
@@ -243,7 +240,8 @@ xs_talkv(struct xenbus_transaction t, enum xsd_sockmsg_type type,
sx_xlock(&xs_state.request_mutex);
- error = xb_write(&msg, sizeof(msg), &xs_state.request_mutex.lock_object);
+ error = xb_write(&msg, sizeof(msg),
+ &xs_state.request_mutex.lock_object);
if (error) {
sx_xunlock(&xs_state.request_mutex);
printf("xs_talkv failed %d\n", error);
@@ -251,7 +249,8 @@ xs_talkv(struct xenbus_transaction t, enum xsd_sockmsg_type type,
}
for (i = 0; i < num_vecs; i++) {
- error = xb_write(iovec[i].iov_base, iovec[i].iov_len, &xs_state.request_mutex.lock_object);
+ error = xb_write(iovec[i].iov_base, iovec[i].iov_len,
+ &xs_state.request_mutex.lock_object);
if (error) {
sx_xunlock(&xs_state.request_mutex);
printf("xs_talkv failed %d\n", error);
@@ -791,7 +790,8 @@ xs_process_msg(enum xsd_sockmsg_type *type)
msg = malloc(sizeof(*msg), M_DEVBUF, M_WAITOK);
mtx_lock(&xs_state.reply_lock);
- error = xb_read(&msg->hdr, sizeof(msg->hdr), &xs_state.reply_lock.lock_object);
+ error = xb_read(&msg->hdr, sizeof(msg->hdr),
+ &xs_state.reply_lock.lock_object);
mtx_unlock(&xs_state.reply_lock);
if (error) {
free(msg, M_DEVBUF);
@@ -800,7 +800,8 @@ xs_process_msg(enum xsd_sockmsg_type *type)
body = malloc(msg->hdr.len + 1, M_DEVBUF, M_WAITOK);
mtx_lock(&xs_state.reply_lock);
- error = xb_read(body, msg->hdr.len, &xs_state.reply_lock.lock_object);
+ error = xb_read(body, msg->hdr.len,
+ &xs_state.reply_lock.lock_object);
mtx_unlock(&xs_state.reply_lock);
if (error) {
free(body, M_DEVBUF);
OpenPOWER on IntegriCloud