Add support for the tracing infastructure in coreboot.
[coreboot.git] / src / console / vsprintf.c
index c4c91115c2e1ddc3076f0c3dce855489a4f05adc..435401b7efcd33aa088a4f6dc528ca747a060fbe 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of the coreboot project.
- * 
+ *
  * Copyright (C) 2009 coresystems GmbH
  *
  * This program is free software; you can redistribute it and/or
  * MA 02110-1301 USA
  */
 
-#include <stdarg.h>
 #include <string.h>
 #include <smp/spinlock.h>
 #include <console/vtxprintf.h>
+#include <trace.h>
 
-static spinlock_t vsprintf_lock = SPIN_LOCK_UNLOCKED;
+DECLARE_SPIN_LOCK(vsprintf_lock)
 
 static char *str_buf;
 
@@ -38,6 +38,7 @@ static int vsprintf(char *buf, const char *fmt, va_list args)
 {
        int i;
 
+       DISABLE_TRACE;
        spin_lock(&vsprintf_lock);
 
        str_buf = buf;
@@ -45,6 +46,7 @@ static int vsprintf(char *buf, const char *fmt, va_list args)
        *str_buf = '\0';
 
        spin_unlock(&vsprintf_lock);
+       ENABLE_TRACE;
 
        return i;
 }