diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-06 23:15:06 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-06 23:15:06 +0100 |
commit | acc786cb5805d057932ada3e7c571bb8e901cd67 (patch) | |
tree | fe6a9da99a9c5492f1004363a2a1a7aa8bfc8fed /kernel/l0/dbglog.c | |
parent | 0b5d6568c468075b6c1a2de065332b270345611b (diff) | |
download | macroscope-acc786cb5805d057932ada3e7c571bb8e901cd67.tar.gz macroscope-acc786cb5805d057932ada3e7c571bb8e901cd67.zip |
Begin review of taking model : making things thread safe.
Diffstat (limited to 'kernel/l0/dbglog.c')
-rw-r--r-- | kernel/l0/dbglog.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/l0/dbglog.c b/kernel/l0/dbglog.c index 5a7251b..e042625 100644 --- a/kernel/l0/dbglog.c +++ b/kernel/l0/dbglog.c @@ -1,6 +1,8 @@ #include <stdarg.h> #include <string.h> #include <printf.h> +#include <mutex.h> + #include <dbglog.h> #include <config.h> #include <sys.h> @@ -121,13 +123,17 @@ static void serial_puts(const char *c) { // ================================================================== +STATIC_MUTEX(dbglog_mutex); + void dbglog_setup() { + mutex_lock(&dbglog_mutex); #ifdef DBGLOG_TO_SCREEN vga_init(); #endif #ifdef DBGLOG_TO_SERIAL serial_init(); #endif + mutex_unlock(&dbglog_mutex); } void dbg_print(const char* str) { |