ia64/xen-unstable

annotate xen/include/xen/lib.h @ 1210:9f85adafc1e1

bitkeeper revision 1.821 (406007d6uu0vZYDxa9P1ZfNO9kF_Cg)

Many files:
xeno -> xen renames.
ide-xen.c:
Rename: xen/drivers/ide/ide-xeno.c -> xen/drivers/ide/ide-xen.c
xen.lds:
Rename: xen/arch/i386/xeno.lds -> xen/arch/i386/xen.lds
Many files:
mvdir
author kaf24@scramble.cl.cam.ac.uk
date Tue Mar 23 09:48:06 2004 +0000 (2004-03-23)
parents
children 55825bcb964e
rev   line source
kaf24@1210 1 #ifndef __LIB_H__
kaf24@1210 2 #define __LIB_H__
kaf24@1210 3
kaf24@1210 4 #include <stdarg.h>
kaf24@1210 5 #include <xen/types.h>
kaf24@1210 6
kaf24@1210 7 #ifndef NDEBUG
kaf24@1210 8 #define ASSERT(_p) if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s", #_p , __LINE__, __FILE__); *(int*)0=0; }
kaf24@1210 9 #else
kaf24@1210 10 #define ASSERT(_p) ((void)0)
kaf24@1210 11 #endif
kaf24@1210 12
kaf24@1210 13 #define reserve_bootmem(_p,_l) \
kaf24@1210 14 printk("Memory Reservation 0x%lx, %lu bytes\n", (_p), (_l))
kaf24@1210 15
kaf24@1210 16 /* lib.c */
kaf24@1210 17 #include <xen/string.h>
kaf24@1210 18
kaf24@1210 19 /* JWS - pulled over linux string library ({asm,linux}/string.h)
kaf24@1210 20 int memcmp(const void * cs,const void * ct,size_t count);
kaf24@1210 21 void * memcpy(void * dest,const void *src,size_t count);
kaf24@1210 22 int strncmp(const char * cs,const char * ct,size_t count);
kaf24@1210 23 int strcmp(const char * cs,const char * ct);
kaf24@1210 24 char * strcpy(char * dest,const char *src);
kaf24@1210 25 char * strncpy(char * dest,const char *src,size_t count);
kaf24@1210 26 void * memset(void * s,int c,size_t count);
kaf24@1210 27 size_t strnlen(const char * s, size_t count);
kaf24@1210 28 size_t strlen(const char * s);
kaf24@1210 29 char * strchr(const char *,int);
kaf24@1210 30 char * strstr(const char * s1,const char * s2);
kaf24@1210 31 */
kaf24@1210 32
kaf24@1210 33 unsigned long str_to_quad(unsigned char *s);
kaf24@1210 34 unsigned char *quad_to_str(unsigned long q, unsigned char *s);
kaf24@1210 35
kaf24@1210 36 /* kernel.c */
kaf24@1210 37 #define printk printf
kaf24@1210 38 void printf (const char *format, ...);
kaf24@1210 39 void panic(const char *format, ...);
kaf24@1210 40
kaf24@1210 41 /* vsprintf.c */
kaf24@1210 42 extern int sprintf(char * buf, const char * fmt, ...)
kaf24@1210 43 __attribute__ ((format (printf, 2, 3)));
kaf24@1210 44 extern int vsprintf(char *buf, const char *, va_list);
kaf24@1210 45 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
kaf24@1210 46 __attribute__ ((format (printf, 3, 4)));
kaf24@1210 47 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
kaf24@1210 48
kaf24@1210 49 long simple_strtol(const char *cp,char **endp,unsigned int base);
kaf24@1210 50 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
kaf24@1210 51 long long simple_strtoll(const char *cp,char **endp,unsigned int base);
kaf24@1210 52
kaf24@1210 53 /* Produce a 32-bit hash from a key string 'k' of length 'len' bytes. */
kaf24@1210 54 u32 hash(unsigned char *k, unsigned long len);
kaf24@1210 55
kaf24@1210 56 #endif /* __LIB_H__ */