Files
xen/tools/include/xen-external/bsd-sys-queue-h-seddery
T
Ian Campbell 1a4af67d32 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>
2012-01-31 16:06:14 +00:00

73 lines
2.3 KiB
Perl
Executable File

#!/usr/bin/perl -p
#
# This script is part of the Xen build system. It has a very
# permissive licence to avoid complicating the licence of the
# generated header file and to allow this seddery to be reused by
# other projects.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this individual file (the "Software"), to deal
# in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Copyright (C) 2011 Citrix Ltd
our $namespace, $ucnamespace;
BEGIN {
die unless @ARGV;
$namespace = pop @ARGV;
$namespace =~ s/^--prefix=// or die;
$ucnamespace = uc $namespace;
print <<END or die $!;
/*
* DO NOT EDIT THIS FILE
*
* Generated automatically by bsd-sys-queue-h-seddery to
* - introduce ${ucnamespace}_ and ${namespace}_ namespace prefixes
* - turn "struct type" into "type" so that type arguments
* to the macros are type names not struct tags
* - remove the reference to sys/cdefs.h, which is not needed
*
* The purpose of this seddery is to allow the resulting file to be
* freely included by software which might also want to include other
* list macros; to make it usable when struct tags are not being used
* or not known; to make it more portable.
*/
END
}
s/\b( _SYS_QUEUE |
SLIST | LIST | STAILQ | TAILQ | QUEUE
)/${ucnamespace}_$1/xg;
s/\b( TRACEBUF | TRASHIT |
QMD_
)/${ucnamespace}__$1/xg;
s/\b(
qm_
)/${namespace}__$1/xg;
s/\b struct \s+ type \b/type/xg;
s,^\#include.*sys/cdefs.*,/* $& */,xg;
s/\b( NULL )/0/xg;