lock: merge spinlock and mtx locks into one

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-13 14:19:10 -04:00
commit 2076f1dae1
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
32 changed files with 158 additions and 169 deletions

View file

@ -40,7 +40,7 @@
#include <drivers/serial.h>
#include <kernel/tty.h>
#include <kernel/spinlock.h>
#include <kernel/lock.h>
// define this globally (e.g. gcc -DPRINTF_INCLUDE_CONFIG_H ...) to include the
// printf_config.h header file
@ -941,14 +941,14 @@ static int _vsnprintf(out_fct_type out, char *buffer, const size_t maxlen, const
int printf_(const char *format, ...)
{
static spinlock_t lock = 0;
spinlock_acquire(&lock);
static lock_t lock = 0;
spin_lock(&lock);
va_list va;
va_start(va, format);
char buffer[1];
const int ret = _vsnprintf(_out_char, buffer, (size_t)-1, format, va);
va_end(va);
spinlock_release(&lock);
spin_unlock(&lock);
return ret;
}