mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 00:10:02 +08:00
vprintf: Avoid printf() to avoid FPU usage
This commit is contained in:
parent
f7d6bd2306
commit
f56067e26c
@ -48,8 +48,6 @@
|
||||
|
||||
#include <rtems/bsd/bsd.h>
|
||||
|
||||
#undef printf
|
||||
|
||||
#define VPRINTF_LOCK() _Mutex_Acquire(&vprintf_mtx)
|
||||
#define VPRINTF_UNLOCK() _Mutex_Release(&vprintf_mtx)
|
||||
|
||||
@ -86,7 +84,17 @@ default_vprintf_handler(int level, const char *fmt, va_list ap)
|
||||
VPRINTF_LOCK();
|
||||
|
||||
if (level != LOG_PRINTF) {
|
||||
printf("%s: ", log_priorities[LOG_PRI(level)]);
|
||||
const char *p;
|
||||
|
||||
p = log_priorities[LOG_PRI(level)];
|
||||
|
||||
while (*p != '\0') {
|
||||
putchar(*p);
|
||||
++p;
|
||||
}
|
||||
|
||||
putchar(':');
|
||||
putchar(' ');
|
||||
}
|
||||
|
||||
last = -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user