From cdb8b09f6b67b270b1c21f1a7f42d5e8a604caa8 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 9 Sep 2005 09:24:25 +0000 Subject: Xenbus implementation ported from Linux to Mini-os, simple thread support introduced to simplify the porting. 64 bit version of Mini-os now compiles, but does not work because of the pagetables and some bits of scheduler not being written. Signed-off-by: Grzegorz Milos --- extras/mini-os/include/lib.h | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'extras/mini-os/include/lib.h') diff --git a/extras/mini-os/include/lib.h b/extras/mini-os/include/lib.h index dcf5a84e08..f386cb8053 100644 --- a/extras/mini-os/include/lib.h +++ b/extras/mini-os/include/lib.h @@ -60,10 +60,22 @@ /* printing */ #define printk printf #define kprintf printf -int printf(const char *fmt, ...); -int vprintf(const char *fmt, va_list ap); -int sprintf(char *buf, const char *cfmt, ...); -int vsprintf(char *buf, const char *cfmt, va_list ap); +#define _p(_x) ((void *)(unsigned long)(_x)) +void printf(const char *fmt, ...); +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args); +int vscnprintf(char *buf, size_t size, const char *fmt, va_list args); +int snprintf(char * buf, size_t size, const char *fmt, ...); +int scnprintf(char * buf, size_t size, const char *fmt, ...); +int vsprintf(char *buf, const char *fmt, va_list args); +int sprintf(char * buf, const char *fmt, ...); +int vsscanf(const char * buf, const char * fmt, va_list args); +int sscanf(const char * buf, const char * fmt, ...); + +long simple_strtol(const char *cp,char **endp,unsigned int base); +unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base); +long long simple_strtoll(const char *cp,char **endp,unsigned int base); +unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base); + /* string and memory manipulation */ int memcmp(const void *cs, const void *ct, size_t count); @@ -77,6 +89,16 @@ size_t strnlen(const char *s, size_t count); size_t strlen(const char *s); char *strchr(const char *s, int c); char *strstr(const char *s1, const char *s2); +char * strcat(char * dest, const char * src); + + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +struct kvec { + void *iov_base; + size_t iov_len; +}; + #endif /* _LIB_H_ */ -- cgit v1.2.3