2 * (c) 2011 Alexander Warg <warg@os.inf.tu-dresden.de>
3 * economic rights: Technische Universität Dresden (Germany)
5 * This file is part of TUD:OS and distributed under the terms of the
6 * GNU General Public License 2.
7 * Please see the COPYING-GPL-2 file for details.
15 static unsigned _debug_level = 1;
16 static unsigned _trace_mask;
18 void set_debug_level(unsigned level)
23 bool dlevel(unsigned level)
25 return _debug_level >= level;
28 void d_printf(unsigned level, char const *fmt, ...)
30 if (_debug_level < level)
40 * \brief Set the mask for event tracing (See debug.h for possible trace
43 void set_trace_mask(unsigned mask)
49 * \brief Trace an event.
51 * \param event Event to be traced
53 void trace_event(unsigned event, char const *fmt, ...)
55 if ((_trace_mask & event) == 0)
65 * \brief Determine if an event was selected for tracing.
67 * \param event Event to be queried.
69 * \returns true if event was selected for tracing, false otherwise
71 bool trace_event_enabled(unsigned event)
73 return (_trace_mask & event);
76 // Set the ACPICA debug flags
77 // This function is overridden in acpi/acpi.cc.
78 void __attribute__((weak)) acpi_set_debug_level(unsigned) {}