25 #include <l4/sys/consts.h>
26 #include <l4/sys/ipc.h>
35 L4_KDEBUG_OUTCHAR = 1,
36 L4_KDEBUG_OUTNSTRING = 2,
37 L4_KDEBUG_OUTHEX32 = 3,
38 L4_KDEBUG_OUTHEX20 = 4,
39 L4_KDEBUG_OUTHEX16 = 5,
40 L4_KDEBUG_OUTHEX12 = 6,
41 L4_KDEBUG_OUTHEX8 = 7,
63 __kdebug_text(
unsigned op,
char const *text,
unsigned len)
L4_NOTHROW
70 if (len > (
sizeof(store) - (2 *
sizeof(
l4_umword_t))))
73 __builtin_memcpy(&store, mr,
sizeof(store));
76 __builtin_memcpy(&mr->
mr[2], text, len);
81 __builtin_memcpy(mr, &store,
sizeof(*mr));
86 __kdebug_3_text(
unsigned op,
char const *text,
unsigned len,
94 if (len > (
sizeof(store) - (5 *
sizeof(
l4_umword_t))))
97 __builtin_memcpy(&store, mr,
sizeof(store));
103 __builtin_memcpy(&mr->
mr[5], text, len);
108 __builtin_memcpy(mr, &store,
sizeof(*mr));
132 L4_INLINE
void enter_kdebug(
char const *text)
L4_NOTHROW
143 __kdebug_text(L4_KDEBUG_ENTER, text, __builtin_strlen(text));
146 L4_INLINE
void outnstring(
char const *text,
unsigned len)
147 { __kdebug_text(L4_KDEBUG_OUTNSTRING, text, len); }
149 L4_INLINE
void outstring(
char const *text)
150 { outnstring(text, __builtin_strlen(text)); }
153 L4_INLINE
void outchar(
char c)
155 __kdebug_op_1(L4_KDEBUG_OUTCHAR, c);
161 __kdebug_op_1(L4_KDEBUG_OUTHEX32, (
l4_uint64_t)number >> 32);
163 __kdebug_op_1(L4_KDEBUG_OUTHEX32, number);
168 __kdebug_op_1(L4_KDEBUG_OUTHEX32, number >> 32);
169 __kdebug_op_1(L4_KDEBUG_OUTHEX32, number);
174 __kdebug_op_1(L4_KDEBUG_OUTHEX32, number);
179 __kdebug_op_1(L4_KDEBUG_OUTHEX20, number);
184 __kdebug_op_1(L4_KDEBUG_OUTHEX16, number);
189 __kdebug_op_1(L4_KDEBUG_OUTHEX12, number);
194 __kdebug_op_1(L4_KDEBUG_OUTHEX8, number);
199 __kdebug_op_1(L4_KDEBUG_OUTDEC, number);
L4 compiler related defines.
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
unsigned long l4_umword_t
Unsigned machine word.
signed long l4_mword_t
Signed machine word.
unsigned char l4_uint8_t
Unsigned 8bit value.
unsigned int l4_uint32_t
Unsigned 32bit value.
unsigned short int l4_uint16_t
Unsigned 16bit value.
unsigned long long l4_uint64_t
Unsigned 64bit value.
@ L4_BASE_DEBUGGER_CAP
Capability selector for the debugger cap.
l4_msgtag_t l4_ipc_call(l4_cap_idx_t object, l4_utcb_t *utcb, l4_msgtag_t tag, l4_timeout_t timeout) L4_NOTHROW
Object call (usual invocation).
unsigned l4_bytes_to_mwords(unsigned size) L4_NOTHROW
Determine how many machine words (l4_umword_t) are required to store a buffer of 'size' bytes.
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
@ L4_PROTO_DEBUGGER
Protocol ID for the debugger.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Message tag data structure.
Encapsulation of the message-register block in the UTCB.
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.