29namespace L4Re {
namespace Util {
39 static char const *
const levels[];
42 { cprintf(
"%s: %s", _component, levels[_l]); }
44 int printf(
char const *fmt, ...) const
45 __attribute__((format(printf,2,3)));
47 int cprintf(
char const *fmt, ...) const
48 __attribute__((format(printf,2,3)));
50 constexpr Err(Level l,
char const *component) : _l(l), _component(component)
55 char const *_component;
67 char const *
const _component;
68 char const *
const _subsys;
72 int printf_impl(
char const *fmt, ...) const
73 __attribute__((format(printf, 2, 3)));
75 int cprintf_impl(
char const *fmt, ...) const
76 __attribute__((format(printf, 2, 3)));
81 static unsigned long level;
83 static void set_level(
unsigned long l) { level = l; }
85 bool is_active()
const {
return _m & level; }
89 int printf(
char const *fmt, ...) const
90 __attribute__((format(printf, 2, 3)));
92 int cprintf(
char const *fmt, ...) const
93 __attribute__((format(printf, 2, 3)));
97 int __attribute__((always_inline, format(printf, 2, 3)))
98 printf(
char const *fmt, ...)
const
103 return printf_impl(fmt, __builtin_va_arg_pack());
106 int __attribute__((always_inline, format(printf, 2, 3)))
107 cprintf(
char const *fmt, ...)
const
112 return cprintf_impl(fmt, __builtin_va_arg_pack());
118 Dbg() : _m(1), _component(0), _subsys(0) { };
121 Dbg(
unsigned long mask,
char const *comp,
char const *subs)
122 : _m(mask), _component(comp), _subsys(subs)
128 static void set_level(
unsigned long) {}
129 bool is_active()
const {
return false; }
131 int printf(
char const * , ...) const
132 __attribute__((format(printf, 2, 3)))
135 int cprintf(
char const * , ...) const
136 __attribute__((format(printf, 2, 3)))
143 Dbg(
unsigned long,
char const *,
char const *) {}
Common L4 ABI Data Types.