ia64/xen-unstable

annotate 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
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@3827 5 #include <xen/config.h>
kaf24@1210 6 #include <xen/types.h>
kaf24@1486 7 #include <xen/string.h>
kaf24@1210 8
kaf24@3827 9 #define BUG() do { \
kaf24@3827 10 printk("BUG at %s:%d\n", __FILE__, __LINE__); \
kaf24@3827 11 debugtrace_dump(); \
kaf24@3827 12 FORCE_CRASH(); \
kaf24@3827 13 } while ( 0 )
kaf24@3827 14
kaf24@1210 15 #ifndef NDEBUG
kaf24@3827 16 #define ASSERT(_p) if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s\n", #_p , __LINE__, __FILE__); BUG(); }
kaf24@1210 17 #else
kaf24@1210 18 #define ASSERT(_p) ((void)0)
kaf24@1210 19 #endif
kaf24@1210 20
kaf24@2635 21 #define SWAP(_a, _b) \
kaf24@2635 22 do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
kaf24@2635 23
kaf24@3354 24 #define reserve_bootmem(_p,_l) ((void)0)
kaf24@1210 25
cl349@2448 26 struct domain;
cl349@2448 27
kaf24@3338 28 void cmdline_parse(char *cmdline);
kaf24@3338 29
kaf24@3827 30 #ifndef NDEBUG
kaf24@3827 31 extern void debugtrace_reset(void);
kaf24@3827 32 extern void debugtrace_dump(void);
kaf24@3827 33 extern void debugtrace_printk(const char *fmt, ...);
kaf24@3827 34 #else
kaf24@3827 35 #define debugtrace_reset() ((void)0)
kaf24@3827 36 #define debugtrace_dump() ((void)0)
kaf24@3827 37 #define debugtrace_printk(_f, ...) ((void)0)
kaf24@3827 38 #endif
kaf24@3827 39
kaf24@1210 40 #define printk printf
kaf24@1486 41 void printf(const char *format, ...);
kaf24@1210 42 void panic(const char *format, ...);
cl349@2448 43 long vm_assist(struct domain *, unsigned int, unsigned int);
kaf24@1210 44
kaf24@1210 45 /* vsprintf.c */
kaf24@1210 46 extern int sprintf(char * buf, const char * fmt, ...)
kaf24@1210 47 __attribute__ ((format (printf, 2, 3)));
kaf24@1210 48 extern int vsprintf(char *buf, const char *, va_list);
kaf24@1210 49 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
kaf24@1210 50 __attribute__ ((format (printf, 3, 4)));
kaf24@1210 51 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
kaf24@1210 52
kaf24@1210 53 long simple_strtol(const char *cp,char **endp,unsigned int base);
kaf24@1210 54 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
kaf24@1210 55 long long simple_strtoll(const char *cp,char **endp,unsigned int base);
kaf24@1210 56
kaf24@1210 57 #endif /* __LIB_H__ */