ia64/xen-unstable

annotate xen/include/xen/lib.h @ 4850:923dd9975981

bitkeeper revision 1.1389.17.1 (42823056RNtq4AlseRHL98DJV2uJgA)

Change the Xen command-line parameter syntax. 'noacpi' and
'ignorebiostables' are gone. 'dom0_mem' can optionally take a k/m/g
suffix to specify units (default units are still kilobytes).

Also added:
1. 'mem=xxx' to specify maximum physical RAM address (supports
k/m/g suffix)
2. acpi=xxx/acpi_skip_timer_override/noapic: These all have same
semantics as in Linux. They are *automatically* propagated to
the domain0 command line, as dom0 shares resposibility for
platform initialisation.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 11 16:18:30 2005 +0000 (2005-05-11)
parents 754aa05abf61
children 2c883d988a41
rev   line source
kaf24@1210 1 #ifndef __LIB_H__
kaf24@1210 2 #define __LIB_H__
kaf24@1210 3
kaf24@4809 4 #include <xen/inttypes.h>
kaf24@1210 5 #include <stdarg.h>
kaf24@3827 6 #include <xen/config.h>
kaf24@1210 7 #include <xen/types.h>
kaf24@1486 8 #include <xen/string.h>
kaf24@1210 9
kaf24@3827 10 #define BUG() do { \
kaf24@3875 11 debugtrace_dump(); \
kaf24@3827 12 printk("BUG at %s:%d\n", __FILE__, __LINE__); \
kaf24@3827 13 FORCE_CRASH(); \
kaf24@3827 14 } while ( 0 )
kaf24@3827 15
kaf24@3848 16 #define BUG_ON(_p) do { if (_p) BUG(); } while ( 0 )
kaf24@3848 17
kaf24@1210 18 #ifndef NDEBUG
mafetter@4799 19 #define ASSERT(_p) { if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s\n", #_p , __LINE__, __FILE__); BUG(); } }
kaf24@1210 20 #else
kaf24@1210 21 #define ASSERT(_p) ((void)0)
kaf24@1210 22 #endif
kaf24@1210 23
kaf24@2635 24 #define SWAP(_a, _b) \
kaf24@2635 25 do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
kaf24@2635 26
iap10@4606 27 #define DIV_ROUND(x, y) (((x) + (y) / 2) / (y))
arun@3920 28
kaf24@3354 29 #define reserve_bootmem(_p,_l) ((void)0)
kaf24@1210 30
cl349@2448 31 struct domain;
cl349@2448 32
kaf24@3338 33 void cmdline_parse(char *cmdline);
kaf24@3338 34
kaf24@3827 35 #ifndef NDEBUG
kaf24@3875 36 extern int debugtrace_send_to_console;
kaf24@3875 37 extern void debugtrace_dump(void);
kaf24@3827 38 extern void debugtrace_printk(const char *fmt, ...);
kaf24@3827 39 #else
kaf24@3875 40 #define debugtrace_dump() ((void)0)
kaf24@3875 41 #define debugtrace_printk(_f, ...) ((void)0)
kaf24@3827 42 #endif
kaf24@3827 43
kaf24@4654 44 /* Allows us to use '%p' as general-purpose machine-word format char. */
kaf24@4654 45 #define _p(_x) ((void *)(unsigned long)(_x))
kaf24@4654 46 #define printk(_f , _a...) printf( _f , ## _a )
kaf24@4654 47 extern void printf(const char *format, ...)
kaf24@4654 48 __attribute__ ((format (printf, 1, 2)));
kaf24@4654 49 extern void panic(const char *format, ...);
kaf24@4654 50 extern long vm_assist(struct domain *, unsigned int, unsigned int);
kaf24@1210 51
kaf24@1210 52 /* vsprintf.c */
kaf24@1210 53 extern int sprintf(char * buf, const char * fmt, ...)
kaf24@4654 54 __attribute__ ((format (printf, 2, 3)));
kaf24@1210 55 extern int vsprintf(char *buf, const char *, va_list);
kaf24@1210 56 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
kaf24@4654 57 __attribute__ ((format (printf, 3, 4)));
kaf24@1210 58 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
kaf24@1210 59
kaf24@4850 60 long simple_strtol(
kaf24@4850 61 const char *cp,char **endp, unsigned int base);
kaf24@4850 62 unsigned long simple_strtoul(
kaf24@4850 63 const char *cp,char **endp, unsigned int base);
kaf24@4850 64 long long simple_strtoll(
kaf24@4850 65 const char *cp,char **endp, unsigned int base);
kaf24@4850 66 unsigned long long simple_strtoull(
kaf24@4850 67 const char *cp,char **endp, unsigned int base);
kaf24@4850 68
kaf24@4850 69 unsigned long long memparse(char *s);
kaf24@1210 70
kaf24@1210 71 #endif /* __LIB_H__ */