BigOS/lib/kprintf.c
2023-01-02 12:45:23 +08:00

35 lines
546 B
C

#include "stdio.h"
#include "protect.h"
#include "proc.h"
#include "global.h"
#include "proto.h"
#include "tty.h"
#include "serialport.h"
static void serialputch(int ch, void *cnt)
{
// write_serial(ch);
char _ch = ch;
tty_write(cur_ntty, &_ch, 1);
}
int vkprintf(const char *fmt, va_list ap)
{
// vprintfmt((void*)kprintfputch, NULL, fmt, ap);
vprintfmt((void *)serialputch, NULL, fmt, ap);
return 0;
}
int kprintf(const char *fmt, ...)
{
va_list ap;
int rc;
va_start(ap, fmt);
rc = vkprintf(fmt, ap);
va_end(ap);
return rc;
}