diff options
author | Ian Campbell <Ian.Campbell@citrix.com> | 2012-01-31 16:06:14 +0000 |
---|---|---|
committer | Ian Campbell <Ian.Campbell@citrix.com> | 2012-01-31 16:06:14 +0000 |
commit | 1a4af67d32b1c39b73e09346203f3e12c00b9e41 (patch) | |
tree | ee7058fc62cdec6fe3f3582a63f99f90bd05bb24 /extras/mini-os/lib/sys.c | |
parent | f17888fc962b5249f9b6b34f28a61998c3092018 (diff) | |
download | xen-1a4af67d32b1c39b73e09346203f3e12c00b9e41.tar.gz xen-1a4af67d32b1c39b73e09346203f3e12c00b9e41.tar.bz2 xen-1a4af67d32b1c39b73e09346203f3e12c00b9e41.zip |
mini-os: use BSD sys/queue.h instead of Linux list.h
The latter is GPL which makes the whole of mini-os GPL rather than BSD
as intended. In tree users are all GPL or GPL-compatible but we should
fix this so that mini-os is BSD. Do so by using the same BSD
sys/queue.h as we use in libxl.
Tested with the builtin mini-os test app and qemu stubdomain, both of which
appear to still function as expected.
Move tools/libxl/external and the associated sed script to
tools/include/xen-external to allow more sensible access from mini-os.
Also add s/NULL/0/ in the sed script due to NULL not always being
defined in stubdom code when mini-os/wait.h is included.
As well as the obvious ABI changes there are a few API updates
associated with the change:
- struct rw_semaphore.wait_list is unused
- remove_waiter needs to take the wait_queue_head
The latter requires a qemu update, so there is also a QEMU_TAG
update in this changeset.
I sprinkled some extra-emacs local variables around the files I edited
which didn't have them.
I think this should be backported to the stable branches since
external users of mini-os may have been mislead into thinking they
could safely link mini-os against GPL-incompatible code.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'extras/mini-os/lib/sys.c')
-rw-r--r-- | extras/mini-os/lib/sys.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c index b7b3aff50a..2329a78c21 100644 --- a/extras/mini-os/lib/sys.c +++ b/extras/mini-os/lib/sys.c @@ -234,7 +234,7 @@ int read(int fd, void *buf, size_t nbytes) break; schedule(); } - remove_waiter(w); + remove_waiter(w, console_queue); return ret; } #ifdef HAVE_LWIP @@ -705,12 +705,12 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, fd_set myread, mywrite, myexcept; struct thread *thread = get_current(); s_time_t start = NOW(), stop; - DEFINE_WAIT(w1); - DEFINE_WAIT(w2); - DEFINE_WAIT(w3); - DEFINE_WAIT(w4); - DEFINE_WAIT(w5); - DEFINE_WAIT(w6); + DEFINE_WAIT(netfront_w); + DEFINE_WAIT(event_w); + DEFINE_WAIT(blkfront_w); + DEFINE_WAIT(xenbus_watch_w); + DEFINE_WAIT(kbdfront_w); + DEFINE_WAIT(console_w); assert(thread == main_thread); @@ -727,12 +727,12 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, /* Tell people we're going to sleep before looking at what they are * saying, hence letting them wake us if events happen between here and * schedule() */ - add_waiter(w1, netfront_queue); - add_waiter(w2, event_queue); - add_waiter(w3, blkfront_queue); - add_waiter(w4, xenbus_watch_queue); - add_waiter(w5, kbdfront_queue); - add_waiter(w6, console_queue); + add_waiter(netfront_w, netfront_queue); + add_waiter(event_w, event_queue); + add_waiter(blkfront_w, blkfront_queue); + add_waiter(xenbus_watch_w, xenbus_watch_queue); + add_waiter(kbdfront_w, kbdfront_queue); + add_waiter(console_w, console_queue); if (readfds) myread = *readfds; @@ -814,12 +814,12 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, ret = -1; out: - remove_waiter(w1); - remove_waiter(w2); - remove_waiter(w3); - remove_waiter(w4); - remove_waiter(w5); - remove_waiter(w6); + remove_waiter(netfront_w, netfront_queue); + remove_waiter(event_w, event_queue); + remove_waiter(blkfront_w, blkfront_queue); + remove_waiter(xenbus_watch_w, xenbus_watch_queue); + remove_waiter(kbdfront_w, kbdfront_queue); + remove_waiter(console_w, console_queue); return ret; } |