[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 02/11] mini-os: Provide <mini-os/queue.h>



Ian Jackson, le Fri 20 Jun 2014 20:04:41 +0100, a écrit :
> Upstream (xen.git) minios has MINIOS_{,S}{LIST,TAILQ}_* (eg,
> MINIOS_LIST_INSERT).  rumpuser-xen has {,S}{LIST,TAILQ}_* (eg,
> LIST_INSERT) because it can #include <sys/queue.h>.
> 
> We want to try to make this code upstreamable (or at least no less
> upstreamable than it already is).
> 
> So provide <mini-os/queue.h> which provides MINIOS_* in terms of
> <sys/queue.h>.  That allows us to use MINIOS_* in the bulk of minios.

We had prefixed those with MINIOS_ to avoid clashing with applications'
own lists implementations. Doing the #define as you propose should be
fine indeed.

> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>

Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

> ---
>  include/mini-os/queue.h |   74 
> +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 74 insertions(+)
>  create mode 100644 include/mini-os/queue.h
> 
> diff --git a/include/mini-os/queue.h b/include/mini-os/queue.h
> new file mode 100644
> index 0000000..bdf52af
> --- /dev/null
> +++ b/include/mini-os/queue.h
> @@ -0,0 +1,74 @@
> +#ifndef MINIOS_QUEUE_H__
> +#define MINIOS_QUEUE_H__
> +
> +#include <sys/queue.h>
> +
> +#define MINIOS_SLIST_EMPTY           SLIST_EMPTY
> +#define MINIOS_SLIST_ENTRY           SLIST_ENTRY
> +#define MINIOS_SLIST_FIRST           SLIST_FIRST
> +#define MINIOS_SLIST_FOREACH         SLIST_FOREACH
> +#define MINIOS_SLIST_FOREACH_SAFE    SLIST_FOREACH_SAFE
> +#define MINIOS_SLIST_HEAD            SLIST_HEAD
> +#define MINIOS_SLIST_HEAD_INITIALIZER        SLIST_HEAD_INITIALIZER
> +#define MINIOS_SLIST_INIT            SLIST_INIT
> +#define MINIOS_SLIST_INSERT_AFTER    SLIST_INSERT_AFTER
> +#define MINIOS_SLIST_INSERT_HEAD     SLIST_INSERT_HEAD
> +#define MINIOS_SLIST_NEXT            SLIST_NEXT
> +#define MINIOS_SLIST_REMOVE_AFTER    SLIST_REMOVE_AFTER
> +#define MINIOS_SLIST_REMOVE_HEAD     SLIST_REMOVE_HEAD
> +#define MINIOS_SLIST_REMOVE          SLIST_REMOVE
> +#define MINIOS_SLIST_SWAP            SLIST_SWAP
> +#define MINIOS_STAILQ_CONCAT         STAILQ_CONCAT
> +#define MINIOS_STAILQ_EMPTY          STAILQ_EMPTY
> +#define MINIOS_STAILQ_ENTRY          STAILQ_ENTRY
> +#define MINIOS_STAILQ_FIRST          STAILQ_FIRST
> +#define MINIOS_STAILQ_FOREACH                STAILQ_FOREACH
> +#define MINIOS_STAILQ_FOREACH_SAFE   STAILQ_FOREACH_SAFE
> +#define MINIOS_STAILQ_HEAD           STAILQ_HEAD
> +#define MINIOS_STAILQ_HEAD_INITIALIZER       STAILQ_HEAD_INITIALIZER
> +#define MINIOS_STAILQ_INIT           STAILQ_INIT
> +#define MINIOS_STAILQ_INSERT_AFTER   STAILQ_INSERT_AFTER
> +#define MINIOS_STAILQ_INSERT_HEAD    STAILQ_INSERT_HEAD
> +#define MINIOS_STAILQ_INSERT_TAIL    STAILQ_INSERT_TAIL
> +#define MINIOS_STAILQ_LAST           STAILQ_LAST
> +#define MINIOS_STAILQ_NEXT           STAILQ_NEXT
> +#define MINIOS_STAILQ_REMOVE_AFTER   STAILQ_REMOVE_AFTER
> +#define MINIOS_STAILQ_REMOVE_HEAD    STAILQ_REMOVE_HEAD
> +#define MINIOS_STAILQ_REMOVE         STAILQ_REMOVE
> +#define MINIOS_STAILQ_SWAP           STAILQ_SWAP
> +#define MINIOS_LIST_EMPTY            LIST_EMPTY
> +#define MINIOS_LIST_ENTRY            LIST_ENTRY
> +#define MINIOS_LIST_FIRST            LIST_FIRST
> +#define MINIOS_LIST_FOREACH          LIST_FOREACH
> +#define MINIOS_LIST_FOREACH_SAFE     LIST_FOREACH_SAFE
> +#define MINIOS_LIST_HEAD             LIST_HEAD
> +#define MINIOS_LIST_HEAD_INITIALIZER LIST_HEAD_INITIALIZER
> +#define MINIOS_LIST_INIT             LIST_INIT
> +#define MINIOS_LIST_INSERT_AFTER     LIST_INSERT_AFTER
> +#define MINIOS_LIST_INSERT_BEFORE    LIST_INSERT_BEFORE
> +#define MINIOS_LIST_INSERT_HEAD              LIST_INSERT_HEAD
> +#define MINIOS_LIST_NEXT             LIST_NEXT
> +#define MINIOS_LIST_REMOVE           LIST_REMOVE
> +#define MINIOS_LIST_SWAP             LIST_SWAP
> +#define MINIOS_TAILQ_CONCAT          TAILQ_CONCAT
> +#define MINIOS_TAILQ_EMPTY           TAILQ_EMPTY
> +#define MINIOS_TAILQ_ENTRY           TAILQ_ENTRY
> +#define MINIOS_TAILQ_FIRST           TAILQ_FIRST
> +#define MINIOS_TAILQ_FOREACH         TAILQ_FOREACH
> +#define MINIOS_TAILQ_FOREACH_SAFE    TAILQ_FOREACH_SAFE
> +#define MINIOS_TAILQ_FOREACH_REVERSE TAILQ_FOREACH_REVERSE
> +#define MINIOS_TAILQ_FOREACH_REVERSE_SAFE TAILQ_FOREACH_REVERSE_SAFE
> +#define MINIOS_TAILQ_HEAD            TAILQ_HEAD
> +#define MINIOS_TAILQ_HEAD_INITIALIZER        TAILQ_HEAD_INITIALIZER
> +#define MINIOS_TAILQ_INIT            TAILQ_INIT
> +#define MINIOS_TAILQ_INSERT_AFTER    TAILQ_INSERT_AFTER
> +#define MINIOS_TAILQ_INSERT_BEFORE   TAILQ_INSERT_BEFORE
> +#define MINIOS_TAILQ_INSERT_HEAD     TAILQ_INSERT_HEAD
> +#define MINIOS_TAILQ_INSERT_TAIL     TAILQ_INSERT_TAIL
> +#define MINIOS_TAILQ_LAST            TAILQ_LAST
> +#define MINIOS_TAILQ_NEXT            TAILQ_NEXT
> +#define MINIOS_TAILQ_PREV            TAILQ_PREV
> +#define MINIOS_TAILQ_REMOVE          TAILQ_REMOVE
> +#define MINIOS_TAILQ_SWAP            TAILQ_SWAP
> +
> +#endif /* MINIOS_QUEUE_H__ */
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel
> 

-- 
Samuel
<N> je déteste import
<N> parce que lorsque tu fais du python et que tu oublies le #!/bin/env python 
et que tu mets le fichier exécutable
<N> import est exécuté
 -+- #ens-mim - pourquoi mon script python change le curseur de la souris ?! -+-

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.