ia64/xen-unstable

view xen/include/xen/lib.h @ 3848:786c05f5b537

bitkeeper revision 1.1216 (42147ef15RGD4Ufi981UaX7EmpdxHQ)

Allocator cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@scramble.cl.cam.ac.uk
date Thu Feb 17 11:24:33 2005 +0000 (2005-02-17)
parents 33647e6b3f4e
children 0adffee5575c
line source
1 #ifndef __LIB_H__
2 #define __LIB_H__
4 #include <stdarg.h>
5 #include <xen/config.h>
6 #include <xen/types.h>
7 #include <xen/string.h>
9 #define BUG() do { \
10 printk("BUG at %s:%d\n", __FILE__, __LINE__); \
11 debugtrace_dump(); \
12 FORCE_CRASH(); \
13 } while ( 0 )
15 #define BUG_ON(_p) do { if (_p) BUG(); } while ( 0 )
17 #ifndef NDEBUG
18 #define ASSERT(_p) if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s\n", #_p , __LINE__, __FILE__); BUG(); }
19 #else
20 #define ASSERT(_p) ((void)0)
21 #endif
23 #define SWAP(_a, _b) \
24 do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
26 #define reserve_bootmem(_p,_l) ((void)0)
28 struct domain;
30 void cmdline_parse(char *cmdline);
32 #ifndef NDEBUG
33 extern void debugtrace_reset(void);
34 extern void debugtrace_dump(void);
35 extern void debugtrace_printk(const char *fmt, ...);
36 #else
37 #define debugtrace_reset() ((void)0)
38 #define debugtrace_dump() ((void)0)
39 #define debugtrace_printk(_f, ...) ((void)0)
40 #endif
42 #define printk printf
43 void printf(const char *format, ...);
44 void panic(const char *format, ...);
45 long vm_assist(struct domain *, unsigned int, unsigned int);
47 /* vsprintf.c */
48 extern int sprintf(char * buf, const char * fmt, ...)
49 __attribute__ ((format (printf, 2, 3)));
50 extern int vsprintf(char *buf, const char *, va_list);
51 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
52 __attribute__ ((format (printf, 3, 4)));
53 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
55 long simple_strtol(const char *cp,char **endp,unsigned int base);
56 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
57 long long simple_strtoll(const char *cp,char **endp,unsigned int base);
59 #endif /* __LIB_H__ */