@@ -39,6 +39,8 @@
|
||||
#include <mainbus.h>
|
||||
#include <vfs.h> // for vfs_sync()
|
||||
#include <lamebus/ltrace.h> // for ltrace_stop()
|
||||
#include <kern/secret.h>
|
||||
#include <test.h>
|
||||
|
||||
|
||||
/* Flags word for DEBUG() macro. */
|
||||
@@ -90,13 +92,14 @@ console_send(void *junk, const char *data, size_t len)
|
||||
}
|
||||
|
||||
/*
|
||||
* Printf to the console.
|
||||
* kprintf and tprintf helper function.
|
||||
*/
|
||||
static
|
||||
inline
|
||||
int
|
||||
kprintf(const char *fmt, ...)
|
||||
__kprintf(const char *fmt, va_list ap)
|
||||
{
|
||||
int chars;
|
||||
va_list ap;
|
||||
bool dolock;
|
||||
|
||||
dolock = kprintf_lock != NULL
|
||||
@@ -111,9 +114,7 @@ kprintf(const char *fmt, ...)
|
||||
spinlock_acquire(&kprintf_spinlock);
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
chars = __vprintf(console_send, NULL, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (dolock) {
|
||||
lock_release(kprintf_lock);
|
||||
@@ -125,6 +126,22 @@ kprintf(const char *fmt, ...)
|
||||
return chars;
|
||||
}
|
||||
|
||||
/*
|
||||
* Printf to the console.
|
||||
*/
|
||||
int
|
||||
kprintf(const char *fmt, ...)
|
||||
{
|
||||
int chars;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
chars = __kprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return chars;
|
||||
}
|
||||
|
||||
/*
|
||||
* panic() is for fatal errors. It prints the printf arguments it's
|
||||
* passed and then halts the system.
|
||||
|
Reference in New Issue
Block a user