ia64/xen-unstable

changeset 18296:3ab0e76fb8e2

prefix mini-os lists with minios_, drop QEMU_ prefix from QEMU_LIST_*

That permits to reduce the amount of difference with upstream.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Aug 08 10:48:48 2008 +0100 (2008-08-08)
parents 9877446e919b
children f62a61cd95f5
files extras/mini-os/fs-front.c extras/mini-os/include/fs.h extras/mini-os/include/list.h extras/mini-os/include/sched.h extras/mini-os/include/semaphore.h extras/mini-os/include/wait.h extras/mini-os/include/waittypes.h extras/mini-os/lib/xmalloc.c extras/mini-os/sched.c tools/ioemu/audio/audio.c tools/ioemu/audio/audio.h tools/ioemu/audio/audio_int.h tools/ioemu/audio/audio_template.h tools/ioemu/audio/sys-queue.h tools/ioemu/block-vbd.c tools/ioemu/hw/pass-through.c tools/ioemu/hw/pass-through.h tools/ioemu/monitor.c tools/ioemu/vl.c
line diff
     1.1 --- a/extras/mini-os/fs-front.c	Fri Aug 08 10:46:39 2008 +0100
     1.2 +++ b/extras/mini-os/fs-front.c	Fri Aug 08 10:48:48 2008 +0100
     1.3 @@ -1170,7 +1170,7 @@ done:
     1.4      return 1;
     1.5  }
     1.6  
     1.7 -static void add_export(struct list_head *exports, unsigned int domid)
     1.8 +static void add_export(struct minios_list_head *exports, unsigned int domid)
     1.9  {
    1.10      char node[1024], **exports_list = NULL, *ret_msg;
    1.11      int j = 0;
    1.12 @@ -1192,8 +1192,8 @@ static void add_export(struct list_head 
    1.13              import->dom_id = domid;
    1.14              import->export_id = export_id;
    1.15              import->import_id = import_id++;
    1.16 -            INIT_LIST_HEAD(&import->list);
    1.17 -            list_add(&import->list, exports);
    1.18 +            MINIOS_INIT_LIST_HEAD(&import->list);
    1.19 +            minios_list_add(&import->list, exports);
    1.20          }
    1.21          free(exports_list[j]);
    1.22          j++;
    1.23 @@ -1205,14 +1205,14 @@ static void add_export(struct list_head 
    1.24  }
    1.25  
    1.26  #if 0
    1.27 -static struct list_head* probe_exports(void)
    1.28 +static struct minios_list_head* probe_exports(void)
    1.29  {
    1.30 -    struct list_head *exports;
    1.31 +    struct minios_list_head *exports;
    1.32      char **node_list = NULL, *msg = NULL;
    1.33      int i = 0;
    1.34  
    1.35 -    exports = xmalloc(struct list_head);
    1.36 -    INIT_LIST_HEAD(exports);
    1.37 +    exports = xmalloc(struct minios_list_head);
    1.38 +    MINIOS_INIT_LIST_HEAD(exports);
    1.39      
    1.40      msg = xenbus_ls(XBT_NIL, "/local/domain", &node_list);
    1.41      if(msg)
    1.42 @@ -1237,19 +1237,19 @@ exit:
    1.43  }
    1.44  #endif
    1.45  
    1.46 -LIST_HEAD(exports);
    1.47 +MINIOS_LIST_HEAD(exports);
    1.48  
    1.49  void init_fs_frontend(void)
    1.50  {
    1.51 -    struct list_head *entry;
    1.52 +    struct minios_list_head *entry;
    1.53      struct fs_import *import = NULL;
    1.54      printk("Initing FS fronend(s).\n");
    1.55  
    1.56      //exports = probe_exports();
    1.57      add_export(&exports, 0);
    1.58 -    list_for_each(entry, &exports)
    1.59 +    minios_list_for_each(entry, &exports)
    1.60      {
    1.61 -        import = list_entry(entry, struct fs_import, list);
    1.62 +        import = minios_list_entry(entry, struct fs_import, list);
    1.63          printk("FS export [dom=%d, id=%d] found\n", 
    1.64                  import->dom_id, import->export_id);
    1.65          init_fs_import(import);
     2.1 --- a/extras/mini-os/include/fs.h	Fri Aug 08 10:46:39 2008 +0100
     2.2 +++ b/extras/mini-os/include/fs.h	Fri Aug 08 10:48:48 2008 +0100
     2.3 @@ -13,7 +13,7 @@ struct fs_import
     2.4      domid_t dom_id;                 /* dom id of the exporting domain       */ 
     2.5      u16 export_id;                  /* export id (exporting dom specific)   */
     2.6      u16 import_id;                  /* import id (specific to this domain)  */ 
     2.7 -    struct list_head list;          /* list of all imports                  */
     2.8 +    struct minios_list_head list;   /* list of all imports                  */
     2.9      unsigned int nr_entries;        /* Number of entries in rings & request
    2.10                                         array                                */
    2.11      struct fsif_front_ring ring;    /* frontend ring (contains shared ring) */
     3.1 --- a/extras/mini-os/include/list.h	Fri Aug 08 10:46:39 2008 +0100
     3.2 +++ b/extras/mini-os/include/list.h	Fri Aug 08 10:48:48 2008 +0100
     3.3 @@ -11,23 +11,23 @@
     3.4   * using the generic single-entry routines.
     3.5   */
     3.6  
     3.7 -struct list_head {
     3.8 -	struct list_head *next, *prev;
     3.9 +struct minios_list_head {
    3.10 +	struct minios_list_head *next, *prev;
    3.11  };
    3.12  
    3.13 -#define LIST_HEAD_INIT(name) { &(name), &(name) }
    3.14 +#define MINIOS_LIST_HEAD_INIT(name) { &(name), &(name) }
    3.15  
    3.16 -#define LIST_HEAD(name) \
    3.17 -	struct list_head name = LIST_HEAD_INIT(name)
    3.18 +#define MINIOS_LIST_HEAD(name) \
    3.19 +	struct minios_list_head name = MINIOS_LIST_HEAD_INIT(name)
    3.20  
    3.21 -#define INIT_LIST_HEAD(ptr) do { \
    3.22 +#define MINIOS_INIT_LIST_HEAD(ptr) do { \
    3.23  	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
    3.24  } while (0)
    3.25  
    3.26 -#define list_top(head, type, member)					  \
    3.27 +#define minios_list_top(head, type, member)					  \
    3.28  ({ 									  \
    3.29 -	struct list_head *_head = (head);				  \
    3.30 -	list_empty(_head) ? NULL : list_entry(_head->next, type, member); \
    3.31 +	struct minios_list_head *_head = (head);				  \
    3.32 +	minios_list_empty(_head) ? NULL : minios_list_entry(_head->next, type, member); \
    3.33  })
    3.34  
    3.35  /*
    3.36 @@ -36,9 +36,9 @@ struct list_head {
    3.37   * This is only for internal list manipulation where we know
    3.38   * the prev/next entries already!
    3.39   */
    3.40 -static __inline__ void __list_add(struct list_head * new,
    3.41 -	struct list_head * prev,
    3.42 -	struct list_head * next)
    3.43 +static __inline__ void __minios_list_add(struct minios_list_head * new,
    3.44 +	struct minios_list_head * prev,
    3.45 +	struct minios_list_head * next)
    3.46  {
    3.47  	next->prev = new;
    3.48  	new->next = next;
    3.49 @@ -47,29 +47,29 @@ static __inline__ void __list_add(struct
    3.50  }
    3.51  
    3.52  /**
    3.53 - * list_add - add a new entry
    3.54 + * minios_list_add - add a new entry
    3.55   * @new: new entry to be added
    3.56   * @head: list head to add it after
    3.57   *
    3.58   * Insert a new entry after the specified head.
    3.59   * This is good for implementing stacks.
    3.60   */
    3.61 -static __inline__ void list_add(struct list_head *new, struct list_head *head)
    3.62 +static __inline__ void minios_list_add(struct minios_list_head *new, struct minios_list_head *head)
    3.63  {
    3.64 -	__list_add(new, head, head->next);
    3.65 +	__minios_list_add(new, head, head->next);
    3.66  }
    3.67  
    3.68  /**
    3.69 - * list_add_tail - add a new entry
    3.70 + * minios_list_add_tail - add a new entry
    3.71   * @new: new entry to be added
    3.72   * @head: list head to add it before
    3.73   *
    3.74   * Insert a new entry before the specified head.
    3.75   * This is useful for implementing queues.
    3.76   */
    3.77 -static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
    3.78 +static __inline__ void minios_list_add_tail(struct minios_list_head *new, struct minios_list_head *head)
    3.79  {
    3.80 -	__list_add(new, head->prev, head);
    3.81 +	__minios_list_add(new, head->prev, head);
    3.82  }
    3.83  
    3.84  /*
    3.85 @@ -79,54 +79,54 @@ static __inline__ void list_add_tail(str
    3.86   * This is only for internal list manipulation where we know
    3.87   * the prev/next entries already!
    3.88   */
    3.89 -static __inline__ void __list_del(struct list_head * prev,
    3.90 -				  struct list_head * next)
    3.91 +static __inline__ void __minios_list_del(struct minios_list_head * prev,
    3.92 +				  struct minios_list_head * next)
    3.93  {
    3.94  	next->prev = prev;
    3.95  	prev->next = next;
    3.96  }
    3.97  
    3.98  /**
    3.99 - * list_del - deletes entry from list.
   3.100 + * minios_list_del - deletes entry from list.
   3.101   * @entry: the element to delete from the list.
   3.102 - * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
   3.103 + * Note: minios_list_empty on entry does not return true after this, the entry is in an undefined state.
   3.104   */
   3.105 -static __inline__ void list_del(struct list_head *entry)
   3.106 +static __inline__ void minios_list_del(struct minios_list_head *entry)
   3.107  {
   3.108 -	__list_del(entry->prev, entry->next);
   3.109 +	__minios_list_del(entry->prev, entry->next);
   3.110  }
   3.111  
   3.112  /**
   3.113 - * list_del_init - deletes entry from list and reinitialize it.
   3.114 + * minios_list_del_init - deletes entry from list and reinitialize it.
   3.115   * @entry: the element to delete from the list.
   3.116   */
   3.117 -static __inline__ void list_del_init(struct list_head *entry)
   3.118 +static __inline__ void minios_list_del_init(struct minios_list_head *entry)
   3.119  {
   3.120 -	__list_del(entry->prev, entry->next);
   3.121 -	INIT_LIST_HEAD(entry); 
   3.122 +	__minios_list_del(entry->prev, entry->next);
   3.123 +	MINIOS_INIT_LIST_HEAD(entry); 
   3.124  }
   3.125  
   3.126  /**
   3.127 - * list_empty - tests whether a list is empty
   3.128 + * minios_list_empty - tests whether a list is empty
   3.129   * @head: the list to test.
   3.130   */
   3.131 -static __inline__ int list_empty(struct list_head *head)
   3.132 +static __inline__ int minios_list_empty(struct minios_list_head *head)
   3.133  {
   3.134  	return head->next == head;
   3.135  }
   3.136  
   3.137  /**
   3.138 - * list_splice - join two lists
   3.139 + * minios_list_splice - join two lists
   3.140   * @list: the new list to add.
   3.141   * @head: the place to add it in the first list.
   3.142   */
   3.143 -static __inline__ void list_splice(struct list_head *list, struct list_head *head)
   3.144 +static __inline__ void minios_list_splice(struct minios_list_head *list, struct minios_list_head *head)
   3.145  {
   3.146 -	struct list_head *first = list->next;
   3.147 +	struct minios_list_head *first = list->next;
   3.148  
   3.149  	if (first != list) {
   3.150 -		struct list_head *last = list->prev;
   3.151 -		struct list_head *at = head->next;
   3.152 +		struct minios_list_head *last = list->prev;
   3.153 +		struct minios_list_head *at = head->next;
   3.154  
   3.155  		first->prev = head;
   3.156  		head->next = first;
   3.157 @@ -137,54 +137,54 @@ static __inline__ void list_splice(struc
   3.158  }
   3.159  
   3.160  /**
   3.161 - * list_entry - get the struct for this entry
   3.162 - * @ptr:	the &struct list_head pointer.
   3.163 + * minios_list_entry - get the struct for this entry
   3.164 + * @ptr:	the &struct minios_list_head pointer.
   3.165   * @type:	the type of the struct this is embedded in.
   3.166 - * @member:	the name of the list_struct within the struct.
   3.167 + * @member:	the name of the minios_list_struct within the struct.
   3.168   */
   3.169 -#define list_entry(ptr, type, member) \
   3.170 +#define minios_list_entry(ptr, type, member) \
   3.171  	((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
   3.172  
   3.173  /**
   3.174 - * list_for_each	-	iterate over a list
   3.175 - * @pos:	the &struct list_head to use as a loop counter.
   3.176 + * minios_list_for_each	-	iterate over a list
   3.177 + * @pos:	the &struct minios_list_head to use as a loop counter.
   3.178   * @head:	the head for your list.
   3.179   */
   3.180 -#define list_for_each(pos, head) \
   3.181 +#define minios_list_for_each(pos, head) \
   3.182  	for (pos = (head)->next; pos != (head); pos = pos->next)
   3.183          	
   3.184  /**
   3.185 - * list_for_each_safe	-	iterate over a list safe against removal of list entry
   3.186 - * @pos:	the &struct list_head to use as a loop counter.
   3.187 - * @n:		another &struct list_head to use as temporary storage
   3.188 + * minios_list_for_each_safe	-	iterate over a list safe against removal of list entry
   3.189 + * @pos:	the &struct minios_list_head to use as a loop counter.
   3.190 + * @n:		another &struct minios_list_head to use as temporary storage
   3.191   * @head:	the head for your list.
   3.192   */
   3.193 -#define list_for_each_safe(pos, n, head) \
   3.194 +#define minios_list_for_each_safe(pos, n, head) \
   3.195  	for (pos = (head)->next, n = pos->next; pos != (head); \
   3.196  		pos = n, n = pos->next)
   3.197  
   3.198  /**
   3.199 - * list_for_each_entry	-	iterate over list of given type
   3.200 + * minios_list_for_each_entry	-	iterate over list of given type
   3.201   * @pos:	the type * to use as a loop counter.
   3.202   * @head:	the head for your list.
   3.203 - * @member:	the name of the list_struct within the struct.
   3.204 + * @member:	the name of the minios_list_struct within the struct.
   3.205   */
   3.206 -#define list_for_each_entry(pos, head, member)				\
   3.207 -	for (pos = list_entry((head)->next, typeof(*pos), member);	\
   3.208 +#define minios_list_for_each_entry(pos, head, member)				\
   3.209 +	for (pos = minios_list_entry((head)->next, typeof(*pos), member);	\
   3.210  	     &pos->member != (head); 					\
   3.211 -	     pos = list_entry(pos->member.next, typeof(*pos), member))
   3.212 +	     pos = minios_list_entry(pos->member.next, typeof(*pos), member))
   3.213  
   3.214  /**
   3.215 - * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
   3.216 + * minios_list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
   3.217   * @pos:	the type * to use as a loop counter.
   3.218   * @n:		another type * to use as temporary storage
   3.219   * @head:	the head for your list.
   3.220 - * @member:	the name of the list_struct within the struct.
   3.221 + * @member:	the name of the minios_list_struct within the struct.
   3.222   */
   3.223 -#define list_for_each_entry_safe(pos, n, head, member)			\
   3.224 -	for (pos = list_entry((head)->next, typeof(*pos), member),	\
   3.225 -		n = list_entry(pos->member.next, typeof(*pos), member);	\
   3.226 +#define minios_list_for_each_entry_safe(pos, n, head, member)			\
   3.227 +	for (pos = minios_list_entry((head)->next, typeof(*pos), member),	\
   3.228 +		n = minios_list_entry(pos->member.next, typeof(*pos), member);	\
   3.229  	     &pos->member != (head); 					\
   3.230 -	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
   3.231 +	     pos = n, n = minios_list_entry(n->member.next, typeof(*n), member))
   3.232  #endif /* _LINUX_LIST_H */
   3.233  
     4.1 --- a/extras/mini-os/include/sched.h	Fri Aug 08 10:46:39 2008 +0100
     4.2 +++ b/extras/mini-os/include/sched.h	Fri Aug 08 10:48:48 2008 +0100
     4.3 @@ -19,7 +19,7 @@ struct thread
     4.4  #else /* !defined(__ia64__) */
     4.5      thread_regs_t regs;
     4.6  #endif /* !defined(__ia64__) */
     4.7 -    struct list_head thread_list;
     4.8 +    struct minios_list_head thread_list;
     4.9      u32 flags;
    4.10      s_time_t wakeup_time;
    4.11  #ifdef HAVE_LIBC
     5.1 --- a/extras/mini-os/include/semaphore.h	Fri Aug 08 10:46:39 2008 +0100
     5.2 +++ b/extras/mini-os/include/semaphore.h	Fri Aug 08 10:48:48 2008 +0100
     5.3 @@ -21,7 +21,7 @@ struct semaphore
     5.4  struct rw_semaphore {
     5.5  	signed long		count;
     5.6  	spinlock_t		wait_lock;
     5.7 -	struct list_head	wait_list;
     5.8 +	struct minios_list_head	wait_list;
     5.9  	int			debug;
    5.10  };
    5.11  
     6.1 --- a/extras/mini-os/include/wait.h	Fri Aug 08 10:46:39 2008 +0100
     6.2 +++ b/extras/mini-os/include/wait.h	Fri Aug 08 10:48:48 2008 +0100
     6.3 @@ -8,42 +8,42 @@
     6.4  #define DEFINE_WAIT(name)                               \
     6.5  struct wait_queue name = {                              \
     6.6      .thread       = current,                            \
     6.7 -    .thread_list  = LIST_HEAD_INIT((name).thread_list), \
     6.8 +    .thread_list  = MINIOS_LIST_HEAD_INIT((name).thread_list), \
     6.9  }
    6.10  
    6.11  
    6.12  static inline void init_waitqueue_head(struct wait_queue_head *h)
    6.13  {
    6.14 -  INIT_LIST_HEAD(&h->thread_list);
    6.15 +  MINIOS_INIT_LIST_HEAD(&h->thread_list);
    6.16  }
    6.17  
    6.18  static inline void init_waitqueue_entry(struct wait_queue *q, struct thread *thread)
    6.19  {
    6.20      q->thread = thread;
    6.21 -    INIT_LIST_HEAD(&q->thread_list);
    6.22 +    MINIOS_INIT_LIST_HEAD(&q->thread_list);
    6.23  }
    6.24  
    6.25  
    6.26  static inline void add_wait_queue(struct wait_queue_head *h, struct wait_queue *q)
    6.27  {
    6.28 -    if (list_empty(&q->thread_list))
    6.29 -        list_add(&q->thread_list, &h->thread_list);   
    6.30 +    if (minios_list_empty(&q->thread_list))
    6.31 +        minios_list_add(&q->thread_list, &h->thread_list);   
    6.32  }
    6.33  
    6.34  static inline void remove_wait_queue(struct wait_queue *q)
    6.35  {
    6.36 -    list_del(&q->thread_list);
    6.37 +    minios_list_del(&q->thread_list);
    6.38  }
    6.39  
    6.40  static inline void wake_up(struct wait_queue_head *head)
    6.41  {
    6.42      unsigned long flags;
    6.43 -    struct list_head *tmp, *next;
    6.44 +    struct minios_list_head *tmp, *next;
    6.45      local_irq_save(flags);
    6.46 -    list_for_each_safe(tmp, next, &head->thread_list)
    6.47 +    minios_list_for_each_safe(tmp, next, &head->thread_list)
    6.48      {
    6.49           struct wait_queue *curr;
    6.50 -         curr = list_entry(tmp, struct wait_queue, thread_list);
    6.51 +         curr = minios_list_entry(tmp, struct wait_queue, thread_list);
    6.52           wake(curr->thread);
    6.53      }
    6.54      local_irq_restore(flags);
     7.1 --- a/extras/mini-os/include/waittypes.h	Fri Aug 08 10:46:39 2008 +0100
     7.2 +++ b/extras/mini-os/include/waittypes.h	Fri Aug 08 10:48:48 2008 +0100
     7.3 @@ -7,13 +7,13 @@ struct thread;
     7.4  struct wait_queue
     7.5  {
     7.6      struct thread *thread;
     7.7 -    struct list_head thread_list;
     7.8 +    struct minios_list_head thread_list;
     7.9  };
    7.10  
    7.11  struct wait_queue_head
    7.12  {
    7.13      /* TODO - lock required? */
    7.14 -    struct list_head thread_list;
    7.15 +    struct minios_list_head thread_list;
    7.16  };
    7.17  
    7.18  #define DECLARE_WAIT_QUEUE_HEAD(name) \
     8.1 --- a/extras/mini-os/lib/xmalloc.c	Fri Aug 08 10:46:39 2008 +0100
     8.2 +++ b/extras/mini-os/lib/xmalloc.c	Fri Aug 08 10:48:48 2008 +0100
     8.3 @@ -44,14 +44,14 @@
     8.4  #include <xmalloc.h>
     8.5  
     8.6  #ifndef HAVE_LIBC
     8.7 -static LIST_HEAD(freelist);
     8.8 +static MINIOS_LIST_HEAD(freelist);
     8.9  /* static spinlock_t freelist_lock = SPIN_LOCK_UNLOCKED; */
    8.10  
    8.11  struct xmalloc_hdr
    8.12  {
    8.13      /* Total including this hdr, unused padding and second hdr. */
    8.14      size_t size;
    8.15 -    struct list_head freelist;
    8.16 +    struct minios_list_head freelist;
    8.17  } __cacheline_aligned;
    8.18  
    8.19  /* Unused padding data between the two hdrs. */
    8.20 @@ -82,7 +82,7 @@ static void maybe_split(struct xmalloc_h
    8.21          extra = (struct xmalloc_hdr *)((unsigned long)hdr + size);
    8.22          extra->size = leftover;
    8.23          /* spin_lock_irqsave(&freelist_lock, flags); */
    8.24 -        list_add(&extra->freelist, &freelist);
    8.25 +        minios_list_add(&extra->freelist, &freelist);
    8.26          /* spin_unlock_irqrestore(&freelist_lock, flags); */
    8.27      }
    8.28      else
    8.29 @@ -155,14 +155,14 @@ void *_xmalloc(size_t size, size_t align
    8.30  
    8.31      /* Search free list. */
    8.32      /* spin_lock_irqsave(&freelist_lock, flags); */
    8.33 -    list_for_each_entry_safe( i, tmp, &freelist, freelist )
    8.34 +    minios_list_for_each_entry_safe( i, tmp, &freelist, freelist )
    8.35      {
    8.36          data_begin = align_up((uintptr_t)i + hdr_size, align);
    8.37  
    8.38          if ( data_begin + size > (uintptr_t)i + i->size )
    8.39              continue;
    8.40  
    8.41 -        list_del(&i->freelist);
    8.42 +        minios_list_del(&i->freelist);
    8.43          /* spin_unlock_irqrestore(&freelist_lock, flags); */
    8.44  
    8.45          uintptr_t size_before = (data_begin - hdr_size) - (uintptr_t)i;
    8.46 @@ -173,7 +173,7 @@ void *_xmalloc(size_t size, size_t align
    8.47              new_i->size = i->size - size_before;
    8.48              i->size = size_before;
    8.49              /* spin_lock_irqsave(&freelist_lock, flags); */
    8.50 -            list_add(&i->freelist, &freelist);
    8.51 +            minios_list_add(&i->freelist, &freelist);
    8.52              /* spin_unlock_irqrestore(&freelist_lock, flags); */
    8.53              i = new_i;
    8.54          }
    8.55 @@ -231,7 +231,7 @@ void xfree(const void *p)
    8.56  
    8.57      /* Merge with other free block, or put in list. */
    8.58      /* spin_lock_irqsave(&freelist_lock, flags); */
    8.59 -    list_for_each_entry_safe( i, tmp, &freelist, freelist )
    8.60 +    minios_list_for_each_entry_safe( i, tmp, &freelist, freelist )
    8.61      {
    8.62          unsigned long _i   = (unsigned long)i;
    8.63          unsigned long _hdr = (unsigned long)hdr;
    8.64 @@ -243,7 +243,7 @@ void xfree(const void *p)
    8.65          /* We follow this block?  Swallow it. */
    8.66          if ( (_i + i->size) == _hdr )
    8.67          {
    8.68 -            list_del(&i->freelist);
    8.69 +            minios_list_del(&i->freelist);
    8.70              i->size += hdr->size;
    8.71              hdr = i;
    8.72          }
    8.73 @@ -251,7 +251,7 @@ void xfree(const void *p)
    8.74          /* We precede this block? Swallow it. */
    8.75          if ( (_hdr + hdr->size) == _i )
    8.76          {
    8.77 -            list_del(&i->freelist);
    8.78 +            minios_list_del(&i->freelist);
    8.79              hdr->size += i->size;
    8.80          }
    8.81      }
    8.82 @@ -268,7 +268,7 @@ void xfree(const void *p)
    8.83      }
    8.84      else
    8.85      {
    8.86 -        list_add(&hdr->freelist, &freelist);
    8.87 +        minios_list_add(&hdr->freelist, &freelist);
    8.88      }
    8.89  
    8.90      /* spin_unlock_irqrestore(&freelist_lock, flags); */
     9.1 --- a/extras/mini-os/sched.c	Fri Aug 08 10:46:39 2008 +0100
     9.2 +++ b/extras/mini-os/sched.c	Fri Aug 08 10:48:48 2008 +0100
     9.3 @@ -55,18 +55,18 @@
     9.4  #endif
     9.5  
     9.6  struct thread *idle_thread = NULL;
     9.7 -LIST_HEAD(exited_threads);
     9.8 +MINIOS_LIST_HEAD(exited_threads);
     9.9  static int threads_started;
    9.10  
    9.11  struct thread *main_thread;
    9.12  
    9.13  void inline print_runqueue(void)
    9.14  {
    9.15 -    struct list_head *it;
    9.16 +    struct minios_list_head *it;
    9.17      struct thread *th;
    9.18 -    list_for_each(it, &idle_thread->thread_list)
    9.19 +    minios_list_for_each(it, &idle_thread->thread_list)
    9.20      {
    9.21 -        th = list_entry(it, struct thread, thread_list);
    9.22 +        th = minios_list_entry(it, struct thread, thread_list);
    9.23          printk("   Thread \"%s\", runnable=%d\n", th->name, is_runnable(th));
    9.24      }
    9.25      printk("\n");
    9.26 @@ -75,7 +75,7 @@ void inline print_runqueue(void)
    9.27  void schedule(void)
    9.28  {
    9.29      struct thread *prev, *next, *thread;
    9.30 -    struct list_head *iterator, *next_iterator;
    9.31 +    struct minios_list_head *iterator, *next_iterator;
    9.32      unsigned long flags;
    9.33  
    9.34      prev = current;
    9.35 @@ -97,9 +97,9 @@ void schedule(void)
    9.36          s_time_t now = NOW();
    9.37          s_time_t min_wakeup_time = now + SECONDS(10);
    9.38          next = NULL;   
    9.39 -        list_for_each_safe(iterator, next_iterator, &idle_thread->thread_list)
    9.40 +        minios_list_for_each_safe(iterator, next_iterator, &idle_thread->thread_list)
    9.41          {
    9.42 -            thread = list_entry(iterator, struct thread, thread_list);
    9.43 +            thread = minios_list_entry(iterator, struct thread, thread_list);
    9.44              if (!is_runnable(thread) && thread->wakeup_time != 0LL)
    9.45              {
    9.46                  if (thread->wakeup_time <= now)
    9.47 @@ -111,8 +111,8 @@ void schedule(void)
    9.48              {
    9.49                  next = thread;
    9.50                  /* Put this thread on the end of the list */
    9.51 -                list_del(&thread->thread_list);
    9.52 -                list_add_tail(&thread->thread_list, &idle_thread->thread_list);
    9.53 +                minios_list_del(&thread->thread_list);
    9.54 +                minios_list_add_tail(&thread->thread_list, &idle_thread->thread_list);
    9.55                  break;
    9.56              }
    9.57          }
    9.58 @@ -128,12 +128,12 @@ void schedule(void)
    9.59         inturrupted at the return instruction. And therefore at safe point. */
    9.60      if(prev != next) switch_threads(prev, next);
    9.61  
    9.62 -    list_for_each_safe(iterator, next_iterator, &exited_threads)
    9.63 +    minios_list_for_each_safe(iterator, next_iterator, &exited_threads)
    9.64      {
    9.65 -        thread = list_entry(iterator, struct thread, thread_list);
    9.66 +        thread = minios_list_entry(iterator, struct thread, thread_list);
    9.67          if(thread != prev)
    9.68          {
    9.69 -            list_del(&thread->thread_list);
    9.70 +            minios_list_del(&thread->thread_list);
    9.71              free_pages(thread->stack, STACK_SIZE_PAGE_ORDER);
    9.72              xfree(thread);
    9.73          }
    9.74 @@ -155,7 +155,7 @@ struct thread* create_thread(char *name,
    9.75      set_runnable(thread);
    9.76      local_irq_save(flags);
    9.77      if(idle_thread != NULL) {
    9.78 -        list_add_tail(&thread->thread_list, &idle_thread->thread_list); 
    9.79 +        minios_list_add_tail(&thread->thread_list, &idle_thread->thread_list); 
    9.80      } else if(function != idle_thread_fn)
    9.81      {
    9.82          printk("BUG: Not allowed to create thread before initialising scheduler.\n");
    9.83 @@ -208,10 +208,10 @@ void exit_thread(void)
    9.84      printk("Thread \"%s\" exited.\n", thread->name);
    9.85      local_irq_save(flags);
    9.86      /* Remove from the thread list */
    9.87 -    list_del(&thread->thread_list);
    9.88 +    minios_list_del(&thread->thread_list);
    9.89      clear_runnable(thread);
    9.90      /* Put onto exited list */
    9.91 -    list_add(&thread->thread_list, &exited_threads);
    9.92 +    minios_list_add(&thread->thread_list, &exited_threads);
    9.93      local_irq_restore(flags);
    9.94      /* Schedule will free the resources */
    9.95      while(1)
    9.96 @@ -296,6 +296,6 @@ void init_sched(void)
    9.97      _REENT_INIT_PTR((&callback_reent))
    9.98  #endif
    9.99      idle_thread = create_thread("Idle", idle_thread_fn, NULL);
   9.100 -    INIT_LIST_HEAD(&idle_thread->thread_list);
   9.101 +    MINIOS_INIT_LIST_HEAD(&idle_thread->thread_list);
   9.102  }
   9.103  
    10.1 --- a/tools/ioemu/audio/audio.c	Fri Aug 08 10:46:39 2008 +0100
    10.2 +++ b/tools/ioemu/audio/audio.c	Fri Aug 08 10:48:48 2008 +0100
    10.3 @@ -707,8 +707,8 @@ static void audio_detach_capture (HWVoic
    10.4              sw->rate = NULL;
    10.5          }
    10.6  
    10.7 -        QEMU_LIST_REMOVE (sw, entries);
    10.8 -        QEMU_LIST_REMOVE (sc, entries);
    10.9 +        LIST_REMOVE (sw, entries);
   10.10 +        LIST_REMOVE (sc, entries);
   10.11          qemu_free (sc);
   10.12          if (was_active) {
   10.13              /* We have removed soft voice from the capture:
   10.14 @@ -751,8 +751,8 @@ static int audio_attach_capture (AudioSt
   10.15              qemu_free (sw);
   10.16              return -1;
   10.17          }
   10.18 -        QEMU_LIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
   10.19 -        QEMU_LIST_INSERT_HEAD (&hw->cap_head, sc, entries);
   10.20 +        LIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
   10.21 +        LIST_INSERT_HEAD (&hw->cap_head, sc, entries);
   10.22  #ifdef DEBUG_CAPTURE
   10.23          asprintf (&sw->name, "for %p %d,%d,%d",
   10.24                    hw, sw->info.freq, sw->info.bits, sw->info.nchannels);
   10.25 @@ -1620,12 +1620,12 @@ void AUD_register_card (AudioState *s, c
   10.26      card->audio = s;
   10.27      card->name = qemu_strdup (name);
   10.28      memset (&card->entries, 0, sizeof (card->entries));
   10.29 -    QEMU_LIST_INSERT_HEAD (&s->card_head, card, entries);
   10.30 +    LIST_INSERT_HEAD (&s->card_head, card, entries);
   10.31  }
   10.32  
   10.33  void AUD_remove_card (QEMUSoundCard *card)
   10.34  {
   10.35 -    QEMU_LIST_REMOVE (card, entries);
   10.36 +    LIST_REMOVE (card, entries);
   10.37      card->audio = NULL;
   10.38      qemu_free (card->name);
   10.39  }
   10.40 @@ -1637,9 +1637,9 @@ AudioState *AUD_init (void)
   10.41      const char *drvname;
   10.42      AudioState *s = &glob_audio_state;
   10.43  
   10.44 -    QEMU_LIST_INIT (&s->hw_head_out);
   10.45 -    QEMU_LIST_INIT (&s->hw_head_in);
   10.46 -    QEMU_LIST_INIT (&s->cap_head);
   10.47 +    LIST_INIT (&s->hw_head_out);
   10.48 +    LIST_INIT (&s->hw_head_in);
   10.49 +    LIST_INIT (&s->cap_head);
   10.50      atexit (audio_atexit);
   10.51  
   10.52      s->ts = qemu_new_timer (vm_clock, audio_timer, s);
   10.53 @@ -1731,7 +1731,7 @@ AudioState *AUD_init (void)
   10.54          return NULL;
   10.55      }
   10.56  
   10.57 -    QEMU_LIST_INIT (&s->card_head);
   10.58 +    LIST_INIT (&s->card_head);
   10.59      register_savevm ("audio", 0, 1, audio_save, audio_load, s);
   10.60      qemu_mod_timer (s->ts, qemu_get_clock (vm_clock) + conf.period.ticks);
   10.61      return s;
   10.62 @@ -1769,7 +1769,7 @@ CaptureVoiceOut *AUD_add_capture (
   10.63  
   10.64      cap = audio_pcm_capture_find_specific (s, as);
   10.65      if (cap) {
   10.66 -        QEMU_LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
   10.67 +        LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
   10.68          return cap;
   10.69      }
   10.70      else {
   10.71 @@ -1784,8 +1784,8 @@ CaptureVoiceOut *AUD_add_capture (
   10.72          }
   10.73  
   10.74          hw = &cap->hw;
   10.75 -        QEMU_LIST_INIT (&hw->sw_head);
   10.76 -        QEMU_LIST_INIT (&cap->cb_head);
   10.77 +        LIST_INIT (&hw->sw_head);
   10.78 +        LIST_INIT (&cap->cb_head);
   10.79  
   10.80          /* XXX find a more elegant way */
   10.81          hw->samples = 4096 * 4;
   10.82 @@ -1813,8 +1813,8 @@ CaptureVoiceOut *AUD_add_capture (
   10.83              [hw->info.swap_endianness]
   10.84              [hw->info.bits == 16];
   10.85  
   10.86 -        QEMU_LIST_INSERT_HEAD (&s->cap_head, cap, entries);
   10.87 -        QEMU_LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
   10.88 +        LIST_INSERT_HEAD (&s->cap_head, cap, entries);
   10.89 +        LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
   10.90  
   10.91          hw = NULL;
   10.92          while ((hw = audio_pcm_hw_find_any_out (s, hw))) {
   10.93 @@ -1840,7 +1840,7 @@ void AUD_del_capture (CaptureVoiceOut *c
   10.94      for (cb = cap->cb_head.lh_first; cb; cb = cb->entries.le_next) {
   10.95          if (cb->opaque == cb_opaque) {
   10.96              cb->ops.destroy (cb_opaque);
   10.97 -            QEMU_LIST_REMOVE (cb, entries);
   10.98 +            LIST_REMOVE (cb, entries);
   10.99              qemu_free (cb);
  10.100  
  10.101              if (!cap->cb_head.lh_first) {
  10.102 @@ -1857,12 +1857,12 @@ void AUD_del_capture (CaptureVoiceOut *c
  10.103                          st_rate_stop (sw->rate);
  10.104                          sw->rate = NULL;
  10.105                      }
  10.106 -                    QEMU_LIST_REMOVE (sw, entries);
  10.107 -                    QEMU_LIST_REMOVE (sc, entries);
  10.108 +                    LIST_REMOVE (sw, entries);
  10.109 +                    LIST_REMOVE (sc, entries);
  10.110                      qemu_free (sc);
  10.111                      sw = sw1;
  10.112                  }
  10.113 -                QEMU_LIST_REMOVE (cap, entries);
  10.114 +                LIST_REMOVE (cap, entries);
  10.115                  qemu_free (cap);
  10.116              }
  10.117              return;
    11.1 --- a/tools/ioemu/audio/audio.h	Fri Aug 08 10:46:39 2008 +0100
    11.2 +++ b/tools/ioemu/audio/audio.h	Fri Aug 08 10:48:48 2008 +0100
    11.3 @@ -68,7 +68,7 @@ struct capture_ops {
    11.4  typedef struct CaptureState {
    11.5      void *opaque;
    11.6      struct capture_ops ops;
    11.7 -    QEMU_LIST_ENTRY (CaptureState) entries;
    11.8 +    LIST_ENTRY (CaptureState) entries;
    11.9  } CaptureState;
   11.10  
   11.11  typedef struct AudioState AudioState;
   11.12 @@ -79,7 +79,7 @@ typedef struct SWVoiceIn SWVoiceIn;
   11.13  typedef struct QEMUSoundCard {
   11.14      AudioState *audio;
   11.15      char *name;
   11.16 -    QEMU_LIST_ENTRY (QEMUSoundCard) entries;
   11.17 +    LIST_ENTRY (QEMUSoundCard) entries;
   11.18  } QEMUSoundCard;
   11.19  
   11.20  typedef struct QEMUAudioTimeStamp {
    12.1 --- a/tools/ioemu/audio/audio_int.h	Fri Aug 08 10:46:39 2008 +0100
    12.2 +++ b/tools/ioemu/audio/audio_int.h	Fri Aug 08 10:48:48 2008 +0100
    12.3 @@ -79,10 +79,10 @@ typedef struct HWVoiceOut {
    12.4      st_sample_t *mix_buf;
    12.5  
    12.6      int samples;
    12.7 -    QEMU_LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
    12.8 -    QEMU_LIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
    12.9 +    LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
   12.10 +    LIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
   12.11      struct audio_pcm_ops *pcm_ops;
   12.12 -    QEMU_LIST_ENTRY (HWVoiceOut) entries;
   12.13 +    LIST_ENTRY (HWVoiceOut) entries;
   12.14  } HWVoiceOut;
   12.15  
   12.16  typedef struct HWVoiceIn {
   12.17 @@ -98,9 +98,9 @@ typedef struct HWVoiceIn {
   12.18      st_sample_t *conv_buf;
   12.19  
   12.20      int samples;
   12.21 -    QEMU_LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
   12.22 +    LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
   12.23      struct audio_pcm_ops *pcm_ops;
   12.24 -    QEMU_LIST_ENTRY (HWVoiceIn) entries;
   12.25 +    LIST_ENTRY (HWVoiceIn) entries;
   12.26  } HWVoiceIn;
   12.27  
   12.28  struct SWVoiceOut {
   12.29 @@ -116,7 +116,7 @@ struct SWVoiceOut {
   12.30      char *name;
   12.31      volume_t vol;
   12.32      struct audio_callback callback;
   12.33 -    QEMU_LIST_ENTRY (SWVoiceOut) entries;
   12.34 +    LIST_ENTRY (SWVoiceOut) entries;
   12.35  };
   12.36  
   12.37  struct SWVoiceIn {
   12.38 @@ -131,7 +131,7 @@ struct SWVoiceIn {
   12.39      char *name;
   12.40      volume_t vol;
   12.41      struct audio_callback callback;
   12.42 -    QEMU_LIST_ENTRY (SWVoiceIn) entries;
   12.43 +    LIST_ENTRY (SWVoiceIn) entries;
   12.44  };
   12.45  
   12.46  struct audio_driver {
   12.47 @@ -165,20 +165,20 @@ struct audio_pcm_ops {
   12.48  struct capture_callback {
   12.49      struct audio_capture_ops ops;
   12.50      void *opaque;
   12.51 -    QEMU_LIST_ENTRY (capture_callback) entries;
   12.52 +    LIST_ENTRY (capture_callback) entries;
   12.53  };
   12.54  
   12.55  struct CaptureVoiceOut {
   12.56      HWVoiceOut hw;
   12.57      void *buf;
   12.58 -    QEMU_LIST_HEAD (cb_listhead, capture_callback) cb_head;
   12.59 -    QEMU_LIST_ENTRY (CaptureVoiceOut) entries;
   12.60 +    LIST_HEAD (cb_listhead, capture_callback) cb_head;
   12.61 +    LIST_ENTRY (CaptureVoiceOut) entries;
   12.62  };
   12.63  
   12.64  struct SWVoiceCap {
   12.65      SWVoiceOut sw;
   12.66      CaptureVoiceOut *cap;
   12.67 -    QEMU_LIST_ENTRY (SWVoiceCap) entries;
   12.68 +    LIST_ENTRY (SWVoiceCap) entries;
   12.69  };
   12.70  
   12.71  struct AudioState {
   12.72 @@ -186,10 +186,10 @@ struct AudioState {
   12.73      void *drv_opaque;
   12.74  
   12.75      QEMUTimer *ts;
   12.76 -    QEMU_LIST_HEAD (card_listhead, QEMUSoundCard) card_head;
   12.77 -    QEMU_LIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
   12.78 -    QEMU_LIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
   12.79 -    QEMU_LIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
   12.80 +    LIST_HEAD (card_listhead, QEMUSoundCard) card_head;
   12.81 +    LIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
   12.82 +    LIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
   12.83 +    LIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
   12.84      int nb_hw_voices_out;
   12.85      int nb_hw_voices_in;
   12.86  };
    13.1 --- a/tools/ioemu/audio/audio_template.h	Fri Aug 08 10:46:39 2008 +0100
    13.2 +++ b/tools/ioemu/audio/audio_template.h	Fri Aug 08 10:48:48 2008 +0100
    13.3 @@ -186,12 +186,12 @@ static void glue (audio_pcm_sw_fini_, TY
    13.4  
    13.5  static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw)
    13.6  {
    13.7 -    QEMU_LIST_INSERT_HEAD (&hw->sw_head, sw, entries);
    13.8 +    LIST_INSERT_HEAD (&hw->sw_head, sw, entries);
    13.9  }
   13.10  
   13.11  static void glue (audio_pcm_hw_del_sw_, TYPE) (SW *sw)
   13.12  {
   13.13 -    QEMU_LIST_REMOVE (sw, entries);
   13.14 +    LIST_REMOVE (sw, entries);
   13.15  }
   13.16  
   13.17  static void glue (audio_pcm_hw_gc_, TYPE) (AudioState *s, HW **hwp)
   13.18 @@ -202,7 +202,7 @@ static void glue (audio_pcm_hw_gc_, TYPE
   13.19  #ifdef DAC
   13.20          audio_detach_capture (hw);
   13.21  #endif
   13.22 -        QEMU_LIST_REMOVE (hw, entries);
   13.23 +        LIST_REMOVE (hw, entries);
   13.24          glue (s->nb_hw_voices_, TYPE) += 1;
   13.25          glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
   13.26          glue (hw->pcm_ops->fini_, TYPE) (hw);
   13.27 @@ -267,9 +267,9 @@ static HW *glue (audio_pcm_hw_add_new_, 
   13.28      }
   13.29  
   13.30      hw->pcm_ops = drv->pcm_ops;
   13.31 -    QEMU_LIST_INIT (&hw->sw_head);
   13.32 +    LIST_INIT (&hw->sw_head);
   13.33  #ifdef DAC
   13.34 -    QEMU_LIST_INIT (&hw->cap_head);
   13.35 +    LIST_INIT (&hw->cap_head);
   13.36  #endif
   13.37      if (glue (hw->pcm_ops->init_, TYPE) (hw, as)) {
   13.38          goto err0;
   13.39 @@ -294,7 +294,7 @@ static HW *glue (audio_pcm_hw_add_new_, 
   13.40          goto err1;
   13.41      }
   13.42  
   13.43 -    QEMU_LIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
   13.44 +    LIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
   13.45      glue (s->nb_hw_voices_, TYPE) -= 1;
   13.46  #ifdef DAC
   13.47      audio_attach_capture (s, hw);
    14.1 --- a/tools/ioemu/audio/sys-queue.h	Fri Aug 08 10:46:39 2008 +0100
    14.2 +++ b/tools/ioemu/audio/sys-queue.h	Fri Aug 08 10:48:48 2008 +0100
    14.3 @@ -64,12 +64,12 @@
    14.4  /*
    14.5   * List definitions.
    14.6   */
    14.7 -#define QEMU_LIST_HEAD(name, type)					\
    14.8 +#define LIST_HEAD(name, type)					\
    14.9  struct name {								\
   14.10  	struct type *lh_first;	/* first element */			\
   14.11  }
   14.12  
   14.13 -#define QEMU_LIST_ENTRY(type)						\
   14.14 +#define LIST_ENTRY(type)						\
   14.15  struct {								\
   14.16  	struct type *le_next;	/* next element */			\
   14.17  	struct type **le_prev;	/* address of previous next element */	\
   14.18 @@ -78,11 +78,11 @@ struct {								\
   14.19  /*
   14.20   * List functions.
   14.21   */
   14.22 -#define	QEMU_LIST_INIT(head) {						\
   14.23 +#define	LIST_INIT(head) {						\
   14.24  	(head)->lh_first = NULL;					\
   14.25  }
   14.26  
   14.27 -#define QEMU_LIST_INSERT_AFTER(listelm, elm, field) {			\
   14.28 +#define LIST_INSERT_AFTER(listelm, elm, field) {			\
   14.29  	if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)	\
   14.30  		(listelm)->field.le_next->field.le_prev =		\
   14.31  		    &(elm)->field.le_next;				\
   14.32 @@ -90,14 +90,14 @@ struct {								\
   14.33  	(elm)->field.le_prev = &(listelm)->field.le_next;		\
   14.34  }
   14.35  
   14.36 -#define QEMU_LIST_INSERT_HEAD(head, elm, field) {			\
   14.37 +#define LIST_INSERT_HEAD(head, elm, field) {			\
   14.38  	if (((elm)->field.le_next = (head)->lh_first) != NULL)		\
   14.39  		(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
   14.40  	(head)->lh_first = (elm);					\
   14.41  	(elm)->field.le_prev = &(head)->lh_first;			\
   14.42  }
   14.43  
   14.44 -#define QEMU_LIST_REMOVE(elm, field) {					\
   14.45 +#define LIST_REMOVE(elm, field) {					\
   14.46  	if ((elm)->field.le_next != NULL)				\
   14.47  		(elm)->field.le_next->field.le_prev = 			\
   14.48  		    (elm)->field.le_prev;				\
    15.1 --- a/tools/ioemu/block-vbd.c	Fri Aug 08 10:46:39 2008 +0100
    15.2 +++ b/tools/ioemu/block-vbd.c	Fri Aug 08 10:48:48 2008 +0100
    15.3 @@ -50,10 +50,10 @@ typedef struct BDRVVbdState {
    15.4      struct blkfront_dev *dev;
    15.5      int fd;
    15.6      struct blkfront_info info;
    15.7 -    QEMU_LIST_ENTRY(BDRVVbdState) list;
    15.8 +    LIST_ENTRY(BDRVVbdState) list;
    15.9  } BDRVVbdState;
   15.10  
   15.11 -QEMU_LIST_HEAD(, BDRVVbdState) vbds;
   15.12 +LIST_HEAD(, BDRVVbdState) vbds;
   15.13  
   15.14  static int vbd_probe(const uint8_t *buf, int buf_size, const char *filename)
   15.15  {
   15.16 @@ -90,7 +90,7 @@ static int vbd_open(BlockDriverState *bs
   15.17      s->fd = blkfront_open(s->dev);
   15.18      qemu_set_fd_handler(s->fd, vbd_io_completed, NULL, s);
   15.19  
   15.20 -    QEMU_LIST_INSERT_HEAD(&vbds, s, list);
   15.21 +    LIST_INSERT_HEAD(&vbds, s, list);
   15.22  
   15.23      return 0;
   15.24  }
   15.25 @@ -302,7 +302,7 @@ static void vbd_close(BlockDriverState *
   15.26          close(s->fd);
   15.27          s->fd = -1;
   15.28      }
   15.29 -    QEMU_LIST_REMOVE(s, list);
   15.30 +    LIST_REMOVE(s, list);
   15.31  }
   15.32  
   15.33  static int64_t  vbd_getlength(BlockDriverState *bs)
    16.1 --- a/tools/ioemu/hw/pass-through.c	Fri Aug 08 10:46:39 2008 +0100
    16.2 +++ b/tools/ioemu/hw/pass-through.c	Fri Aug 08 10:48:48 2008 +0100
    16.3 @@ -1644,7 +1644,7 @@ static int pt_config_reg_init(struct pt_
    16.4          reg_entry->data = data;
    16.5      }
    16.6      /* list add register entry */
    16.7 -    QEMU_LIST_INSERT_HEAD(&reg_grp->reg_tbl_head, reg_entry, entries);
    16.8 +    LIST_INSERT_HEAD(&reg_grp->reg_tbl_head, reg_entry, entries);
    16.9  
   16.10  out:
   16.11      return err;
   16.12 @@ -1659,7 +1659,7 @@ static int pt_config_init(struct pt_dev 
   16.13      int i, j, err = 0;
   16.14  
   16.15      /* initialize register group list */
   16.16 -    QEMU_LIST_INIT(&ptdev->reg_grp_tbl_head);
   16.17 +    LIST_INIT(&ptdev->reg_grp_tbl_head);
   16.18  
   16.19      /* initialize register group */
   16.20      for (i=0; pt_emu_reg_grp_tbl[i].grp_size != 0; i++)
   16.21 @@ -1682,12 +1682,12 @@ static int pt_config_init(struct pt_dev 
   16.22          }
   16.23  
   16.24          /* initialize register group entry */
   16.25 -        QEMU_LIST_INIT(&reg_grp_entry->reg_tbl_head);
   16.26 +        LIST_INIT(&reg_grp_entry->reg_tbl_head);
   16.27  
   16.28          /* need to declare here, to enable searching Cap Ptr reg 
   16.29           * (which is in the same reg group) when initializing Status reg 
   16.30           */
   16.31 -        QEMU_LIST_INSERT_HEAD(&ptdev->reg_grp_tbl_head, reg_grp_entry, entries);
   16.32 +        LIST_INSERT_HEAD(&ptdev->reg_grp_tbl_head, reg_grp_entry, entries);
   16.33  
   16.34          reg_grp_entry->base_offset = reg_grp_offset;
   16.35          reg_grp_entry->reg_grp = 
   16.36 @@ -1740,11 +1740,11 @@ static void pt_config_delete(struct pt_d
   16.37          /* free all register entry */
   16.38          while ((reg_entry = reg_grp_entry->reg_tbl_head.lh_first) != NULL)
   16.39          {
   16.40 -            QEMU_LIST_REMOVE(reg_entry, entries);
   16.41 +            LIST_REMOVE(reg_entry, entries);
   16.42              qemu_free(reg_entry);
   16.43          }
   16.44  
   16.45 -        QEMU_LIST_REMOVE(reg_grp_entry, entries);
   16.46 +        LIST_REMOVE(reg_grp_entry, entries);
   16.47          qemu_free(reg_grp_entry);
   16.48      }
   16.49  }
    17.1 --- a/tools/ioemu/hw/pass-through.h	Fri Aug 08 10:46:39 2008 +0100
    17.2 +++ b/tools/ioemu/hw/pass-through.h	Fri Aug 08 10:48:48 2008 +0100
    17.3 @@ -136,7 +136,7 @@ struct pt_dev {
    17.4      PCIDevice dev;
    17.5      struct pci_dev *pci_dev;                    /* libpci struct */
    17.6      struct pt_region bases[PCI_NUM_REGIONS];    /* Access regions */
    17.7 -    QEMU_LIST_HEAD (reg_grp_tbl_listhead, pt_reg_grp_tbl) reg_grp_tbl_head;
    17.8 +    LIST_HEAD (reg_grp_tbl_listhead, pt_reg_grp_tbl) reg_grp_tbl_head;
    17.9                                                  /* emul reg group list */
   17.10      struct pt_msi_info *msi;                    /* MSI virtualization */
   17.11      struct pt_msix_info *msix;                  /* MSI-X virtualization */
   17.12 @@ -163,7 +163,7 @@ int pt_init(PCIBus * e_bus, char * direc
   17.13  /* emul reg group management table */
   17.14  struct pt_reg_grp_tbl {
   17.15      /* emul reg group list */
   17.16 -    QEMU_LIST_ENTRY (pt_reg_grp_tbl) entries;
   17.17 +    LIST_ENTRY (pt_reg_grp_tbl) entries;
   17.18      /* emul reg group info table */
   17.19      struct pt_reg_grp_info_tbl *reg_grp;
   17.20      /* emul reg group base offset */
   17.21 @@ -171,7 +171,7 @@ struct pt_reg_grp_tbl {
   17.22      /* emul reg group size */
   17.23      uint8_t size;
   17.24      /* emul reg management table list */
   17.25 -    QEMU_LIST_HEAD (reg_tbl_listhead, pt_reg_tbl) reg_tbl_head;
   17.26 +    LIST_HEAD (reg_tbl_listhead, pt_reg_tbl) reg_tbl_head;
   17.27  };
   17.28  
   17.29  /* emul reg group size initialize method */
   17.30 @@ -195,7 +195,7 @@ struct pt_reg_grp_info_tbl {
   17.31  /* emul reg management table */
   17.32  struct pt_reg_tbl {
   17.33      /* emul reg table list */
   17.34 -    QEMU_LIST_ENTRY (pt_reg_tbl) entries;
   17.35 +    LIST_ENTRY (pt_reg_tbl) entries;
   17.36      /* emul reg info table */
   17.37      struct pt_reg_info_tbl *reg;
   17.38      /* emul reg value */
    18.1 --- a/tools/ioemu/monitor.c	Fri Aug 08 10:46:39 2008 +0100
    18.2 +++ b/tools/ioemu/monitor.c	Fri Aug 08 10:48:48 2008 +0100
    18.3 @@ -1167,7 +1167,7 @@ static void do_info_profile(void)
    18.4  #endif
    18.5  
    18.6  /* Capture support */
    18.7 -static QEMU_LIST_HEAD (capture_list_head, CaptureState) capture_head;
    18.8 +static LIST_HEAD (capture_list_head, CaptureState) capture_head;
    18.9  
   18.10  static void do_info_capture (void)
   18.11  {
   18.12 @@ -1188,7 +1188,7 @@ static void do_stop_capture (int n)
   18.13      for (s = capture_head.lh_first, i = 0; s; s = s->entries.le_next, ++i) {
   18.14          if (i == n) {
   18.15              s->ops.destroy (s->opaque);
   18.16 -            QEMU_LIST_REMOVE (s, entries);
   18.17 +            LIST_REMOVE (s, entries);
   18.18              qemu_free (s);
   18.19              return;
   18.20          }
   18.21 @@ -1220,7 +1220,7 @@ static void do_wav_capture (const char *
   18.22          term_printf ("Faied to add wave capture\n");
   18.23          qemu_free (s);
   18.24      }
   18.25 -    QEMU_LIST_INSERT_HEAD (&capture_head, s, entries);
   18.26 +    LIST_INSERT_HEAD (&capture_head, s, entries);
   18.27  }
   18.28  #endif
   18.29  
    19.1 --- a/tools/ioemu/vl.c	Fri Aug 08 10:46:39 2008 +0100
    19.2 +++ b/tools/ioemu/vl.c	Fri Aug 08 10:48:48 2008 +0100
    19.3 @@ -6155,10 +6155,10 @@ void gui_update(void *opaque)
    19.4  struct vm_change_state_entry {
    19.5      VMChangeStateHandler *cb;
    19.6      void *opaque;
    19.7 -    QEMU_LIST_ENTRY (vm_change_state_entry) entries;
    19.8 +    LIST_ENTRY (vm_change_state_entry) entries;
    19.9  };
   19.10  
   19.11 -static QEMU_LIST_HEAD(vm_change_state_head, vm_change_state_entry) vm_change_state_head;
   19.12 +static LIST_HEAD(vm_change_state_head, vm_change_state_entry) vm_change_state_head;
   19.13  
   19.14  VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
   19.15                                                       void *opaque)
   19.16 @@ -6171,13 +6171,13 @@ VMChangeStateEntry *qemu_add_vm_change_s
   19.17  
   19.18      e->cb = cb;
   19.19      e->opaque = opaque;
   19.20 -    QEMU_LIST_INSERT_HEAD(&vm_change_state_head, e, entries);
   19.21 +    LIST_INSERT_HEAD(&vm_change_state_head, e, entries);
   19.22      return e;
   19.23  }
   19.24  
   19.25  void qemu_del_vm_change_state_handler(VMChangeStateEntry *e)
   19.26  {
   19.27 -    QEMU_LIST_REMOVE (e, entries);
   19.28 +    LIST_REMOVE (e, entries);
   19.29      qemu_free (e);
   19.30  }
   19.31  
   19.32 @@ -7138,7 +7138,7 @@ int main(int argc, char **argv)
   19.33      }
   19.34  #endif
   19.35  
   19.36 -    QEMU_LIST_INIT (&vm_change_state_head);
   19.37 +    LIST_INIT (&vm_change_state_head);
   19.38  #ifndef CONFIG_STUBDOM
   19.39  #ifndef _WIN32
   19.40      {