27 #include <l4/sys/utcb.h>
28 #include <l4/sys/ipc.h>
81 l4_debugger_get_object_name_u(
l4_cap_idx_t cap,
unsigned id,
82 char *name,
unsigned size,
96 L4_INLINE
unsigned long
102 L4_INLINE
unsigned long
117 L4_INLINE
unsigned long
123 L4_INLINE
unsigned long
145 l4_debugger_query_log_typeid_u(
l4_cap_idx_t cap,
const char *name,
165 char *name,
unsigned namelen,
166 char *shortname,
unsigned shortnamelen)
L4_NOTHROW;
172 l4_debugger_query_log_name_u(
l4_cap_idx_t cap,
unsigned idx,
173 char *name,
unsigned namelen,
174 char *shortname,
unsigned shortnamelen,
194 l4_debugger_switch_log_u(
l4_cap_idx_t cap,
const char *name,
int on_off,
199 L4_DEBUGGER_NAME_SET_OP = 0UL,
200 L4_DEBUGGER_GLOBAL_ID_OP = 1UL,
201 L4_DEBUGGER_KOBJ_TO_ID_OP = 2UL,
202 L4_DEBUGGER_QUERY_LOG_TYPEID_OP = 3UL,
203 L4_DEBUGGER_SWITCH_LOG_OP = 4UL,
204 L4_DEBUGGER_NAME_GET_OP = 5UL,
205 L4_DEBUGGER_QUERY_LOG_NAME_OP = 6UL,
210 L4_DEBUGGER_SWITCH_LOG_ON = 1,
211 L4_DEBUGGER_SWITCH_LOG_OFF = 0,
237 for (i = 0; i < maxlen - 1 && src[i]; ++i)
249 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_NAME_SET_OP;
253 return l4_invoke_debugger(cap,
l4_msgtag(0, 1 + i, 0, 0), utcb);
256 L4_INLINE
unsigned long
259 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_GLOBAL_ID_OP;
260 if (l4_error_u(l4_invoke_debugger(cap,
l4_msgtag(0, 1, 0, 0), utcb), utcb))
262 return l4_utcb_mr_u(utcb)->
mr[0];
265 L4_INLINE
unsigned long
268 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_KOBJ_TO_ID_OP;
269 l4_utcb_mr_u(utcb)->
mr[1] = kobjp;
270 if (l4_error_u(l4_invoke_debugger(cap,
l4_msgtag(0, 2, 0, 0), utcb), utcb))
272 return l4_utcb_mr_u(utcb)->
mr[0];
276 l4_debugger_query_log_typeid_u(
l4_cap_idx_t cap,
const char *name,
282 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_QUERY_LOG_TYPEID_OP;
283 l4_utcb_mr_u(utcb)->
mr[1] = idx;
286 e = l4_error_u(l4_invoke_debugger(cap,
l4_msgtag(0, 2 + i, 0, 0), utcb), utcb);
289 return l4_utcb_mr_u(utcb)->
mr[0];
293 l4_debugger_query_log_name_u(
l4_cap_idx_t cap,
unsigned idx,
294 char *name,
unsigned namelen,
295 char *shortname,
unsigned shortnamelen,
300 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_QUERY_LOG_NAME_OP;
301 l4_utcb_mr_u(utcb)->
mr[1] = idx;
302 e = l4_error_u(l4_invoke_debugger(cap,
l4_msgtag(0, 2, 0, 0), utcb), utcb);
305 n = (
char const *)&l4_utcb_mr_u(utcb)->
mr[0];
313 l4_debugger_switch_log_u(
l4_cap_idx_t cap,
const char *name,
int on_off,
317 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_SWITCH_LOG_OP;
318 l4_utcb_mr_u(utcb)->
mr[1] = on_off;
321 return l4_invoke_debugger(cap,
l4_msgtag(0, 2 + i, 0, 0), utcb);
325 l4_debugger_get_object_name_u(
l4_cap_idx_t cap,
unsigned id,
326 char *name,
unsigned size,
330 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_NAME_GET_OP;
331 l4_utcb_mr_u(utcb)->
mr[1] = id;
332 t = l4_invoke_debugger(cap,
l4_msgtag(0, 2, 0, 0), utcb);
342 return l4_debugger_set_object_name_u(cap, name,
l4_utcb());
345 L4_INLINE
unsigned long
348 return l4_debugger_global_id_u(cap,
l4_utcb());
351 L4_INLINE
unsigned long
354 return l4_debugger_kobj_to_id_u(cap, kobjp,
l4_utcb());
361 return l4_debugger_query_log_typeid_u(cap, name, idx,
l4_utcb());
366 char *name,
unsigned namelen,
367 char *shortname,
unsigned shortnamelen)
L4_NOTHROW
369 return l4_debugger_query_log_name_u(cap, idx, name, namelen,
370 shortname, shortnamelen,
l4_utcb());
377 return l4_debugger_switch_log_u(cap, name, on_off,
l4_utcb());
384 return l4_debugger_get_object_name_u(cap,
id, name, size,
l4_utcb());
L4 compiler related defines.
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
l4_msgtag_t l4_debugger_get_object_name(l4_cap_idx_t cap, unsigned id, char *name, unsigned size) L4_NOTHROW
Get name of the kernel object with Id id.
long l4_debugger_query_log_typeid(l4_cap_idx_t cap, const char *name, unsigned idx) L4_NOTHROW
Query the log-id for a log type.
long l4_debugger_query_log_name(l4_cap_idx_t cap, unsigned idx, char *name, unsigned namelen, char *shortname, unsigned shortnamelen) L4_NOTHROW
Query the name of a log type given the ID.
unsigned __strcpy_maxlen(char *dst, char const *src, unsigned maxlen)
Copy a number of characters from the C string src to the C string dst.
l4_msgtag_t l4_debugger_switch_log(l4_cap_idx_t cap, const char *name, int on_off) L4_NOTHROW
Set or unset log.
unsigned long l4_umword_t
Unsigned machine word.
unsigned long l4_addr_t
Address type.
unsigned long l4_cap_idx_t
L4 Capability selector Type.
unsigned long l4_debugger_kobj_to_id(l4_cap_idx_t cap, l4_addr_t kobjp) L4_NOTHROW
Get the globally unique ID of the object behind the kobject pointer.
l4_msgtag_t l4_debugger_set_object_name(l4_cap_idx_t cap, const char *name) L4_NOTHROW
Set the name of a kernel object.
unsigned long l4_debugger_global_id(l4_cap_idx_t cap) L4_NOTHROW
Get the globally unique ID of the object behind a capability.
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_UTCB_GENERIC_DATA_SIZE
Total number of message register (MRs) available.
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.
Kernel object system calls.
Message tag data structure.
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.