ia64/xen-unstable

view xen/include/xen/lib.h @ 4799:251ac792d8c1

bitkeeper revision 1.1385.1.7 (427f6405sUeICnIzUJ_HaXbYnLds4A)

Enabling light-weight shadows (especially shadow_mode_dirty).

Light-weight shadows leave all the page ref counts based on the guest p.t. pages,
while heavy-weight shadows do all their ref counts based on the shadow's p.t. pages.
shadow_mode_refcounts(dom) == 1 implies heavy-weight shadows.
author mafetter@fleming.research
date Mon May 09 13:22:13 2005 +0000 (2005-05-09)
parents ccc4ee412321
children dff93c0ff33e
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 debugtrace_dump(); \
11 printk("BUG at %s:%d\n", __FILE__, __LINE__); \
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 DIV_ROUND(x, y) (((x) + (y) / 2) / (y))
28 #define reserve_bootmem(_p,_l) ((void)0)
30 struct domain;
32 void cmdline_parse(char *cmdline);
34 #ifndef NDEBUG
35 extern int debugtrace_send_to_console;
36 extern void debugtrace_dump(void);
37 extern void debugtrace_printk(const char *fmt, ...);
38 #else
39 #define debugtrace_dump() ((void)0)
40 #define debugtrace_printk(_f, ...) ((void)0)
41 #endif
43 /* Allows us to use '%p' as general-purpose machine-word format char. */
44 #define _p(_x) ((void *)(unsigned long)(_x))
45 #define printk(_f , _a...) printf( _f , ## _a )
46 extern void printf(const char *format, ...)
47 __attribute__ ((format (printf, 1, 2)));
48 extern void panic(const char *format, ...);
49 extern long vm_assist(struct domain *, unsigned int, unsigned int);
51 /* vsprintf.c */
52 extern int sprintf(char * buf, const char * fmt, ...)
53 __attribute__ ((format (printf, 2, 3)));
54 extern int vsprintf(char *buf, const char *, va_list);
55 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
56 __attribute__ ((format (printf, 3, 4)));
57 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
59 long simple_strtol(const char *cp,char **endp,unsigned int base);
60 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
61 long long simple_strtoll(const char *cp,char **endp,unsigned int base);
63 #endif /* __LIB_H__ */