1 /*!
2  * \file   l4util/lib/src/kprintf.c
3  * \brief  simple(!) -- non threaded -- printf using kernel debugger output
4  *
5  * \date   04/05/2007
6  * \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
7  *
8  */
9 /*
10  * (c) 2007-2009 Author(s)
11  *     economic rights: Technische Universität Dresden (Germany)
12  * This file is part of TUD:OS and distributed under the terms of the
13  * GNU Lesser General Public License 2.1.
14  * Please see the COPYING-LGPL-2.1 file for details.
15  */
16 
17 #include <stdio.h>
18 #include <stdarg.h>
19 
20 #include <l4/sys/kdebug.h>
21 #include <l4/util/kprintf.h>
22 
23 /* This is in the BSS on purpose to not put more load on the stack,
24  * and we know that this is suited for threading this way
25  */
26 static char buffer[500];
27 
l4_kprintf(const char * fmt,...)28 L4_CV int l4_kprintf(const char *fmt, ...)
29 {
30   va_list list;
31   int err;
32 
33   va_start(list, fmt);
34   err = vsnprintf(buffer, sizeof(buffer), fmt, list);
35   va_end(list);
36 
37   outstring(buffer);
38 
39   return err;
40 }
41