From: Trammell Hudson Date: Wed, 22 Oct 2008 15:34:45 +0000 (-0500) Subject: Implemented vprintk() to allow V3VEE debug printfs to be forwarded to the console X-Git-Tag: 1.0^2~16 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios-OLD.git;a=commitdiff_plain;h=f8f34325f488003363eba70f03356618735130e4 Implemented vprintk() to allow V3VEE debug printfs to be forwarded to the console --- diff --git a/kitten/kernel/printk.c b/kitten/kernel/printk.c index d0e2bf1..b410ec6 100644 --- a/kitten/kernel/printk.c +++ b/kitten/kernel/printk.c @@ -8,6 +8,19 @@ int printk(const char *fmt, ...) { va_list args; + va_start(args, fmt); + int rc = vprintk( fmt, args ); + va_end(args); + return rc; +} + + +int +vprintk( + const char * fmt, + va_list args +) +{ int len; char buf[1024]; char *p = buf; @@ -22,9 +35,7 @@ int printk(const char *fmt, ...) remain -= len; /* Construct the string... */ - va_start(args, fmt); len = vscnprintf(p, remain, fmt, args); - va_end(args); /* Pass the string to the console subsystem */ console_write(buf);