ia64/xen-unstable

changeset 3438:0002ff9aa407

bitkeeper revision 1.1159.217.16 (41e78585MdlpNrs3tGvODh4pReIzpg)

Merge scramble.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
author kaf24@scramble.cl.cam.ac.uk
date Fri Jan 14 08:40:37 2005 +0000 (2005-01-14)
parents 6096356005ba 8a573c1dfd4c
children 657d51f27c5b b96857892a2c
files xen/common/string.c xen/include/public/xen.h xen/include/xen/irq.h xen/include/xen/list.h
line diff
     1.1 --- a/xen/common/string.c	Thu Jan 13 13:19:13 2005 +0000
     1.2 +++ b/xen/common/string.c	Fri Jan 14 08:40:37 2005 +0000
     1.3 @@ -92,6 +92,32 @@ char * strncpy(char * dest,const char *s
     1.4  }
     1.5  #endif
     1.6  
     1.7 +#ifndef __HAVE_ARCH_STRLCPY
     1.8 +/**
     1.9 + * strlcpy - Copy a %NUL terminated string into a sized buffer
    1.10 + * @dest: Where to copy the string to
    1.11 + * @src: Where to copy the string from
    1.12 + * @size: size of destination buffer
    1.13 + *
    1.14 + * Compatible with *BSD: the result is always a valid
    1.15 + * NUL-terminated string that fits in the buffer (unless,
    1.16 + * of course, the buffer size is zero). It does not pad
    1.17 + * out the result like strncpy() does.
    1.18 + */
    1.19 +size_t strlcpy(char *dest, const char *src, size_t size)
    1.20 +{
    1.21 +	size_t ret = strlen(src);
    1.22 +
    1.23 +	if (size) {
    1.24 +		size_t len = (ret >= size) ? size-1 : ret;
    1.25 +		memcpy(dest, src, len);
    1.26 +		dest[len] = '\0';
    1.27 +	}
    1.28 +	return ret;
    1.29 +}
    1.30 +EXPORT_SYMBOL(strlcpy);
    1.31 +#endif
    1.32 +
    1.33  #ifndef __HAVE_ARCH_STRCAT
    1.34  /**
    1.35   * strcat - Append one %NUL-terminated string to another
    1.36 @@ -449,7 +475,6 @@ void * memmove(void * dest,const void *s
    1.37   * @ct: Another area of memory
    1.38   * @count: The size of the area.
    1.39   */
    1.40 -/*
    1.41  int memcmp(const void * cs,const void * ct,size_t count)
    1.42  {
    1.43  	const unsigned char *su1, *su2;
    1.44 @@ -460,7 +485,6 @@ int memcmp(const void * cs,const void * 
    1.45  			break;
    1.46  	return res;
    1.47  }
    1.48 -*/
    1.49  #endif
    1.50  
    1.51  #ifndef __HAVE_ARCH_MEMSCAN
     2.1 --- a/xen/include/public/xen.h	Thu Jan 13 13:19:13 2005 +0000
     2.2 +++ b/xen/include/public/xen.h	Fri Jan 14 08:40:37 2005 +0000
     2.3 @@ -18,6 +18,8 @@
     2.4  #include "arch-x86_32.h"
     2.5  #elif defined(__x86_64__)
     2.6  #include "arch-x86_64.h"
     2.7 +#elif defined(__ia64__)
     2.8 +#include "arch-ia64.h"
     2.9  #else
    2.10  #error "Unsupported architecture"
    2.11  #endif
     3.1 --- a/xen/include/xen/irq.h	Thu Jan 13 13:19:13 2005 +0000
     3.2 +++ b/xen/include/xen/irq.h	Fri Jan 14 08:40:37 2005 +0000
     3.3 @@ -21,6 +21,7 @@ struct irqaction
     3.4  #define IRQ_PENDING	4	/* IRQ pending - replay on enable */
     3.5  #define IRQ_REPLAY	8	/* IRQ has been replayed but not acked yet */
     3.6  #define IRQ_GUEST       16      /* IRQ is handled by guest OS(es) */
     3.7 +#define IRQ_PER_CPU     256     /* IRQ is per CPU */
     3.8  
     3.9  /*
    3.10   * Interrupt controller descriptor. This is all we need
     4.1 --- a/xen/include/xen/list.h	Thu Jan 13 13:19:13 2005 +0000
     4.2 +++ b/xen/include/xen/list.h	Fri Jan 14 08:40:37 2005 +0000
     4.3 @@ -162,3 +162,16 @@ static __inline__ void list_splice(struc
     4.4  		pos = n, n = pos->next)
     4.5  
     4.6  #endif
     4.7 +
     4.8 +/**
     4.9 + * list_for_each_entry	-	iterate over list of given type
    4.10 + * @pos:	the type * to use as a loop counter.
    4.11 + * @head:	the head for your list.
    4.12 + * @member:	the name of the list_struct within the struct.
    4.13 + */
    4.14 +#define list_for_each_entry(pos, head, member)				\
    4.15 +	for (pos = list_entry((head)->next, typeof(*pos), member),	\
    4.16 +		     prefetch(pos->member.next);			\
    4.17 +	     &pos->member != (head); 					\
    4.18 +	     pos = list_entry(pos->member.next, typeof(*pos), member),	\
    4.19 +		     prefetch(pos->member.next))