ia64/xen-unstable

changeset 18302:d24bc5f549ba

merge with xen-unstable.hg
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Aug 11 11:04:52 2008 +0900 (2008-08-11)
parents b086089f4643 4e3316ed1af5
children fa8be8a6cb74 f60c565e2ca2
files
line diff
     1.1 --- a/.hgtags	Mon Aug 11 10:59:39 2008 +0900
     1.2 +++ b/.hgtags	Mon Aug 11 11:04:52 2008 +0900
     1.3 @@ -27,3 +27,4 @@ 36bb2ab4722733d919d32e4555eb46cc6a06cb8f
     1.4  9facc624a238f2b9437b07fa28ff65884aa867f2 3.2.0-rc6
     1.5  c3494402098e26507fc61a6579832c0149351d6a 3.3.0-rc1
     1.6  dde12ff94c96331668fe38a7b09506fa94d03c34 3.3.0-rc2
     1.7 +57fca3648f25dcc085ee380954342960a7979987 3.3.0-rc3
     3.1 --- a/README	Mon Aug 11 10:59:39 2008 +0900
     3.2 +++ b/README	Mon Aug 11 11:04:52 2008 +0900
     3.3 @@ -1,10 +1,10 @@
     3.4  #################################
     3.5 - __  __            _  _    ___  
     3.6 - \ \/ /___ _ __   | || |  / _ \ 
     3.7 -  \  // _ \ '_ \  | || |_| | | |
     3.8 -  /  \  __/ | | | |__   _| |_| |
     3.9 - /_/\_\___|_| |_|    |_|(_)___/ 
    3.10 -                                
    3.11 + __  __            _____  _____  
    3.12 + \ \/ /___ _ __   |___ / |___ /  
    3.13 +  \  // _ \ '_ \    |_ \   |_ \  
    3.14 +  /  \  __/ | | |  ___) | ___) | 
    3.15 + /_/\_\___|_| |_| |____(_)____/  
    3.16 +                                 
    3.17  #################################
    3.18  
    3.19  http://www.xen.org/
    3.20 @@ -21,7 +21,7 @@ development community, spearheaded by Xe
    3.21  by the original Xen development team to build enterprise products
    3.22  around Xen.
    3.23  
    3.24 -The 4.0 release offers excellent performance, hardware support and
    3.25 +The 3.3 release offers excellent performance, hardware support and
    3.26  enterprise-grade features such as x86_32-PAE, x86_64, SMP guests and
    3.27  live relocation of VMs. Ports to Linux 2.6, Linux 2.4, NetBSD, FreeBSD
    3.28  and Solaris are available from the community.
    3.29 @@ -54,8 +54,8 @@ 2. Configure your bootloader to boot Xen
    3.30     /boot/grub/menu.lst: edit this file to include an entry like the
    3.31     following:
    3.32  
    3.33 -    title Xen 4.0 / XenLinux 2.6
    3.34 -       kernel /boot/xen-4.0.gz console=vga
    3.35 +    title Xen 3.3 / XenLinux 2.6
    3.36 +       kernel /boot/xen-3.3.gz console=vga
    3.37         module /boot/vmlinuz-2.6-xen root=<root-dev> ro console=tty0
    3.38         module /boot/initrd-2.6-xen.img
    3.39  
    3.40 @@ -74,7 +74,7 @@ 2. Configure your bootloader to boot Xen
    3.41     32MB memory for internal use, which is not available for allocation
    3.42     to virtual machines.
    3.43  
    3.44 -3. Reboot your system and select the "Xen 4.0 / XenLinux 2.6" menu
    3.45 +3. Reboot your system and select the "Xen 3.3 / XenLinux 2.6" menu
    3.46     option. After booting Xen, Linux will start and your initialisation
    3.47     scripts should execute in the usual way.
    3.48  
     4.1 --- a/extras/mini-os/fs-front.c	Mon Aug 11 10:59:39 2008 +0900
     4.2 +++ b/extras/mini-os/fs-front.c	Mon Aug 11 11:04:52 2008 +0900
     4.3 @@ -1170,7 +1170,7 @@ done:
     4.4      return 1;
     4.5  }
     4.6  
     4.7 -static void add_export(struct list_head *exports, unsigned int domid)
     4.8 +static void add_export(struct minios_list_head *exports, unsigned int domid)
     4.9  {
    4.10      char node[1024], **exports_list = NULL, *ret_msg;
    4.11      int j = 0;
    4.12 @@ -1192,8 +1192,8 @@ static void add_export(struct list_head 
    4.13              import->dom_id = domid;
    4.14              import->export_id = export_id;
    4.15              import->import_id = import_id++;
    4.16 -            INIT_LIST_HEAD(&import->list);
    4.17 -            list_add(&import->list, exports);
    4.18 +            MINIOS_INIT_LIST_HEAD(&import->list);
    4.19 +            minios_list_add(&import->list, exports);
    4.20          }
    4.21          free(exports_list[j]);
    4.22          j++;
    4.23 @@ -1205,14 +1205,14 @@ static void add_export(struct list_head 
    4.24  }
    4.25  
    4.26  #if 0
    4.27 -static struct list_head* probe_exports(void)
    4.28 +static struct minios_list_head* probe_exports(void)
    4.29  {
    4.30 -    struct list_head *exports;
    4.31 +    struct minios_list_head *exports;
    4.32      char **node_list = NULL, *msg = NULL;
    4.33      int i = 0;
    4.34  
    4.35 -    exports = xmalloc(struct list_head);
    4.36 -    INIT_LIST_HEAD(exports);
    4.37 +    exports = xmalloc(struct minios_list_head);
    4.38 +    MINIOS_INIT_LIST_HEAD(exports);
    4.39      
    4.40      msg = xenbus_ls(XBT_NIL, "/local/domain", &node_list);
    4.41      if(msg)
    4.42 @@ -1237,19 +1237,19 @@ exit:
    4.43  }
    4.44  #endif
    4.45  
    4.46 -LIST_HEAD(exports);
    4.47 +MINIOS_LIST_HEAD(exports);
    4.48  
    4.49  void init_fs_frontend(void)
    4.50  {
    4.51 -    struct list_head *entry;
    4.52 +    struct minios_list_head *entry;
    4.53      struct fs_import *import = NULL;
    4.54      printk("Initing FS fronend(s).\n");
    4.55  
    4.56      //exports = probe_exports();
    4.57      add_export(&exports, 0);
    4.58 -    list_for_each(entry, &exports)
    4.59 +    minios_list_for_each(entry, &exports)
    4.60      {
    4.61 -        import = list_entry(entry, struct fs_import, list);
    4.62 +        import = minios_list_entry(entry, struct fs_import, list);
    4.63          printk("FS export [dom=%d, id=%d] found\n", 
    4.64                  import->dom_id, import->export_id);
    4.65          init_fs_import(import);
     5.1 --- a/extras/mini-os/include/fcntl.h	Mon Aug 11 10:59:39 2008 +0900
     5.2 +++ b/extras/mini-os/include/fcntl.h	Mon Aug 11 11:04:52 2008 +0900
     5.3 @@ -91,8 +91,9 @@ struct flock64 {
     5.4  #define F_LINUX_SPECIFIC_BASE	1024
     5.5  */
     5.6  
     5.7 -int open(const char *path, int flags, ...);
     5.8 -int fcntl(int fd, int cmd, ...);
     5.9  #endif
    5.10  
    5.11 +int open(const char *path, int flags, ...) asm("open64");
    5.12 +int fcntl(int fd, int cmd, ...);
    5.13 +
    5.14  #endif
     6.1 --- a/extras/mini-os/include/fs.h	Mon Aug 11 10:59:39 2008 +0900
     6.2 +++ b/extras/mini-os/include/fs.h	Mon Aug 11 11:04:52 2008 +0900
     6.3 @@ -13,7 +13,7 @@ struct fs_import
     6.4      domid_t dom_id;                 /* dom id of the exporting domain       */ 
     6.5      u16 export_id;                  /* export id (exporting dom specific)   */
     6.6      u16 import_id;                  /* import id (specific to this domain)  */ 
     6.7 -    struct list_head list;          /* list of all imports                  */
     6.8 +    struct minios_list_head list;   /* list of all imports                  */
     6.9      unsigned int nr_entries;        /* Number of entries in rings & request
    6.10                                         array                                */
    6.11      struct fsif_front_ring ring;    /* frontend ring (contains shared ring) */
     7.1 --- a/extras/mini-os/include/list.h	Mon Aug 11 10:59:39 2008 +0900
     7.2 +++ b/extras/mini-os/include/list.h	Mon Aug 11 11:04:52 2008 +0900
     7.3 @@ -11,23 +11,23 @@
     7.4   * using the generic single-entry routines.
     7.5   */
     7.6  
     7.7 -struct list_head {
     7.8 -	struct list_head *next, *prev;
     7.9 +struct minios_list_head {
    7.10 +	struct minios_list_head *next, *prev;
    7.11  };
    7.12  
    7.13 -#define LIST_HEAD_INIT(name) { &(name), &(name) }
    7.14 +#define MINIOS_LIST_HEAD_INIT(name) { &(name), &(name) }
    7.15  
    7.16 -#define LIST_HEAD(name) \
    7.17 -	struct list_head name = LIST_HEAD_INIT(name)
    7.18 +#define MINIOS_LIST_HEAD(name) \
    7.19 +	struct minios_list_head name = MINIOS_LIST_HEAD_INIT(name)
    7.20  
    7.21 -#define INIT_LIST_HEAD(ptr) do { \
    7.22 +#define MINIOS_INIT_LIST_HEAD(ptr) do { \
    7.23  	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
    7.24  } while (0)
    7.25  
    7.26 -#define list_top(head, type, member)					  \
    7.27 +#define minios_list_top(head, type, member)					  \
    7.28  ({ 									  \
    7.29 -	struct list_head *_head = (head);				  \
    7.30 -	list_empty(_head) ? NULL : list_entry(_head->next, type, member); \
    7.31 +	struct minios_list_head *_head = (head);				  \
    7.32 +	minios_list_empty(_head) ? NULL : minios_list_entry(_head->next, type, member); \
    7.33  })
    7.34  
    7.35  /*
    7.36 @@ -36,9 +36,9 @@ struct list_head {
    7.37   * This is only for internal list manipulation where we know
    7.38   * the prev/next entries already!
    7.39   */
    7.40 -static __inline__ void __list_add(struct list_head * new,
    7.41 -	struct list_head * prev,
    7.42 -	struct list_head * next)
    7.43 +static __inline__ void __minios_list_add(struct minios_list_head * new,
    7.44 +	struct minios_list_head * prev,
    7.45 +	struct minios_list_head * next)
    7.46  {
    7.47  	next->prev = new;
    7.48  	new->next = next;
    7.49 @@ -47,29 +47,29 @@ static __inline__ void __list_add(struct
    7.50  }
    7.51  
    7.52  /**
    7.53 - * list_add - add a new entry
    7.54 + * minios_list_add - add a new entry
    7.55   * @new: new entry to be added
    7.56   * @head: list head to add it after
    7.57   *
    7.58   * Insert a new entry after the specified head.
    7.59   * This is good for implementing stacks.
    7.60   */
    7.61 -static __inline__ void list_add(struct list_head *new, struct list_head *head)
    7.62 +static __inline__ void minios_list_add(struct minios_list_head *new, struct minios_list_head *head)
    7.63  {
    7.64 -	__list_add(new, head, head->next);
    7.65 +	__minios_list_add(new, head, head->next);
    7.66  }
    7.67  
    7.68  /**
    7.69 - * list_add_tail - add a new entry
    7.70 + * minios_list_add_tail - add a new entry
    7.71   * @new: new entry to be added
    7.72   * @head: list head to add it before
    7.73   *
    7.74   * Insert a new entry before the specified head.
    7.75   * This is useful for implementing queues.
    7.76   */
    7.77 -static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
    7.78 +static __inline__ void minios_list_add_tail(struct minios_list_head *new, struct minios_list_head *head)
    7.79  {
    7.80 -	__list_add(new, head->prev, head);
    7.81 +	__minios_list_add(new, head->prev, head);
    7.82  }
    7.83  
    7.84  /*
    7.85 @@ -79,54 +79,54 @@ static __inline__ void list_add_tail(str
    7.86   * This is only for internal list manipulation where we know
    7.87   * the prev/next entries already!
    7.88   */
    7.89 -static __inline__ void __list_del(struct list_head * prev,
    7.90 -				  struct list_head * next)
    7.91 +static __inline__ void __minios_list_del(struct minios_list_head * prev,
    7.92 +				  struct minios_list_head * next)
    7.93  {
    7.94  	next->prev = prev;
    7.95  	prev->next = next;
    7.96  }
    7.97  
    7.98  /**
    7.99 - * list_del - deletes entry from list.
   7.100 + * minios_list_del - deletes entry from list.
   7.101   * @entry: the element to delete from the list.
   7.102 - * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
   7.103 + * Note: minios_list_empty on entry does not return true after this, the entry is in an undefined state.
   7.104   */
   7.105 -static __inline__ void list_del(struct list_head *entry)
   7.106 +static __inline__ void minios_list_del(struct minios_list_head *entry)
   7.107  {
   7.108 -	__list_del(entry->prev, entry->next);
   7.109 +	__minios_list_del(entry->prev, entry->next);
   7.110  }
   7.111  
   7.112  /**
   7.113 - * list_del_init - deletes entry from list and reinitialize it.
   7.114 + * minios_list_del_init - deletes entry from list and reinitialize it.
   7.115   * @entry: the element to delete from the list.
   7.116   */
   7.117 -static __inline__ void list_del_init(struct list_head *entry)
   7.118 +static __inline__ void minios_list_del_init(struct minios_list_head *entry)
   7.119  {
   7.120 -	__list_del(entry->prev, entry->next);
   7.121 -	INIT_LIST_HEAD(entry); 
   7.122 +	__minios_list_del(entry->prev, entry->next);
   7.123 +	MINIOS_INIT_LIST_HEAD(entry); 
   7.124  }
   7.125  
   7.126  /**
   7.127 - * list_empty - tests whether a list is empty
   7.128 + * minios_list_empty - tests whether a list is empty
   7.129   * @head: the list to test.
   7.130   */
   7.131 -static __inline__ int list_empty(struct list_head *head)
   7.132 +static __inline__ int minios_list_empty(struct minios_list_head *head)
   7.133  {
   7.134  	return head->next == head;
   7.135  }
   7.136  
   7.137  /**
   7.138 - * list_splice - join two lists
   7.139 + * minios_list_splice - join two lists
   7.140   * @list: the new list to add.
   7.141   * @head: the place to add it in the first list.
   7.142   */
   7.143 -static __inline__ void list_splice(struct list_head *list, struct list_head *head)
   7.144 +static __inline__ void minios_list_splice(struct minios_list_head *list, struct minios_list_head *head)
   7.145  {
   7.146 -	struct list_head *first = list->next;
   7.147 +	struct minios_list_head *first = list->next;
   7.148  
   7.149  	if (first != list) {
   7.150 -		struct list_head *last = list->prev;
   7.151 -		struct list_head *at = head->next;
   7.152 +		struct minios_list_head *last = list->prev;
   7.153 +		struct minios_list_head *at = head->next;
   7.154  
   7.155  		first->prev = head;
   7.156  		head->next = first;
   7.157 @@ -137,54 +137,54 @@ static __inline__ void list_splice(struc
   7.158  }
   7.159  
   7.160  /**
   7.161 - * list_entry - get the struct for this entry
   7.162 - * @ptr:	the &struct list_head pointer.
   7.163 + * minios_list_entry - get the struct for this entry
   7.164 + * @ptr:	the &struct minios_list_head pointer.
   7.165   * @type:	the type of the struct this is embedded in.
   7.166 - * @member:	the name of the list_struct within the struct.
   7.167 + * @member:	the name of the minios_list_struct within the struct.
   7.168   */
   7.169 -#define list_entry(ptr, type, member) \
   7.170 +#define minios_list_entry(ptr, type, member) \
   7.171  	((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
   7.172  
   7.173  /**
   7.174 - * list_for_each	-	iterate over a list
   7.175 - * @pos:	the &struct list_head to use as a loop counter.
   7.176 + * minios_list_for_each	-	iterate over a list
   7.177 + * @pos:	the &struct minios_list_head to use as a loop counter.
   7.178   * @head:	the head for your list.
   7.179   */
   7.180 -#define list_for_each(pos, head) \
   7.181 +#define minios_list_for_each(pos, head) \
   7.182  	for (pos = (head)->next; pos != (head); pos = pos->next)
   7.183          	
   7.184  /**
   7.185 - * list_for_each_safe	-	iterate over a list safe against removal of list entry
   7.186 - * @pos:	the &struct list_head to use as a loop counter.
   7.187 - * @n:		another &struct list_head to use as temporary storage
   7.188 + * minios_list_for_each_safe	-	iterate over a list safe against removal of list entry
   7.189 + * @pos:	the &struct minios_list_head to use as a loop counter.
   7.190 + * @n:		another &struct minios_list_head to use as temporary storage
   7.191   * @head:	the head for your list.
   7.192   */
   7.193 -#define list_for_each_safe(pos, n, head) \
   7.194 +#define minios_list_for_each_safe(pos, n, head) \
   7.195  	for (pos = (head)->next, n = pos->next; pos != (head); \
   7.196  		pos = n, n = pos->next)
   7.197  
   7.198  /**
   7.199 - * list_for_each_entry	-	iterate over list of given type
   7.200 + * minios_list_for_each_entry	-	iterate over list of given type
   7.201   * @pos:	the type * to use as a loop counter.
   7.202   * @head:	the head for your list.
   7.203 - * @member:	the name of the list_struct within the struct.
   7.204 + * @member:	the name of the minios_list_struct within the struct.
   7.205   */
   7.206 -#define list_for_each_entry(pos, head, member)				\
   7.207 -	for (pos = list_entry((head)->next, typeof(*pos), member);	\
   7.208 +#define minios_list_for_each_entry(pos, head, member)				\
   7.209 +	for (pos = minios_list_entry((head)->next, typeof(*pos), member);	\
   7.210  	     &pos->member != (head); 					\
   7.211 -	     pos = list_entry(pos->member.next, typeof(*pos), member))
   7.212 +	     pos = minios_list_entry(pos->member.next, typeof(*pos), member))
   7.213  
   7.214  /**
   7.215 - * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
   7.216 + * minios_list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
   7.217   * @pos:	the type * to use as a loop counter.
   7.218   * @n:		another type * to use as temporary storage
   7.219   * @head:	the head for your list.
   7.220 - * @member:	the name of the list_struct within the struct.
   7.221 + * @member:	the name of the minios_list_struct within the struct.
   7.222   */
   7.223 -#define list_for_each_entry_safe(pos, n, head, member)			\
   7.224 -	for (pos = list_entry((head)->next, typeof(*pos), member),	\
   7.225 -		n = list_entry(pos->member.next, typeof(*pos), member);	\
   7.226 +#define minios_list_for_each_entry_safe(pos, n, head, member)			\
   7.227 +	for (pos = minios_list_entry((head)->next, typeof(*pos), member),	\
   7.228 +		n = minios_list_entry(pos->member.next, typeof(*pos), member);	\
   7.229  	     &pos->member != (head); 					\
   7.230 -	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
   7.231 +	     pos = n, n = minios_list_entry(n->member.next, typeof(*n), member))
   7.232  #endif /* _LINUX_LIST_H */
   7.233  
     8.1 --- a/extras/mini-os/include/posix/sys/mman.h	Mon Aug 11 10:59:39 2008 +0900
     8.2 +++ b/extras/mini-os/include/posix/sys/mman.h	Mon Aug 11 11:04:52 2008 +0900
     8.3 @@ -14,7 +14,7 @@
     8.4  
     8.5  #define MAP_FAILED	((void*)0)
     8.6  
     8.7 -void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
     8.8 +void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) asm("mmap64");
     8.9  int munmap(void *start, size_t length);
    8.10  #define munlock(addr, len) ((void)addr, (void)len, 0)
    8.11  #define mlock(addr, len) ((void)addr, (void)len, 0)
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/extras/mini-os/include/posix/sys/stat.h	Mon Aug 11 11:04:52 2008 +0900
     9.3 @@ -0,0 +1,7 @@
     9.4 +#ifndef _POSIX_SYS_STAT_H
     9.5 +#define _POSIX_SYS_STAT_H
     9.6 +
     9.7 +#include_next <sys/stat.h>
     9.8 +int fstat(int fd, struct stat *buf) asm("fstat64");
     9.9 +
    9.10 +#endif /* _POSIX_SYS_STAT_H */
    10.1 --- a/extras/mini-os/include/sched.h	Mon Aug 11 10:59:39 2008 +0900
    10.2 +++ b/extras/mini-os/include/sched.h	Mon Aug 11 11:04:52 2008 +0900
    10.3 @@ -19,7 +19,7 @@ struct thread
    10.4  #else /* !defined(__ia64__) */
    10.5      thread_regs_t regs;
    10.6  #endif /* !defined(__ia64__) */
    10.7 -    struct list_head thread_list;
    10.8 +    struct minios_list_head thread_list;
    10.9      u32 flags;
   10.10      s_time_t wakeup_time;
   10.11  #ifdef HAVE_LIBC
    11.1 --- a/extras/mini-os/include/semaphore.h	Mon Aug 11 10:59:39 2008 +0900
    11.2 +++ b/extras/mini-os/include/semaphore.h	Mon Aug 11 11:04:52 2008 +0900
    11.3 @@ -21,7 +21,7 @@ struct semaphore
    11.4  struct rw_semaphore {
    11.5  	signed long		count;
    11.6  	spinlock_t		wait_lock;
    11.7 -	struct list_head	wait_list;
    11.8 +	struct minios_list_head	wait_list;
    11.9  	int			debug;
   11.10  };
   11.11  
    12.1 --- a/extras/mini-os/include/wait.h	Mon Aug 11 10:59:39 2008 +0900
    12.2 +++ b/extras/mini-os/include/wait.h	Mon Aug 11 11:04:52 2008 +0900
    12.3 @@ -8,42 +8,42 @@
    12.4  #define DEFINE_WAIT(name)                               \
    12.5  struct wait_queue name = {                              \
    12.6      .thread       = current,                            \
    12.7 -    .thread_list  = LIST_HEAD_INIT((name).thread_list), \
    12.8 +    .thread_list  = MINIOS_LIST_HEAD_INIT((name).thread_list), \
    12.9  }
   12.10  
   12.11  
   12.12  static inline void init_waitqueue_head(struct wait_queue_head *h)
   12.13  {
   12.14 -  INIT_LIST_HEAD(&h->thread_list);
   12.15 +  MINIOS_INIT_LIST_HEAD(&h->thread_list);
   12.16  }
   12.17  
   12.18  static inline void init_waitqueue_entry(struct wait_queue *q, struct thread *thread)
   12.19  {
   12.20      q->thread = thread;
   12.21 -    INIT_LIST_HEAD(&q->thread_list);
   12.22 +    MINIOS_INIT_LIST_HEAD(&q->thread_list);
   12.23  }
   12.24  
   12.25  
   12.26  static inline void add_wait_queue(struct wait_queue_head *h, struct wait_queue *q)
   12.27  {
   12.28 -    if (list_empty(&q->thread_list))
   12.29 -        list_add(&q->thread_list, &h->thread_list);   
   12.30 +    if (minios_list_empty(&q->thread_list))
   12.31 +        minios_list_add(&q->thread_list, &h->thread_list);   
   12.32  }
   12.33  
   12.34  static inline void remove_wait_queue(struct wait_queue *q)
   12.35  {
   12.36 -    list_del(&q->thread_list);
   12.37 +    minios_list_del(&q->thread_list);
   12.38  }
   12.39  
   12.40  static inline void wake_up(struct wait_queue_head *head)
   12.41  {
   12.42      unsigned long flags;
   12.43 -    struct list_head *tmp, *next;
   12.44 +    struct minios_list_head *tmp, *next;
   12.45      local_irq_save(flags);
   12.46 -    list_for_each_safe(tmp, next, &head->thread_list)
   12.47 +    minios_list_for_each_safe(tmp, next, &head->thread_list)
   12.48      {
   12.49           struct wait_queue *curr;
   12.50 -         curr = list_entry(tmp, struct wait_queue, thread_list);
   12.51 +         curr = minios_list_entry(tmp, struct wait_queue, thread_list);
   12.52           wake(curr->thread);
   12.53      }
   12.54      local_irq_restore(flags);
    13.1 --- a/extras/mini-os/include/waittypes.h	Mon Aug 11 10:59:39 2008 +0900
    13.2 +++ b/extras/mini-os/include/waittypes.h	Mon Aug 11 11:04:52 2008 +0900
    13.3 @@ -7,13 +7,13 @@ struct thread;
    13.4  struct wait_queue
    13.5  {
    13.6      struct thread *thread;
    13.7 -    struct list_head thread_list;
    13.8 +    struct minios_list_head thread_list;
    13.9  };
   13.10  
   13.11  struct wait_queue_head
   13.12  {
   13.13      /* TODO - lock required? */
   13.14 -    struct list_head thread_list;
   13.15 +    struct minios_list_head thread_list;
   13.16  };
   13.17  
   13.18  #define DECLARE_WAIT_QUEUE_HEAD(name) \
    14.1 --- a/extras/mini-os/lib/sys.c	Mon Aug 11 10:59:39 2008 +0900
    14.2 +++ b/extras/mini-os/lib/sys.c	Mon Aug 11 11:04:52 2008 +0900
    14.3 @@ -204,9 +204,6 @@ int open(const char *pathname, int flags
    14.4      files[fd].file.offset = 0;
    14.5      return fd;
    14.6  }
    14.7 -#if defined(__x86_64__) || defined(__ia64__)
    14.8 -__typeof__(open) open64 __attribute__((__alias__("open")));
    14.9 -#endif
   14.10  
   14.11  int isatty(int fd)
   14.12  {
   14.13 @@ -347,9 +344,6 @@ off_t lseek(int fd, off_t offset, int wh
   14.14      }
   14.15      return files[fd].file.offset;
   14.16  }
   14.17 -#if defined(__x86_64__) || defined(__ia64__)
   14.18 -__typeof__(lseek) lseek64 __attribute__((__alias__("lseek")));
   14.19 -#endif
   14.20  
   14.21  int fsync(int fd) {
   14.22      switch (files[fd].type) {
   14.23 @@ -1120,9 +1114,6 @@ void *mmap(void *start, size_t length, i
   14.24          return map_frames_ex(&zero, n, 0, 0, 1, DOMID_SELF, 0, 0);
   14.25      } else ASSERT(0);
   14.26  }
   14.27 -#if defined(__x86_64__) || defined(__ia64__)
   14.28 -__typeof__(mmap) mmap64 __attribute__((__alias__("mmap")));
   14.29 -#endif
   14.30  
   14.31  int munmap(void *start, size_t length)
   14.32  {
    15.1 --- a/extras/mini-os/lib/xmalloc.c	Mon Aug 11 10:59:39 2008 +0900
    15.2 +++ b/extras/mini-os/lib/xmalloc.c	Mon Aug 11 11:04:52 2008 +0900
    15.3 @@ -44,14 +44,14 @@
    15.4  #include <xmalloc.h>
    15.5  
    15.6  #ifndef HAVE_LIBC
    15.7 -static LIST_HEAD(freelist);
    15.8 +static MINIOS_LIST_HEAD(freelist);
    15.9  /* static spinlock_t freelist_lock = SPIN_LOCK_UNLOCKED; */
   15.10  
   15.11  struct xmalloc_hdr
   15.12  {
   15.13      /* Total including this hdr, unused padding and second hdr. */
   15.14      size_t size;
   15.15 -    struct list_head freelist;
   15.16 +    struct minios_list_head freelist;
   15.17  } __cacheline_aligned;
   15.18  
   15.19  /* Unused padding data between the two hdrs. */
   15.20 @@ -82,7 +82,7 @@ static void maybe_split(struct xmalloc_h
   15.21          extra = (struct xmalloc_hdr *)((unsigned long)hdr + size);
   15.22          extra->size = leftover;
   15.23          /* spin_lock_irqsave(&freelist_lock, flags); */
   15.24 -        list_add(&extra->freelist, &freelist);
   15.25 +        minios_list_add(&extra->freelist, &freelist);
   15.26          /* spin_unlock_irqrestore(&freelist_lock, flags); */
   15.27      }
   15.28      else
   15.29 @@ -155,14 +155,14 @@ void *_xmalloc(size_t size, size_t align
   15.30  
   15.31      /* Search free list. */
   15.32      /* spin_lock_irqsave(&freelist_lock, flags); */
   15.33 -    list_for_each_entry_safe( i, tmp, &freelist, freelist )
   15.34 +    minios_list_for_each_entry_safe( i, tmp, &freelist, freelist )
   15.35      {
   15.36          data_begin = align_up((uintptr_t)i + hdr_size, align);
   15.37  
   15.38          if ( data_begin + size > (uintptr_t)i + i->size )
   15.39              continue;
   15.40  
   15.41 -        list_del(&i->freelist);
   15.42 +        minios_list_del(&i->freelist);
   15.43          /* spin_unlock_irqrestore(&freelist_lock, flags); */
   15.44  
   15.45          uintptr_t size_before = (data_begin - hdr_size) - (uintptr_t)i;
   15.46 @@ -173,7 +173,7 @@ void *_xmalloc(size_t size, size_t align
   15.47              new_i->size = i->size - size_before;
   15.48              i->size = size_before;
   15.49              /* spin_lock_irqsave(&freelist_lock, flags); */
   15.50 -            list_add(&i->freelist, &freelist);
   15.51 +            minios_list_add(&i->freelist, &freelist);
   15.52              /* spin_unlock_irqrestore(&freelist_lock, flags); */
   15.53              i = new_i;
   15.54          }
   15.55 @@ -231,7 +231,7 @@ void xfree(const void *p)
   15.56  
   15.57      /* Merge with other free block, or put in list. */
   15.58      /* spin_lock_irqsave(&freelist_lock, flags); */
   15.59 -    list_for_each_entry_safe( i, tmp, &freelist, freelist )
   15.60 +    minios_list_for_each_entry_safe( i, tmp, &freelist, freelist )
   15.61      {
   15.62          unsigned long _i   = (unsigned long)i;
   15.63          unsigned long _hdr = (unsigned long)hdr;
   15.64 @@ -243,7 +243,7 @@ void xfree(const void *p)
   15.65          /* We follow this block?  Swallow it. */
   15.66          if ( (_i + i->size) == _hdr )
   15.67          {
   15.68 -            list_del(&i->freelist);
   15.69 +            minios_list_del(&i->freelist);
   15.70              i->size += hdr->size;
   15.71              hdr = i;
   15.72          }
   15.73 @@ -251,7 +251,7 @@ void xfree(const void *p)
   15.74          /* We precede this block? Swallow it. */
   15.75          if ( (_hdr + hdr->size) == _i )
   15.76          {
   15.77 -            list_del(&i->freelist);
   15.78 +            minios_list_del(&i->freelist);
   15.79              hdr->size += i->size;
   15.80          }
   15.81      }
   15.82 @@ -268,7 +268,7 @@ void xfree(const void *p)
   15.83      }
   15.84      else
   15.85      {
   15.86 -        list_add(&hdr->freelist, &freelist);
   15.87 +        minios_list_add(&hdr->freelist, &freelist);
   15.88      }
   15.89  
   15.90      /* spin_unlock_irqrestore(&freelist_lock, flags); */
    16.1 --- a/extras/mini-os/sched.c	Mon Aug 11 10:59:39 2008 +0900
    16.2 +++ b/extras/mini-os/sched.c	Mon Aug 11 11:04:52 2008 +0900
    16.3 @@ -55,18 +55,18 @@
    16.4  #endif
    16.5  
    16.6  struct thread *idle_thread = NULL;
    16.7 -LIST_HEAD(exited_threads);
    16.8 +MINIOS_LIST_HEAD(exited_threads);
    16.9  static int threads_started;
   16.10  
   16.11  struct thread *main_thread;
   16.12  
   16.13  void inline print_runqueue(void)
   16.14  {
   16.15 -    struct list_head *it;
   16.16 +    struct minios_list_head *it;
   16.17      struct thread *th;
   16.18 -    list_for_each(it, &idle_thread->thread_list)
   16.19 +    minios_list_for_each(it, &idle_thread->thread_list)
   16.20      {
   16.21 -        th = list_entry(it, struct thread, thread_list);
   16.22 +        th = minios_list_entry(it, struct thread, thread_list);
   16.23          printk("   Thread \"%s\", runnable=%d\n", th->name, is_runnable(th));
   16.24      }
   16.25      printk("\n");
   16.26 @@ -75,7 +75,7 @@ void inline print_runqueue(void)
   16.27  void schedule(void)
   16.28  {
   16.29      struct thread *prev, *next, *thread;
   16.30 -    struct list_head *iterator, *next_iterator;
   16.31 +    struct minios_list_head *iterator, *next_iterator;
   16.32      unsigned long flags;
   16.33  
   16.34      prev = current;
   16.35 @@ -97,9 +97,9 @@ void schedule(void)
   16.36          s_time_t now = NOW();
   16.37          s_time_t min_wakeup_time = now + SECONDS(10);
   16.38          next = NULL;   
   16.39 -        list_for_each_safe(iterator, next_iterator, &idle_thread->thread_list)
   16.40 +        minios_list_for_each_safe(iterator, next_iterator, &idle_thread->thread_list)
   16.41          {
   16.42 -            thread = list_entry(iterator, struct thread, thread_list);
   16.43 +            thread = minios_list_entry(iterator, struct thread, thread_list);
   16.44              if (!is_runnable(thread) && thread->wakeup_time != 0LL)
   16.45              {
   16.46                  if (thread->wakeup_time <= now)
   16.47 @@ -111,8 +111,8 @@ void schedule(void)
   16.48              {
   16.49                  next = thread;
   16.50                  /* Put this thread on the end of the list */
   16.51 -                list_del(&thread->thread_list);
   16.52 -                list_add_tail(&thread->thread_list, &idle_thread->thread_list);
   16.53 +                minios_list_del(&thread->thread_list);
   16.54 +                minios_list_add_tail(&thread->thread_list, &idle_thread->thread_list);
   16.55                  break;
   16.56              }
   16.57          }
   16.58 @@ -128,12 +128,12 @@ void schedule(void)
   16.59         inturrupted at the return instruction. And therefore at safe point. */
   16.60      if(prev != next) switch_threads(prev, next);
   16.61  
   16.62 -    list_for_each_safe(iterator, next_iterator, &exited_threads)
   16.63 +    minios_list_for_each_safe(iterator, next_iterator, &exited_threads)
   16.64      {
   16.65 -        thread = list_entry(iterator, struct thread, thread_list);
   16.66 +        thread = minios_list_entry(iterator, struct thread, thread_list);
   16.67          if(thread != prev)
   16.68          {
   16.69 -            list_del(&thread->thread_list);
   16.70 +            minios_list_del(&thread->thread_list);
   16.71              free_pages(thread->stack, STACK_SIZE_PAGE_ORDER);
   16.72              xfree(thread);
   16.73          }
   16.74 @@ -155,7 +155,7 @@ struct thread* create_thread(char *name,
   16.75      set_runnable(thread);
   16.76      local_irq_save(flags);
   16.77      if(idle_thread != NULL) {
   16.78 -        list_add_tail(&thread->thread_list, &idle_thread->thread_list); 
   16.79 +        minios_list_add_tail(&thread->thread_list, &idle_thread->thread_list); 
   16.80      } else if(function != idle_thread_fn)
   16.81      {
   16.82          printk("BUG: Not allowed to create thread before initialising scheduler.\n");
   16.83 @@ -208,10 +208,10 @@ void exit_thread(void)
   16.84      printk("Thread \"%s\" exited.\n", thread->name);
   16.85      local_irq_save(flags);
   16.86      /* Remove from the thread list */
   16.87 -    list_del(&thread->thread_list);
   16.88 +    minios_list_del(&thread->thread_list);
   16.89      clear_runnable(thread);
   16.90      /* Put onto exited list */
   16.91 -    list_add(&thread->thread_list, &exited_threads);
   16.92 +    minios_list_add(&thread->thread_list, &exited_threads);
   16.93      local_irq_restore(flags);
   16.94      /* Schedule will free the resources */
   16.95      while(1)
   16.96 @@ -296,6 +296,6 @@ void init_sched(void)
   16.97      _REENT_INIT_PTR((&callback_reent))
   16.98  #endif
   16.99      idle_thread = create_thread("Idle", idle_thread_fn, NULL);
  16.100 -    INIT_LIST_HEAD(&idle_thread->thread_list);
  16.101 +    MINIOS_INIT_LIST_HEAD(&idle_thread->thread_list);
  16.102  }
  16.103  
    17.1 --- a/stubdom/newlib.patch	Mon Aug 11 10:59:39 2008 +0900
    17.2 +++ b/stubdom/newlib.patch	Mon Aug 11 11:04:52 2008 +0900
    17.3 @@ -627,3 +627,123 @@ diff -u -p -r1.1 memcpy.S
    17.4   
    17.5   #ifdef _I386MACH_NEED_SOTYPE_FUNCTION
    17.6   #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function
    17.7 +
    17.8 +
    17.9 +We want to have a 64bit offsets libc even on 32bit platforms.
   17.10 +
   17.11 +--- ./newlib/configure.host.orig	2008-08-07 16:01:17.801946000 +0100
   17.12 ++++ ./newlib/configure.host	2008-08-07 16:01:34.181064000 +0100
   17.13 +@@ -317,6 +317,8 @@
   17.14 +     oext=lo
   17.15 +     lpfx=
   17.16 +     aext=la ;;
   17.17 ++  i[34567]86-xen-elf)
   17.18 ++    stdio64_dir=stdio64 ;;
   17.19 +   *) ;; #shared library not supported for ${host}
   17.20 + esac
   17.21 + 
   17.22 +--- newlib/libc/include/sys/_types.h.orig	2008-08-07 15:22:44.925008000 +0100
   17.23 ++++ newlib/libc/include/sys/_types.h	2008-08-07 15:22:50.824044000 +0100
   17.24 +@@ -13,8 +13,12 @@
   17.25 + #include <sys/lock.h>
   17.26 + 
   17.27 + #ifndef __off_t_defined
   17.28 ++#ifdef __MINIOS__
   17.29 ++typedef long long _off_t;
   17.30 ++#else
   17.31 + typedef long _off_t;
   17.32 + #endif
   17.33 ++#endif
   17.34 + 
   17.35 + #if defined(__rtems__)
   17.36 + /* device numbers are 32-bit major and and 32-bit minor */
   17.37 +--- ./newlib/libc/include/sys/config.h.orig	2008-08-07 14:43:25.915866000 +0100
   17.38 ++++ ./newlib/libc/include/sys/config.h	2008-08-07 14:44:13.508154000 +0100
   17.39 +@@ -69,6 +69,10 @@
   17.40 + /* we use some glibc header files so turn on glibc large file feature */
   17.41 + #define _LARGEFILE64_SOURCE 1
   17.42 + #endif
   17.43 ++#ifdef __MINIOS__
   17.44 ++#define __LARGE64_FILES 1
   17.45 ++#define _LARGEFILE64_SOURCE 1
   17.46 ++#endif
   17.47 + #endif
   17.48 + 
   17.49 + #ifndef __DYNAMIC_REENT__
   17.50 +--- ./newlib/libc/include/sys/_default_fcntl.h.orig	2008-08-07 15:08:22.377836000 +0100
   17.51 ++++ ./newlib/libc/include/sys/_default_fcntl.h	2008-08-07 15:08:31.651890000 +0100
   17.52 +@@ -170,7 +170,11 @@
   17.53 + /* Provide _<systemcall> prototypes for functions provided by some versions
   17.54 +    of newlib.  */
   17.55 + #ifdef _COMPILING_NEWLIB
   17.56 +-extern int _open _PARAMS ((const char *, int, ...));
   17.57 ++extern int _open _PARAMS ((const char *, int, ...))
   17.58 ++#ifdef __MINIOS__
   17.59 ++    asm("open64")
   17.60 ++#endif
   17.61 ++    ;
   17.62 + extern int _fcntl _PARAMS ((int, int, ...));
   17.63 + #ifdef __LARGE64_FILES
   17.64 + extern int _open64 _PARAMS ((const char *, int, ...));
   17.65 +--- ./newlib/libc/include/sys/unistd.h.orig	2008-08-07 15:09:36.449280000 +0100
   17.66 ++++ ./newlib/libc/include/sys/unistd.h	2008-08-07 15:09:51.210370000 +0100
   17.67 +@@ -101,7 +101,11 @@
   17.68 + int     _EXFUN(link, (const char *__path1, const char *__path2 ));
   17.69 + int	_EXFUN(nice, (int __nice_value ));
   17.70 + #if !defined(__INSIDE_CYGWIN__)
   17.71 +-off_t   _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ));
   17.72 ++off_t   _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ))
   17.73 ++#ifdef __MINIOS__
   17.74 ++    asm("lseek64")
   17.75 ++#endif
   17.76 ++    ;
   17.77 + #endif
   17.78 + #if defined(__SPU__)
   17.79 + #define F_ULOCK	0
   17.80 +--- ./newlib/libc/include/sys/stat.h.orig	2008-08-07 16:08:50.495116000 +0100
   17.81 ++++ ./newlib/libc/include/sys/stat.h	2008-08-07 16:10:21.799753000 +0100
   17.82 +@@ -49,6 +49,9 @@
   17.83 +   long	st_spare4[2];
   17.84 + #endif
   17.85 + };
   17.86 ++#ifdef __MINIOS__
   17.87 ++#define stat64 stat
   17.88 ++#endif
   17.89 + #endif
   17.90 + 
   17.91 + #define	_IFMT		0170000	/* type of file */
   17.92 +@@ -132,7 +135,11 @@
   17.93 + /* Provide prototypes for most of the _<systemcall> names that are
   17.94 +    provided in newlib for some compilers.  */
   17.95 + #ifdef _COMPILING_NEWLIB
   17.96 +-int	_EXFUN(_fstat,( int __fd, struct stat *__sbuf ));
   17.97 ++int	_EXFUN(_fstat,( int __fd, struct stat *__sbuf ))
   17.98 ++#ifdef __MINIOS__
   17.99 ++    asm("fstat64")
  17.100 ++#endif
  17.101 ++    ;
  17.102 + int	_EXFUN(_stat,( const char *__path, struct stat *__sbuf ));
  17.103 + #ifdef __LARGE64_FILES
  17.104 + struct stat64;
  17.105 +--- ./newlib/libc/include/_syslist.h.orig	2008-08-07 16:24:19.122605000 +0100
  17.106 ++++ ./newlib/libc/include/_syslist.h	2008-08-07 16:24:21.548628000 +0100
  17.107 +@@ -14,6 +14,7 @@
  17.108 + #define _kill kill
  17.109 + #define _link link
  17.110 + #define _lseek lseek
  17.111 ++#define _lseek64 lseek64
  17.112 + #define _open open
  17.113 + #define _read read
  17.114 + #define _sbrk sbrk
  17.115 +--- newlib/libc/include/reent.h.orig	2008-08-07 16:28:49.846502000 +0100
  17.116 ++++ newlib/libc/include/reent.h	2008-08-07 16:29:02.096586000 +0100
  17.117 +@@ -87,6 +87,9 @@
  17.118 + #if defined(__CYGWIN__) && defined(_COMPILING_NEWLIB)
  17.119 + #define stat64 __stat64
  17.120 + #endif
  17.121 ++#if defined(__MINIOS__)
  17.122 ++#define stat64 stat
  17.123 ++#endif
  17.124 + 
  17.125 + struct stat64;
  17.126 + 
    18.1 --- a/tools/ioemu/audio/audio.c	Mon Aug 11 10:59:39 2008 +0900
    18.2 +++ b/tools/ioemu/audio/audio.c	Mon Aug 11 11:04:52 2008 +0900
    18.3 @@ -707,8 +707,8 @@ static void audio_detach_capture (HWVoic
    18.4              sw->rate = NULL;
    18.5          }
    18.6  
    18.7 -        QEMU_LIST_REMOVE (sw, entries);
    18.8 -        QEMU_LIST_REMOVE (sc, entries);
    18.9 +        LIST_REMOVE (sw, entries);
   18.10 +        LIST_REMOVE (sc, entries);
   18.11          qemu_free (sc);
   18.12          if (was_active) {
   18.13              /* We have removed soft voice from the capture:
   18.14 @@ -751,8 +751,8 @@ static int audio_attach_capture (AudioSt
   18.15              qemu_free (sw);
   18.16              return -1;
   18.17          }
   18.18 -        QEMU_LIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
   18.19 -        QEMU_LIST_INSERT_HEAD (&hw->cap_head, sc, entries);
   18.20 +        LIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
   18.21 +        LIST_INSERT_HEAD (&hw->cap_head, sc, entries);
   18.22  #ifdef DEBUG_CAPTURE
   18.23          asprintf (&sw->name, "for %p %d,%d,%d",
   18.24                    hw, sw->info.freq, sw->info.bits, sw->info.nchannels);
   18.25 @@ -1620,12 +1620,12 @@ void AUD_register_card (AudioState *s, c
   18.26      card->audio = s;
   18.27      card->name = qemu_strdup (name);
   18.28      memset (&card->entries, 0, sizeof (card->entries));
   18.29 -    QEMU_LIST_INSERT_HEAD (&s->card_head, card, entries);
   18.30 +    LIST_INSERT_HEAD (&s->card_head, card, entries);
   18.31  }
   18.32  
   18.33  void AUD_remove_card (QEMUSoundCard *card)
   18.34  {
   18.35 -    QEMU_LIST_REMOVE (card, entries);
   18.36 +    LIST_REMOVE (card, entries);
   18.37      card->audio = NULL;
   18.38      qemu_free (card->name);
   18.39  }
   18.40 @@ -1637,9 +1637,9 @@ AudioState *AUD_init (void)
   18.41      const char *drvname;
   18.42      AudioState *s = &glob_audio_state;
   18.43  
   18.44 -    QEMU_LIST_INIT (&s->hw_head_out);
   18.45 -    QEMU_LIST_INIT (&s->hw_head_in);
   18.46 -    QEMU_LIST_INIT (&s->cap_head);
   18.47 +    LIST_INIT (&s->hw_head_out);
   18.48 +    LIST_INIT (&s->hw_head_in);
   18.49 +    LIST_INIT (&s->cap_head);
   18.50      atexit (audio_atexit);
   18.51  
   18.52      s->ts = qemu_new_timer (vm_clock, audio_timer, s);
   18.53 @@ -1731,7 +1731,7 @@ AudioState *AUD_init (void)
   18.54          return NULL;
   18.55      }
   18.56  
   18.57 -    QEMU_LIST_INIT (&s->card_head);
   18.58 +    LIST_INIT (&s->card_head);
   18.59      register_savevm ("audio", 0, 1, audio_save, audio_load, s);
   18.60      qemu_mod_timer (s->ts, qemu_get_clock (vm_clock) + conf.period.ticks);
   18.61      return s;
   18.62 @@ -1769,7 +1769,7 @@ CaptureVoiceOut *AUD_add_capture (
   18.63  
   18.64      cap = audio_pcm_capture_find_specific (s, as);
   18.65      if (cap) {
   18.66 -        QEMU_LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
   18.67 +        LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
   18.68          return cap;
   18.69      }
   18.70      else {
   18.71 @@ -1784,8 +1784,8 @@ CaptureVoiceOut *AUD_add_capture (
   18.72          }
   18.73  
   18.74          hw = &cap->hw;
   18.75 -        QEMU_LIST_INIT (&hw->sw_head);
   18.76 -        QEMU_LIST_INIT (&cap->cb_head);
   18.77 +        LIST_INIT (&hw->sw_head);
   18.78 +        LIST_INIT (&cap->cb_head);
   18.79  
   18.80          /* XXX find a more elegant way */
   18.81          hw->samples = 4096 * 4;
   18.82 @@ -1813,8 +1813,8 @@ CaptureVoiceOut *AUD_add_capture (
   18.83              [hw->info.swap_endianness]
   18.84              [hw->info.bits == 16];
   18.85  
   18.86 -        QEMU_LIST_INSERT_HEAD (&s->cap_head, cap, entries);
   18.87 -        QEMU_LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
   18.88 +        LIST_INSERT_HEAD (&s->cap_head, cap, entries);
   18.89 +        LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
   18.90  
   18.91          hw = NULL;
   18.92          while ((hw = audio_pcm_hw_find_any_out (s, hw))) {
   18.93 @@ -1840,7 +1840,7 @@ void AUD_del_capture (CaptureVoiceOut *c
   18.94      for (cb = cap->cb_head.lh_first; cb; cb = cb->entries.le_next) {
   18.95          if (cb->opaque == cb_opaque) {
   18.96              cb->ops.destroy (cb_opaque);
   18.97 -            QEMU_LIST_REMOVE (cb, entries);
   18.98 +            LIST_REMOVE (cb, entries);
   18.99              qemu_free (cb);
  18.100  
  18.101              if (!cap->cb_head.lh_first) {
  18.102 @@ -1857,12 +1857,12 @@ void AUD_del_capture (CaptureVoiceOut *c
  18.103                          st_rate_stop (sw->rate);
  18.104                          sw->rate = NULL;
  18.105                      }
  18.106 -                    QEMU_LIST_REMOVE (sw, entries);
  18.107 -                    QEMU_LIST_REMOVE (sc, entries);
  18.108 +                    LIST_REMOVE (sw, entries);
  18.109 +                    LIST_REMOVE (sc, entries);
  18.110                      qemu_free (sc);
  18.111                      sw = sw1;
  18.112                  }
  18.113 -                QEMU_LIST_REMOVE (cap, entries);
  18.114 +                LIST_REMOVE (cap, entries);
  18.115                  qemu_free (cap);
  18.116              }
  18.117              return;
    19.1 --- a/tools/ioemu/audio/audio.h	Mon Aug 11 10:59:39 2008 +0900
    19.2 +++ b/tools/ioemu/audio/audio.h	Mon Aug 11 11:04:52 2008 +0900
    19.3 @@ -68,7 +68,7 @@ struct capture_ops {
    19.4  typedef struct CaptureState {
    19.5      void *opaque;
    19.6      struct capture_ops ops;
    19.7 -    QEMU_LIST_ENTRY (CaptureState) entries;
    19.8 +    LIST_ENTRY (CaptureState) entries;
    19.9  } CaptureState;
   19.10  
   19.11  typedef struct AudioState AudioState;
   19.12 @@ -79,7 +79,7 @@ typedef struct SWVoiceIn SWVoiceIn;
   19.13  typedef struct QEMUSoundCard {
   19.14      AudioState *audio;
   19.15      char *name;
   19.16 -    QEMU_LIST_ENTRY (QEMUSoundCard) entries;
   19.17 +    LIST_ENTRY (QEMUSoundCard) entries;
   19.18  } QEMUSoundCard;
   19.19  
   19.20  typedef struct QEMUAudioTimeStamp {
    20.1 --- a/tools/ioemu/audio/audio_int.h	Mon Aug 11 10:59:39 2008 +0900
    20.2 +++ b/tools/ioemu/audio/audio_int.h	Mon Aug 11 11:04:52 2008 +0900
    20.3 @@ -79,10 +79,10 @@ typedef struct HWVoiceOut {
    20.4      st_sample_t *mix_buf;
    20.5  
    20.6      int samples;
    20.7 -    QEMU_LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
    20.8 -    QEMU_LIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
    20.9 +    LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
   20.10 +    LIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
   20.11      struct audio_pcm_ops *pcm_ops;
   20.12 -    QEMU_LIST_ENTRY (HWVoiceOut) entries;
   20.13 +    LIST_ENTRY (HWVoiceOut) entries;
   20.14  } HWVoiceOut;
   20.15  
   20.16  typedef struct HWVoiceIn {
   20.17 @@ -98,9 +98,9 @@ typedef struct HWVoiceIn {
   20.18      st_sample_t *conv_buf;
   20.19  
   20.20      int samples;
   20.21 -    QEMU_LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
   20.22 +    LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
   20.23      struct audio_pcm_ops *pcm_ops;
   20.24 -    QEMU_LIST_ENTRY (HWVoiceIn) entries;
   20.25 +    LIST_ENTRY (HWVoiceIn) entries;
   20.26  } HWVoiceIn;
   20.27  
   20.28  struct SWVoiceOut {
   20.29 @@ -116,7 +116,7 @@ struct SWVoiceOut {
   20.30      char *name;
   20.31      volume_t vol;
   20.32      struct audio_callback callback;
   20.33 -    QEMU_LIST_ENTRY (SWVoiceOut) entries;
   20.34 +    LIST_ENTRY (SWVoiceOut) entries;
   20.35  };
   20.36  
   20.37  struct SWVoiceIn {
   20.38 @@ -131,7 +131,7 @@ struct SWVoiceIn {
   20.39      char *name;
   20.40      volume_t vol;
   20.41      struct audio_callback callback;
   20.42 -    QEMU_LIST_ENTRY (SWVoiceIn) entries;
   20.43 +    LIST_ENTRY (SWVoiceIn) entries;
   20.44  };
   20.45  
   20.46  struct audio_driver {
   20.47 @@ -165,20 +165,20 @@ struct audio_pcm_ops {
   20.48  struct capture_callback {
   20.49      struct audio_capture_ops ops;
   20.50      void *opaque;
   20.51 -    QEMU_LIST_ENTRY (capture_callback) entries;
   20.52 +    LIST_ENTRY (capture_callback) entries;
   20.53  };
   20.54  
   20.55  struct CaptureVoiceOut {
   20.56      HWVoiceOut hw;
   20.57      void *buf;
   20.58 -    QEMU_LIST_HEAD (cb_listhead, capture_callback) cb_head;
   20.59 -    QEMU_LIST_ENTRY (CaptureVoiceOut) entries;
   20.60 +    LIST_HEAD (cb_listhead, capture_callback) cb_head;
   20.61 +    LIST_ENTRY (CaptureVoiceOut) entries;
   20.62  };
   20.63  
   20.64  struct SWVoiceCap {
   20.65      SWVoiceOut sw;
   20.66      CaptureVoiceOut *cap;
   20.67 -    QEMU_LIST_ENTRY (SWVoiceCap) entries;
   20.68 +    LIST_ENTRY (SWVoiceCap) entries;
   20.69  };
   20.70  
   20.71  struct AudioState {
   20.72 @@ -186,10 +186,10 @@ struct AudioState {
   20.73      void *drv_opaque;
   20.74  
   20.75      QEMUTimer *ts;
   20.76 -    QEMU_LIST_HEAD (card_listhead, QEMUSoundCard) card_head;
   20.77 -    QEMU_LIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
   20.78 -    QEMU_LIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
   20.79 -    QEMU_LIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
   20.80 +    LIST_HEAD (card_listhead, QEMUSoundCard) card_head;
   20.81 +    LIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
   20.82 +    LIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
   20.83 +    LIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
   20.84      int nb_hw_voices_out;
   20.85      int nb_hw_voices_in;
   20.86  };
    21.1 --- a/tools/ioemu/audio/audio_template.h	Mon Aug 11 10:59:39 2008 +0900
    21.2 +++ b/tools/ioemu/audio/audio_template.h	Mon Aug 11 11:04:52 2008 +0900
    21.3 @@ -186,12 +186,12 @@ static void glue (audio_pcm_sw_fini_, TY
    21.4  
    21.5  static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw)
    21.6  {
    21.7 -    QEMU_LIST_INSERT_HEAD (&hw->sw_head, sw, entries);
    21.8 +    LIST_INSERT_HEAD (&hw->sw_head, sw, entries);
    21.9  }
   21.10  
   21.11  static void glue (audio_pcm_hw_del_sw_, TYPE) (SW *sw)
   21.12  {
   21.13 -    QEMU_LIST_REMOVE (sw, entries);
   21.14 +    LIST_REMOVE (sw, entries);
   21.15  }
   21.16  
   21.17  static void glue (audio_pcm_hw_gc_, TYPE) (AudioState *s, HW **hwp)
   21.18 @@ -202,7 +202,7 @@ static void glue (audio_pcm_hw_gc_, TYPE
   21.19  #ifdef DAC
   21.20          audio_detach_capture (hw);
   21.21  #endif
   21.22 -        QEMU_LIST_REMOVE (hw, entries);
   21.23 +        LIST_REMOVE (hw, entries);
   21.24          glue (s->nb_hw_voices_, TYPE) += 1;
   21.25          glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
   21.26          glue (hw->pcm_ops->fini_, TYPE) (hw);
   21.27 @@ -267,9 +267,9 @@ static HW *glue (audio_pcm_hw_add_new_, 
   21.28      }
   21.29  
   21.30      hw->pcm_ops = drv->pcm_ops;
   21.31 -    QEMU_LIST_INIT (&hw->sw_head);
   21.32 +    LIST_INIT (&hw->sw_head);
   21.33  #ifdef DAC
   21.34 -    QEMU_LIST_INIT (&hw->cap_head);
   21.35 +    LIST_INIT (&hw->cap_head);
   21.36  #endif
   21.37      if (glue (hw->pcm_ops->init_, TYPE) (hw, as)) {
   21.38          goto err0;
   21.39 @@ -294,7 +294,7 @@ static HW *glue (audio_pcm_hw_add_new_, 
   21.40          goto err1;
   21.41      }
   21.42  
   21.43 -    QEMU_LIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
   21.44 +    LIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
   21.45      glue (s->nb_hw_voices_, TYPE) -= 1;
   21.46  #ifdef DAC
   21.47      audio_attach_capture (s, hw);
    22.1 --- a/tools/ioemu/audio/sys-queue.h	Mon Aug 11 10:59:39 2008 +0900
    22.2 +++ b/tools/ioemu/audio/sys-queue.h	Mon Aug 11 11:04:52 2008 +0900
    22.3 @@ -64,12 +64,12 @@
    22.4  /*
    22.5   * List definitions.
    22.6   */
    22.7 -#define QEMU_LIST_HEAD(name, type)					\
    22.8 +#define LIST_HEAD(name, type)					\
    22.9  struct name {								\
   22.10  	struct type *lh_first;	/* first element */			\
   22.11  }
   22.12  
   22.13 -#define QEMU_LIST_ENTRY(type)						\
   22.14 +#define LIST_ENTRY(type)						\
   22.15  struct {								\
   22.16  	struct type *le_next;	/* next element */			\
   22.17  	struct type **le_prev;	/* address of previous next element */	\
   22.18 @@ -78,11 +78,11 @@ struct {								\
   22.19  /*
   22.20   * List functions.
   22.21   */
   22.22 -#define	QEMU_LIST_INIT(head) {						\
   22.23 +#define	LIST_INIT(head) {						\
   22.24  	(head)->lh_first = NULL;					\
   22.25  }
   22.26  
   22.27 -#define QEMU_LIST_INSERT_AFTER(listelm, elm, field) {			\
   22.28 +#define LIST_INSERT_AFTER(listelm, elm, field) {			\
   22.29  	if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)	\
   22.30  		(listelm)->field.le_next->field.le_prev =		\
   22.31  		    &(elm)->field.le_next;				\
   22.32 @@ -90,14 +90,14 @@ struct {								\
   22.33  	(elm)->field.le_prev = &(listelm)->field.le_next;		\
   22.34  }
   22.35  
   22.36 -#define QEMU_LIST_INSERT_HEAD(head, elm, field) {			\
   22.37 +#define LIST_INSERT_HEAD(head, elm, field) {			\
   22.38  	if (((elm)->field.le_next = (head)->lh_first) != NULL)		\
   22.39  		(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
   22.40  	(head)->lh_first = (elm);					\
   22.41  	(elm)->field.le_prev = &(head)->lh_first;			\
   22.42  }
   22.43  
   22.44 -#define QEMU_LIST_REMOVE(elm, field) {					\
   22.45 +#define LIST_REMOVE(elm, field) {					\
   22.46  	if ((elm)->field.le_next != NULL)				\
   22.47  		(elm)->field.le_next->field.le_prev = 			\
   22.48  		    (elm)->field.le_prev;				\
    23.1 --- a/tools/ioemu/block-vbd.c	Mon Aug 11 10:59:39 2008 +0900
    23.2 +++ b/tools/ioemu/block-vbd.c	Mon Aug 11 11:04:52 2008 +0900
    23.3 @@ -50,10 +50,10 @@ typedef struct BDRVVbdState {
    23.4      struct blkfront_dev *dev;
    23.5      int fd;
    23.6      struct blkfront_info info;
    23.7 -    QEMU_LIST_ENTRY(BDRVVbdState) list;
    23.8 +    LIST_ENTRY(BDRVVbdState) list;
    23.9  } BDRVVbdState;
   23.10  
   23.11 -QEMU_LIST_HEAD(, BDRVVbdState) vbds;
   23.12 +LIST_HEAD(, BDRVVbdState) vbds;
   23.13  
   23.14  static int vbd_probe(const uint8_t *buf, int buf_size, const char *filename)
   23.15  {
   23.16 @@ -90,7 +90,7 @@ static int vbd_open(BlockDriverState *bs
   23.17      s->fd = blkfront_open(s->dev);
   23.18      qemu_set_fd_handler(s->fd, vbd_io_completed, NULL, s);
   23.19  
   23.20 -    QEMU_LIST_INSERT_HEAD(&vbds, s, list);
   23.21 +    LIST_INSERT_HEAD(&vbds, s, list);
   23.22  
   23.23      return 0;
   23.24  }
   23.25 @@ -302,7 +302,7 @@ static void vbd_close(BlockDriverState *
   23.26          close(s->fd);
   23.27          s->fd = -1;
   23.28      }
   23.29 -    QEMU_LIST_REMOVE(s, list);
   23.30 +    LIST_REMOVE(s, list);
   23.31  }
   23.32  
   23.33  static int64_t  vbd_getlength(BlockDriverState *bs)
    24.1 --- a/tools/ioemu/hw/pass-through.c	Mon Aug 11 10:59:39 2008 +0900
    24.2 +++ b/tools/ioemu/hw/pass-through.c	Mon Aug 11 11:04:52 2008 +0900
    24.3 @@ -1644,7 +1644,7 @@ static int pt_config_reg_init(struct pt_
    24.4          reg_entry->data = data;
    24.5      }
    24.6      /* list add register entry */
    24.7 -    QEMU_LIST_INSERT_HEAD(&reg_grp->reg_tbl_head, reg_entry, entries);
    24.8 +    LIST_INSERT_HEAD(&reg_grp->reg_tbl_head, reg_entry, entries);
    24.9  
   24.10  out:
   24.11      return err;
   24.12 @@ -1659,7 +1659,7 @@ static int pt_config_init(struct pt_dev 
   24.13      int i, j, err = 0;
   24.14  
   24.15      /* initialize register group list */
   24.16 -    QEMU_LIST_INIT(&ptdev->reg_grp_tbl_head);
   24.17 +    LIST_INIT(&ptdev->reg_grp_tbl_head);
   24.18  
   24.19      /* initialize register group */
   24.20      for (i=0; pt_emu_reg_grp_tbl[i].grp_size != 0; i++)
   24.21 @@ -1682,12 +1682,12 @@ static int pt_config_init(struct pt_dev 
   24.22          }
   24.23  
   24.24          /* initialize register group entry */
   24.25 -        QEMU_LIST_INIT(&reg_grp_entry->reg_tbl_head);
   24.26 +        LIST_INIT(&reg_grp_entry->reg_tbl_head);
   24.27  
   24.28          /* need to declare here, to enable searching Cap Ptr reg 
   24.29           * (which is in the same reg group) when initializing Status reg 
   24.30           */
   24.31 -        QEMU_LIST_INSERT_HEAD(&ptdev->reg_grp_tbl_head, reg_grp_entry, entries);
   24.32 +        LIST_INSERT_HEAD(&ptdev->reg_grp_tbl_head, reg_grp_entry, entries);
   24.33  
   24.34          reg_grp_entry->base_offset = reg_grp_offset;
   24.35          reg_grp_entry->reg_grp = 
   24.36 @@ -1740,11 +1740,11 @@ static void pt_config_delete(struct pt_d
   24.37          /* free all register entry */
   24.38          while ((reg_entry = reg_grp_entry->reg_tbl_head.lh_first) != NULL)
   24.39          {
   24.40 -            QEMU_LIST_REMOVE(reg_entry, entries);
   24.41 +            LIST_REMOVE(reg_entry, entries);
   24.42              qemu_free(reg_entry);
   24.43          }
   24.44  
   24.45 -        QEMU_LIST_REMOVE(reg_grp_entry, entries);
   24.46 +        LIST_REMOVE(reg_grp_entry, entries);
   24.47          qemu_free(reg_grp_entry);
   24.48      }
   24.49  }
    25.1 --- a/tools/ioemu/hw/pass-through.h	Mon Aug 11 10:59:39 2008 +0900
    25.2 +++ b/tools/ioemu/hw/pass-through.h	Mon Aug 11 11:04:52 2008 +0900
    25.3 @@ -136,7 +136,7 @@ struct pt_dev {
    25.4      PCIDevice dev;
    25.5      struct pci_dev *pci_dev;                    /* libpci struct */
    25.6      struct pt_region bases[PCI_NUM_REGIONS];    /* Access regions */
    25.7 -    QEMU_LIST_HEAD (reg_grp_tbl_listhead, pt_reg_grp_tbl) reg_grp_tbl_head;
    25.8 +    LIST_HEAD (reg_grp_tbl_listhead, pt_reg_grp_tbl) reg_grp_tbl_head;
    25.9                                                  /* emul reg group list */
   25.10      struct pt_msi_info *msi;                    /* MSI virtualization */
   25.11      struct pt_msix_info *msix;                  /* MSI-X virtualization */
   25.12 @@ -163,7 +163,7 @@ int pt_init(PCIBus * e_bus, char * direc
   25.13  /* emul reg group management table */
   25.14  struct pt_reg_grp_tbl {
   25.15      /* emul reg group list */
   25.16 -    QEMU_LIST_ENTRY (pt_reg_grp_tbl) entries;
   25.17 +    LIST_ENTRY (pt_reg_grp_tbl) entries;
   25.18      /* emul reg group info table */
   25.19      struct pt_reg_grp_info_tbl *reg_grp;
   25.20      /* emul reg group base offset */
   25.21 @@ -171,7 +171,7 @@ struct pt_reg_grp_tbl {
   25.22      /* emul reg group size */
   25.23      uint8_t size;
   25.24      /* emul reg management table list */
   25.25 -    QEMU_LIST_HEAD (reg_tbl_listhead, pt_reg_tbl) reg_tbl_head;
   25.26 +    LIST_HEAD (reg_tbl_listhead, pt_reg_tbl) reg_tbl_head;
   25.27  };
   25.28  
   25.29  /* emul reg group size initialize method */
   25.30 @@ -195,7 +195,7 @@ struct pt_reg_grp_info_tbl {
   25.31  /* emul reg management table */
   25.32  struct pt_reg_tbl {
   25.33      /* emul reg table list */
   25.34 -    QEMU_LIST_ENTRY (pt_reg_tbl) entries;
   25.35 +    LIST_ENTRY (pt_reg_tbl) entries;
   25.36      /* emul reg info table */
   25.37      struct pt_reg_info_tbl *reg;
   25.38      /* emul reg value */
    26.1 --- a/tools/ioemu/hw/serial.c	Mon Aug 11 10:59:39 2008 +0900
    26.2 +++ b/tools/ioemu/hw/serial.c	Mon Aug 11 11:04:52 2008 +0900
    26.3 @@ -211,7 +211,7 @@ static void serial_update_irq(SerialStat
    26.4      } else if ( s->timeout_ipending ) {
    26.5          tmp_iir = UART_IIR_CTI;
    26.6      } else if ( ( s->ier & UART_IER_RDI ) && (s->lsr & UART_LSR_DR ) ) {
    26.7 -        if ( !(s->iir & UART_FCR_FE) ) {
    26.8 +        if ( !(s->fcr & UART_FCR_FE) ) {
    26.9             tmp_iir = UART_IIR_RDI;
   26.10          } else if ( s->recv_fifo.count >= s->recv_fifo.itl ) {
   26.11             tmp_iir = UART_IIR_RDI;
    27.1 --- a/tools/ioemu/monitor.c	Mon Aug 11 10:59:39 2008 +0900
    27.2 +++ b/tools/ioemu/monitor.c	Mon Aug 11 11:04:52 2008 +0900
    27.3 @@ -1167,7 +1167,7 @@ static void do_info_profile(void)
    27.4  #endif
    27.5  
    27.6  /* Capture support */
    27.7 -static QEMU_LIST_HEAD (capture_list_head, CaptureState) capture_head;
    27.8 +static LIST_HEAD (capture_list_head, CaptureState) capture_head;
    27.9  
   27.10  static void do_info_capture (void)
   27.11  {
   27.12 @@ -1188,7 +1188,7 @@ static void do_stop_capture (int n)
   27.13      for (s = capture_head.lh_first, i = 0; s; s = s->entries.le_next, ++i) {
   27.14          if (i == n) {
   27.15              s->ops.destroy (s->opaque);
   27.16 -            QEMU_LIST_REMOVE (s, entries);
   27.17 +            LIST_REMOVE (s, entries);
   27.18              qemu_free (s);
   27.19              return;
   27.20          }
   27.21 @@ -1220,7 +1220,7 @@ static void do_wav_capture (const char *
   27.22          term_printf ("Faied to add wave capture\n");
   27.23          qemu_free (s);
   27.24      }
   27.25 -    QEMU_LIST_INSERT_HEAD (&capture_head, s, entries);
   27.26 +    LIST_INSERT_HEAD (&capture_head, s, entries);
   27.27  }
   27.28  #endif
   27.29  
    28.1 --- a/tools/ioemu/vl.c	Mon Aug 11 10:59:39 2008 +0900
    28.2 +++ b/tools/ioemu/vl.c	Mon Aug 11 11:04:52 2008 +0900
    28.3 @@ -6155,10 +6155,10 @@ void gui_update(void *opaque)
    28.4  struct vm_change_state_entry {
    28.5      VMChangeStateHandler *cb;
    28.6      void *opaque;
    28.7 -    QEMU_LIST_ENTRY (vm_change_state_entry) entries;
    28.8 +    LIST_ENTRY (vm_change_state_entry) entries;
    28.9  };
   28.10  
   28.11 -static QEMU_LIST_HEAD(vm_change_state_head, vm_change_state_entry) vm_change_state_head;
   28.12 +static LIST_HEAD(vm_change_state_head, vm_change_state_entry) vm_change_state_head;
   28.13  
   28.14  VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
   28.15                                                       void *opaque)
   28.16 @@ -6171,13 +6171,13 @@ VMChangeStateEntry *qemu_add_vm_change_s
   28.17  
   28.18      e->cb = cb;
   28.19      e->opaque = opaque;
   28.20 -    QEMU_LIST_INSERT_HEAD(&vm_change_state_head, e, entries);
   28.21 +    LIST_INSERT_HEAD(&vm_change_state_head, e, entries);
   28.22      return e;
   28.23  }
   28.24  
   28.25  void qemu_del_vm_change_state_handler(VMChangeStateEntry *e)
   28.26  {
   28.27 -    QEMU_LIST_REMOVE (e, entries);
   28.28 +    LIST_REMOVE (e, entries);
   28.29      qemu_free (e);
   28.30  }
   28.31  
   28.32 @@ -7138,7 +7138,7 @@ int main(int argc, char **argv)
   28.33      }
   28.34  #endif
   28.35  
   28.36 -    QEMU_LIST_INIT (&vm_change_state_head);
   28.37 +    LIST_INIT (&vm_change_state_head);
   28.38  #ifndef CONFIG_STUBDOM
   28.39  #ifndef _WIN32
   28.40      {
    29.1 --- a/tools/python/xen/xend/server/pciif.py	Mon Aug 11 10:59:39 2008 +0900
    29.2 +++ b/tools/python/xen/xend/server/pciif.py	Mon Aug 11 11:04:52 2008 +0900
    29.3 @@ -21,6 +21,7 @@ import types
    29.4  import time
    29.5  
    29.6  from xen.xend import sxp
    29.7 +from xen.xend import arch
    29.8  from xen.xend.XendError import VmError
    29.9  from xen.xend.XendLogging import log
   29.10  
   29.11 @@ -284,12 +285,13 @@ class PciController(DevController):
   29.12                      "bind your slot/device to the PCI backend using sysfs" \
   29.13                      )%(dev.name))
   29.14  
   29.15 -        if dev.has_non_page_aligned_bar:
   29.16 +        if dev.has_non_page_aligned_bar and arch.type != "ia64":
   29.17              raise VmError("pci: %: non-page-aligned MMIO BAR found." % dev.name)
   29.18  
   29.19          self.CheckSiblingDevices(fe_domid, dev)
   29.20  
   29.21 -        dev.do_FLR()
   29.22 +        if arch.type != "ia64":
   29.23 +            dev.do_FLR()
   29.24  
   29.25          PCIQuirk(dev.vendor, dev.device, dev.subvendor, dev.subdevice, domain, 
   29.26                  bus, slot, func)
   29.27 @@ -395,7 +397,7 @@ class PciController(DevController):
   29.28                                      ' the same guest with %s'
   29.29                                  raise VmError(err_msg % (f, dev.name))
   29.30              elif dev.dev_type == DEV_TYPE_PCI:
   29.31 -                if dev.bus == 0:
   29.32 +                if dev.bus == 0 or arch.type == "ia64":
   29.33                      if not dev.pci_af_flr:
   29.34                          # We cope with this case by using the Dstate transition
   29.35                          # method for now.
    30.1 --- a/tools/python/xen/xm/create.py	Mon Aug 11 10:59:39 2008 +0900
    30.2 +++ b/tools/python/xen/xm/create.py	Mon Aug 11 11:04:52 2008 +0900
    30.3 @@ -279,7 +279,7 @@ gopts.var('on_reboot', val='destroy|rest
    30.4                              renamed and a new domain started in its place.
    30.5            """)
    30.6  
    30.7 -gopts.var('on_crash', val='destroy|restart|preserve|rename-restart|coredump-destroy|ciredump-restart',
    30.8 +gopts.var('on_crash', val='destroy|restart|preserve|rename-restart|coredump-destroy|coredump-restart',
    30.9            fn=set_value, default=None,
   30.10            use="""Behaviour when a domain exits with reason 'crash'.
   30.11            - destroy:          the domain is cleaned up as normal;
    31.1 --- a/unmodified_drivers/linux-2.6/README	Mon Aug 11 10:59:39 2008 +0900
    31.2 +++ b/unmodified_drivers/linux-2.6/README	Mon Aug 11 11:04:52 2008 +0900
    31.3 @@ -1,13 +1,15 @@
    31.4  To build:
    31.5  
    31.6 -1. ./mkbuildtree
    31.7 +1. ./mkbuildtree [<arch>]
    31.8     NB. You can override paths to Xen sources and a (stub) XenLinux
    31.9         build tree via the XEN and XL environment variable.
   31.10  
   31.11  2. make -C /path/to/kernel/build M=$PWD modules
   31.12     NB. This is your native kernel build tree (or a distro provided
   31.13         stub), not the XenLinux sources referred to in step 1.
   31.14 +   NB. If you are cross compiling, you need to set ARCH and
   31.15 +       CROSS_COMPILE too.
   31.16  
   31.17 -You get four modules, xen-platform-pci.ko, xenbus.ko, xen-vbd.ko, and
   31.18 -xen-vnif.ko.  Load xen-platform-pci first, then xenbus, and then
   31.19 -whichever of xen-vbd and xen-vnif you happen to need.
   31.20 +You get four modules, xen-platform-pci.ko, xen-vbd.ko, xen-vnif.ko and
   31.21 +xen-balloon.ko.  Load xen-platform-pci first, and then
   31.22 +whichever of xen-vbd, xen-vnif and xen-balloon.ko you happen to need.
    32.1 --- a/xen/Makefile	Mon Aug 11 10:59:39 2008 +0900
    32.2 +++ b/xen/Makefile	Mon Aug 11 11:04:52 2008 +0900
    32.3 @@ -1,8 +1,8 @@
    32.4  # This is the correct place to edit the build version.
    32.5  # All other places this is stored (eg. compile.h) should be autogenerated.
    32.6 -export XEN_VERSION       = 4
    32.7 -export XEN_SUBVERSION    = 0
    32.8 -export XEN_EXTRAVERSION ?= .0-rc3-pre$(XEN_VENDORVERSION)
    32.9 +export XEN_VERSION       = 3
   32.10 +export XEN_SUBVERSION    = 3
   32.11 +export XEN_EXTRAVERSION ?= .0-rc4-pre$(XEN_VENDORVERSION)
   32.12  export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
   32.13  -include xen-version
   32.14  
    33.1 --- a/xen/arch/x86/domain_build.c	Mon Aug 11 10:59:39 2008 +0900
    33.2 +++ b/xen/arch/x86/domain_build.c	Mon Aug 11 11:04:52 2008 +0900
    33.3 @@ -704,16 +704,12 @@ int __init construct_dom0(
    33.4  
    33.5      if ( opt_dom0_max_vcpus == 0 )
    33.6          opt_dom0_max_vcpus = num_online_cpus();
    33.7 -    if ( opt_dom0_max_vcpus > num_online_cpus() )
    33.8 -        opt_dom0_max_vcpus = num_online_cpus();
    33.9      if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
   33.10          opt_dom0_max_vcpus = MAX_VIRT_CPUS;
   33.11 -    if ( opt_dom0_max_vcpus > BITS_PER_GUEST_LONG(d) )
   33.12 -        opt_dom0_max_vcpus = BITS_PER_GUEST_LONG(d);
   33.13      printk("Dom0 has maximum %u VCPUs\n", opt_dom0_max_vcpus);
   33.14  
   33.15      for ( i = 1; i < opt_dom0_max_vcpus; i++ )
   33.16 -        (void)alloc_vcpu(d, i, i);
   33.17 +        (void)alloc_vcpu(d, i, i % num_online_cpus());
   33.18  
   33.19      /* Set up CR3 value for write_ptbase */
   33.20      if ( paging_mode_enabled(v->domain) )
    34.1 --- a/xen/arch/x86/mm.c	Mon Aug 11 10:59:39 2008 +0900
    34.2 +++ b/xen/arch/x86/mm.c	Mon Aug 11 11:04:52 2008 +0900
    34.3 @@ -2218,6 +2218,12 @@ static inline cpumask_t vcpumask_to_pcpu
    34.4      cpumask_t    pmask = CPU_MASK_NONE;
    34.5      struct vcpu *v;
    34.6  
    34.7 +    /*
    34.8 +     * Callers copy only a single guest-sized longword from the guest.
    34.9 +     * This must be wide enough to reference all VCPUs. Worst case is 32 bits.
   34.10 +     */
   34.11 +    BUILD_BUG_ON(MAX_VIRT_CPUS > 32);
   34.12 +
   34.13      while ( vmask != 0 )
   34.14      {
   34.15          vcpu_id = find_first_set_bit(vmask);
    35.1 --- a/xen/arch/x86/time.c	Mon Aug 11 10:59:39 2008 +0900
    35.2 +++ b/xen/arch/x86/time.c	Mon Aug 11 11:04:52 2008 +0900
    35.3 @@ -802,6 +802,8 @@ int cpu_frequency_change(u64 freq)
    35.4      set_time_scale(&t->tsc_scale, freq);
    35.5      local_irq_enable();
    35.6  
    35.7 +    update_vcpu_system_time(current);
    35.8 +
    35.9      /* A full epoch should pass before we check for deviation. */
   35.10      if ( smp_processor_id() == 0 )
   35.11      {
    36.1 --- a/xen/arch/x86/x86_32/traps.c	Mon Aug 11 10:59:39 2008 +0900
    36.2 +++ b/xen/arch/x86/x86_32/traps.c	Mon Aug 11 11:04:52 2008 +0900
    36.3 @@ -32,14 +32,26 @@ static void print_xen_info(void)
    36.4             arch, debug, print_tainted(taint_str));
    36.5  }
    36.6  
    36.7 -static void _show_registers(const struct cpu_user_regs *regs,
    36.8 -                            unsigned long crs[8], int guest_mode,
    36.9 -                            const char *context)
   36.10 +enum context { CTXT_hypervisor, CTXT_pv_guest, CTXT_hvm_guest };
   36.11 +
   36.12 +static void _show_registers(
   36.13 +    const struct cpu_user_regs *regs, unsigned long crs[8],
   36.14 +    enum context context, const struct vcpu *v)
   36.15  {
   36.16 +    const static char *context_names[] = {
   36.17 +        [CTXT_hypervisor] = "hypervisor",
   36.18 +        [CTXT_pv_guest]   = "pv guest",
   36.19 +        [CTXT_hvm_guest]  = "hvm guest"
   36.20 +    };
   36.21 +
   36.22      printk("EIP:    %04x:[<%08x>]", regs->cs, regs->eip);
   36.23 -    if ( !guest_mode )
   36.24 +    if ( context == CTXT_hypervisor )
   36.25          print_symbol(" %s", regs->eip);
   36.26 -    printk("\nEFLAGS: %08x   CONTEXT: %s\n", regs->eflags, context);
   36.27 +    printk("\nEFLAGS: %08x   ", regs->eflags);
   36.28 +    if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
   36.29 +        printk("EM: %d   ", !!v->vcpu_info->evtchn_upcall_mask);
   36.30 +    printk("CONTEXT: %s\n", context_names[context]);
   36.31 +
   36.32      printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
   36.33             regs->eax, regs->ebx, regs->ecx, regs->edx);
   36.34      printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08x\n",
   36.35 @@ -56,13 +68,13 @@ void show_registers(struct cpu_user_regs
   36.36  {
   36.37      struct cpu_user_regs fault_regs = *regs;
   36.38      unsigned long fault_crs[8];
   36.39 -    const char *context;
   36.40 +    enum context context;
   36.41      struct vcpu *v = current;
   36.42  
   36.43      if ( is_hvm_vcpu(v) && guest_mode(regs) )
   36.44      {
   36.45          struct segment_register sreg;
   36.46 -        context = "hvm";
   36.47 +        context = CTXT_hvm_guest;
   36.48          fault_crs[0] = v->arch.hvm_vcpu.guest_cr[0];
   36.49          fault_crs[2] = v->arch.hvm_vcpu.guest_cr[2];
   36.50          fault_crs[3] = v->arch.hvm_vcpu.guest_cr[3];
   36.51 @@ -84,7 +96,7 @@ void show_registers(struct cpu_user_regs
   36.52      {
   36.53          if ( !guest_mode(regs) )
   36.54          {
   36.55 -            context = "hypervisor";
   36.56 +            context = CTXT_hypervisor;
   36.57              fault_regs.esp = (unsigned long)&regs->esp;
   36.58              fault_regs.ss = read_segment_register(ss);
   36.59              fault_regs.ds = read_segment_register(ds);
   36.60 @@ -95,7 +107,7 @@ void show_registers(struct cpu_user_regs
   36.61          }
   36.62          else
   36.63          {
   36.64 -            context = "guest";
   36.65 +            context = CTXT_pv_guest;
   36.66              fault_crs[2] = v->vcpu_info->arch.cr2;
   36.67          }
   36.68  
   36.69 @@ -106,7 +118,7 @@ void show_registers(struct cpu_user_regs
   36.70  
   36.71      print_xen_info();
   36.72      printk("CPU:    %d\n", smp_processor_id());
   36.73 -    _show_registers(&fault_regs, fault_crs, guest_mode(regs), context);
   36.74 +    _show_registers(&fault_regs, fault_crs, context, v);
   36.75  
   36.76      if ( this_cpu(ler_msr) && !guest_mode(regs) )
   36.77      {
   36.78 @@ -130,7 +142,7 @@ void vcpu_show_registers(const struct vc
   36.79      crs[3] = pagetable_get_paddr(v->arch.guest_table);
   36.80      crs[4] = v->arch.guest_context.ctrlreg[4];
   36.81  
   36.82 -    _show_registers(&v->arch.guest_context.user_regs, crs, 1, "guest");
   36.83 +    _show_registers(&v->arch.guest_context.user_regs, crs, CTXT_pv_guest, v);
   36.84  }
   36.85  
   36.86  void show_page_walk(unsigned long addr)
    37.1 --- a/xen/arch/x86/x86_64/traps.c	Mon Aug 11 10:59:39 2008 +0900
    37.2 +++ b/xen/arch/x86/x86_64/traps.c	Mon Aug 11 11:04:52 2008 +0900
    37.3 @@ -40,14 +40,26 @@ static void print_xen_info(void)
    37.4             debug, print_tainted(taint_str));
    37.5  }
    37.6  
    37.7 -static void _show_registers(const struct cpu_user_regs *regs,
    37.8 -                            unsigned long crs[8], int guest_mode,
    37.9 -                            const char *context)
   37.10 +enum context { CTXT_hypervisor, CTXT_pv_guest, CTXT_hvm_guest };
   37.11 +
   37.12 +static void _show_registers(
   37.13 +    const struct cpu_user_regs *regs, unsigned long crs[8],
   37.14 +    enum context context, const struct vcpu *v)
   37.15  {
   37.16 +    const static char *context_names[] = {
   37.17 +        [CTXT_hypervisor] = "hypervisor",
   37.18 +        [CTXT_pv_guest]   = "pv guest",
   37.19 +        [CTXT_hvm_guest]  = "hvm guest"
   37.20 +    };
   37.21 +
   37.22      printk("RIP:    %04x:[<%016lx>]", regs->cs, regs->rip);
   37.23 -    if ( !guest_mode )
   37.24 +    if ( context == CTXT_hypervisor )
   37.25          print_symbol(" %s", regs->rip);
   37.26 -    printk("\nRFLAGS: %016lx   CONTEXT: %s\n", regs->rflags, context);
   37.27 +    printk("\nRFLAGS: %016lx   ", regs->rflags);
   37.28 +    if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
   37.29 +        printk("EM: %d   ", !!vcpu_info(v, evtchn_upcall_mask));
   37.30 +    printk("CONTEXT: %s\n", context_names[context]);
   37.31 +
   37.32      printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
   37.33             regs->rax, regs->rbx, regs->rcx);
   37.34      printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
   37.35 @@ -71,13 +83,13 @@ void show_registers(struct cpu_user_regs
   37.36  {
   37.37      struct cpu_user_regs fault_regs = *regs;
   37.38      unsigned long fault_crs[8];
   37.39 -    const char *context;
   37.40 +    enum context context;
   37.41      struct vcpu *v = current;
   37.42  
   37.43      if ( is_hvm_vcpu(v) && guest_mode(regs) )
   37.44      {
   37.45          struct segment_register sreg;
   37.46 -        context = "hvm";
   37.47 +        context = CTXT_hvm_guest;
   37.48          fault_crs[0] = v->arch.hvm_vcpu.guest_cr[0];
   37.49          fault_crs[2] = v->arch.hvm_vcpu.guest_cr[2];
   37.50          fault_crs[3] = v->arch.hvm_vcpu.guest_cr[3];
   37.51 @@ -99,12 +111,12 @@ void show_registers(struct cpu_user_regs
   37.52      {
   37.53          if ( guest_mode(regs) )
   37.54          {
   37.55 -            context = "guest";
   37.56 +            context = CTXT_pv_guest;
   37.57              fault_crs[2] = arch_get_cr2(v);
   37.58          }
   37.59          else
   37.60          {
   37.61 -            context = "hypervisor";
   37.62 +            context = CTXT_hypervisor;
   37.63              fault_crs[2] = read_cr2();
   37.64          }
   37.65  
   37.66 @@ -119,7 +131,7 @@ void show_registers(struct cpu_user_regs
   37.67  
   37.68      print_xen_info();
   37.69      printk("CPU:    %d\n", smp_processor_id());
   37.70 -    _show_registers(&fault_regs, fault_crs, guest_mode(regs), context);
   37.71 +    _show_registers(&fault_regs, fault_crs, context, v);
   37.72  
   37.73      if ( this_cpu(ler_msr) && !guest_mode(regs) )
   37.74      {
   37.75 @@ -146,7 +158,7 @@ void vcpu_show_registers(const struct vc
   37.76                                   v->arch.guest_table_user);
   37.77      crs[4] = v->arch.guest_context.ctrlreg[4];
   37.78  
   37.79 -    _show_registers(regs, crs, 1, "guest");
   37.80 +    _show_registers(regs, crs, CTXT_pv_guest, v);
   37.81  }
   37.82  
   37.83  void show_page_walk(unsigned long addr)
    38.1 --- a/xen/include/asm-x86/spinlock.h	Mon Aug 11 10:59:39 2008 +0900
    38.2 +++ b/xen/include/asm-x86/spinlock.h	Mon Aug 11 11:04:52 2008 +0900
    38.3 @@ -23,8 +23,8 @@ static inline void _raw_spin_lock(spinlo
    38.4          "1:  lock; decb %0         \n"
    38.5          "    js 2f                 \n"
    38.6          ".section .text.lock,\"ax\"\n"
    38.7 -        "2:  cmpb $0,%0            \n"
    38.8 -        "    rep; nop              \n"
    38.9 +        "2:  rep; nop              \n"
   38.10 +        "    cmpb $0,%0            \n"
   38.11          "    jle 2b                \n"
   38.12          "    jmp 1b                \n"
   38.13          ".previous"