ia64/xen-unstable

annotate xen/include/xen/lib.h @ 5285:a480b2990961

bitkeeper revision 1.1649 (429f6bb65KQm70mnFwO33ykh9n1qag)

sched.h:
g/c unneeded include.
Many files:
Rename xen/slab.h to xen/xmalloc.h and fix resulting fallout.
xmalloc.h:
Rename: xen/include/xen/slab.h -> xen/include/xen/xmalloc.h
sched.h, multicall.c, dom_mem_ops.c, asm-offsets.c:
cleanup incorrect includes.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Jun 02 20:27:34 2005 +0000 (2005-06-02)
parents 2c827745787d
children b866ed85fad3
rev   line source
kaf24@1210 1 #ifndef __LIB_H__
kaf24@1210 2 #define __LIB_H__
kaf24@1210 3
kaf24@4809 4 #include <xen/inttypes.h>
kaf24@1210 5 #include <stdarg.h>
kaf24@3827 6 #include <xen/config.h>
kaf24@1210 7 #include <xen/types.h>
cl349@5285 8 #include <xen/xmalloc.h>
kaf24@1486 9 #include <xen/string.h>
kaf24@1210 10
kaf24@3827 11 #define BUG() do { \
kaf24@3875 12 debugtrace_dump(); \
kaf24@3827 13 printk("BUG at %s:%d\n", __FILE__, __LINE__); \
kaf24@3827 14 FORCE_CRASH(); \
kaf24@3827 15 } while ( 0 )
kaf24@3827 16
kaf24@3848 17 #define BUG_ON(_p) do { if (_p) BUG(); } while ( 0 )
kaf24@3848 18
kaf24@1210 19 #ifndef NDEBUG
mafetter@4799 20 #define ASSERT(_p) { if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s\n", #_p , __LINE__, __FILE__); BUG(); } }
kaf24@1210 21 #else
kaf24@1210 22 #define ASSERT(_p) ((void)0)
kaf24@1210 23 #endif
kaf24@1210 24
kaf24@2635 25 #define SWAP(_a, _b) \
kaf24@2635 26 do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
kaf24@2635 27
iap10@4606 28 #define DIV_ROUND(x, y) (((x) + (y) / 2) / (y))
arun@3920 29
kaf24@3354 30 #define reserve_bootmem(_p,_l) ((void)0)
kaf24@1210 31
cl349@2448 32 struct domain;
cl349@2448 33
kaf24@3338 34 void cmdline_parse(char *cmdline);
kaf24@3338 35
kaf24@3827 36 #ifndef NDEBUG
kaf24@3875 37 extern int debugtrace_send_to_console;
kaf24@3875 38 extern void debugtrace_dump(void);
kaf24@3827 39 extern void debugtrace_printk(const char *fmt, ...);
kaf24@3827 40 #else
kaf24@3875 41 #define debugtrace_dump() ((void)0)
kaf24@3875 42 #define debugtrace_printk(_f, ...) ((void)0)
kaf24@3827 43 #endif
kaf24@3827 44
kaf24@4654 45 /* Allows us to use '%p' as general-purpose machine-word format char. */
kaf24@4654 46 #define _p(_x) ((void *)(unsigned long)(_x))
kaf24@4654 47 #define printk(_f , _a...) printf( _f , ## _a )
kaf24@4654 48 extern void printf(const char *format, ...)
kaf24@4654 49 __attribute__ ((format (printf, 1, 2)));
kaf24@4654 50 extern void panic(const char *format, ...);
kaf24@4654 51 extern long vm_assist(struct domain *, unsigned int, unsigned int);
kaf24@1210 52
kaf24@1210 53 /* vsprintf.c */
kaf24@1210 54 extern int sprintf(char * buf, const char * fmt, ...)
kaf24@4654 55 __attribute__ ((format (printf, 2, 3)));
kaf24@1210 56 extern int vsprintf(char *buf, const char *, va_list);
kaf24@1210 57 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
kaf24@4654 58 __attribute__ ((format (printf, 3, 4)));
kaf24@1210 59 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
kaf24@1210 60
kaf24@4850 61 long simple_strtol(
kaf24@4850 62 const char *cp,char **endp, unsigned int base);
kaf24@4850 63 unsigned long simple_strtoul(
kaf24@4850 64 const char *cp,char **endp, unsigned int base);
kaf24@4850 65 long long simple_strtoll(
kaf24@4850 66 const char *cp,char **endp, unsigned int base);
kaf24@4850 67 unsigned long long simple_strtoull(
kaf24@4850 68 const char *cp,char **endp, unsigned int base);
kaf24@4850 69
kaf24@5018 70 unsigned long long parse_size_and_unit(char *s);
kaf24@1210 71
kaf24@1210 72 #endif /* __LIB_H__ */