ia64/xen-unstable

view xen/include/xen/lib.h @ 3827:33647e6b3f4e

bitkeeper revision 1.1200 (42107fffsY27L01xietRjdMzGHiDzw)

x86/64 build fixes and simpler debug tracing.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Mon Feb 14 10:39:59 2005 +0000 (2005-02-14)
parents 0a4b76b6b5a0
children 786c05f5b537 ac04aeeaf462
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 #ifndef NDEBUG
16 #define ASSERT(_p) if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s\n", #_p , __LINE__, __FILE__); BUG(); }
17 #else
18 #define ASSERT(_p) ((void)0)
19 #endif
21 #define SWAP(_a, _b) \
22 do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
24 #define reserve_bootmem(_p,_l) ((void)0)
26 struct domain;
28 void cmdline_parse(char *cmdline);
30 #ifndef NDEBUG
31 extern void debugtrace_reset(void);
32 extern void debugtrace_dump(void);
33 extern void debugtrace_printk(const char *fmt, ...);
34 #else
35 #define debugtrace_reset() ((void)0)
36 #define debugtrace_dump() ((void)0)
37 #define debugtrace_printk(_f, ...) ((void)0)
38 #endif
40 #define printk printf
41 void printf(const char *format, ...);
42 void panic(const char *format, ...);
43 long vm_assist(struct domain *, unsigned int, unsigned int);
45 /* vsprintf.c */
46 extern int sprintf(char * buf, const char * fmt, ...)
47 __attribute__ ((format (printf, 2, 3)));
48 extern int vsprintf(char *buf, const char *, va_list);
49 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
50 __attribute__ ((format (printf, 3, 4)));
51 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
53 long simple_strtol(const char *cp,char **endp,unsigned int base);
54 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
55 long long simple_strtoll(const char *cp,char **endp,unsigned int base);
57 #endif /* __LIB_H__ */