diff options
-rw-r--r-- | com32/include/dprintf.h | 4 | ||||
-rw-r--r-- | com32/lib/dprintf.c | 6 | ||||
-rw-r--r-- | com32/lib/vdprintf.c | 11 |
3 files changed, 9 insertions, 12 deletions
diff --git a/com32/include/dprintf.h b/com32/include/dprintf.h index 4c9682c0..30a21ada 100644 --- a/com32/include/dprintf.h +++ b/com32/include/dprintf.h @@ -9,8 +9,8 @@ #include <stdio.h> -int dprintf(const char *, ...); -int vdprintf(const char *, va_list); +void dprintf(const char *, ...); +void vdprintf(const char *, va_list); #else diff --git a/com32/lib/dprintf.c b/com32/lib/dprintf.c index ab431d8a..900c0a47 100644 --- a/com32/lib/dprintf.c +++ b/com32/lib/dprintf.c @@ -9,13 +9,11 @@ #define DEBUG 1 #include <dprintf.h> -int dprintf(const char *format, ...) +void dprintf(const char *format, ...) { va_list ap; - int rv; va_start(ap, format); - rv = vdprintf(format, ap); + vdprintf(format, ap); va_end(ap); - return rv; } diff --git a/com32/lib/vdprintf.c b/com32/lib/vdprintf.c index 869296ef..ea9e0488 100644 --- a/com32/lib/vdprintf.c +++ b/com32/lib/vdprintf.c @@ -8,6 +8,7 @@ #include <unistd.h> #include <inttypes.h> #include <sys/io.h> +#include <sys/cpu.h> #undef DEBUG #define DEBUG 1 @@ -15,12 +16,9 @@ #define BUFFER_SIZE 32768 -struct file_info; -extern ssize_t __serial_write(struct file_info *, const void *, size_t); - static const uint16_t debug_base = 0x03f8; /* I/O base address */ -int vdprintf(const char *format, va_list ap) +void vdprintf(const char *format, va_list ap) { int rv; char buffer[BUFFER_SIZE]; @@ -29,7 +27,7 @@ int vdprintf(const char *format, va_list ap) rv = vsnprintf(buffer, BUFFER_SIZE, format, ap); if (rv < 0) - return rv; + return; if (rv > BUFFER_SIZE - 1) rv = BUFFER_SIZE - 1; @@ -39,9 +37,10 @@ int vdprintf(const char *format, va_list ap) * if one is enabled or not (this means we don't have to enable the real * serial console and therefore get conflicting output.) */ + p = buffer; while (rv--) { while ((inb(debug_base+5) & 0x20) == 0) - ; + cpu_relax(); outb(*p++, debug_base); } } |