ia64/xen-unstable

annotate xen/include/xen/lib.h @ 3338:4b44501cd54c

bitkeeper revision 1.1159.170.70 (41d2ca6aDWrk2tn4J3lpl18fPLfjRA)

Remove heavily arch-dep bootstrap code from common/kernel.c
author kaf24@scramble.cl.cam.ac.uk
date Wed Dec 29 15:16:58 2004 +0000 (2004-12-29)
parents 0174982516f6
children 597555bad4b5 7f2bf9fecd7e
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@1486 6 #include <xen/string.h>
kaf24@1210 7
kaf24@1210 8 #ifndef NDEBUG
kaf24@2095 9 #define ASSERT(_p) if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s\n", #_p , __LINE__, __FILE__); *(int*)0=0; }
kaf24@1210 10 #else
kaf24@1210 11 #define ASSERT(_p) ((void)0)
kaf24@1210 12 #endif
kaf24@1210 13
kaf24@2635 14 #define SWAP(_a, _b) \
kaf24@2635 15 do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
kaf24@2635 16
kaf24@1210 17 #define reserve_bootmem(_p,_l) \
kaf24@1210 18 printk("Memory Reservation 0x%lx, %lu bytes\n", (_p), (_l))
kaf24@1210 19
cl349@2448 20 struct domain;
cl349@2448 21
kaf24@3338 22 void cmdline_parse(char *cmdline);
kaf24@3338 23
kaf24@1210 24 #define printk printf
kaf24@1486 25 void printf(const char *format, ...);
kaf24@1210 26 void panic(const char *format, ...);
cl349@2448 27 long vm_assist(struct domain *, unsigned int, unsigned int);
kaf24@1210 28
kaf24@1210 29 /* vsprintf.c */
kaf24@1210 30 extern int sprintf(char * buf, const char * fmt, ...)
kaf24@1210 31 __attribute__ ((format (printf, 2, 3)));
kaf24@1210 32 extern int vsprintf(char *buf, const char *, va_list);
kaf24@1210 33 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
kaf24@1210 34 __attribute__ ((format (printf, 3, 4)));
kaf24@1210 35 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
kaf24@1210 36
kaf24@1210 37 long simple_strtol(const char *cp,char **endp,unsigned int base);
kaf24@1210 38 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
kaf24@1210 39 long long simple_strtoll(const char *cp,char **endp,unsigned int base);
kaf24@1210 40
kaf24@1210 41 #endif /* __LIB_H__ */