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,
219 l4_debugger_set_object_name_u(
unsigned long cap,
223 char *s = (
char *)&l4_utcb_mr_u(utcb)->
mr[1];
224 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_NAME_SET_OP;
231 return l4_invoke_debugger(cap,
l4_msgtag(0, i + 1, 0, 0), utcb);
234 L4_INLINE
unsigned long 237 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_GLOBAL_ID_OP;
238 if (l4_error_u(l4_invoke_debugger(cap,
l4_msgtag(0, 1, 0, 0), utcb), utcb))
240 return l4_utcb_mr_u(utcb)->
mr[0];
243 L4_INLINE
unsigned long 246 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_KOBJ_TO_ID_OP;
247 l4_utcb_mr_u(utcb)->
mr[1] = kobjp;
248 if (l4_error_u(l4_invoke_debugger(cap,
l4_msgtag(0, 2, 0, 0), utcb), utcb))
250 return l4_utcb_mr_u(utcb)->
mr[0];
254 l4_debugger_query_log_typeid_u(
l4_cap_idx_t cap,
const char *name,
260 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_QUERY_LOG_TYPEID_OP;
261 l4_utcb_mr_u(utcb)->
mr[1] = idx;
262 l = __builtin_strlen(name);
264 __builtin_strncpy((
char *)&l4_utcb_mr_u(utcb)->mr[2], name, 31);
266 e = l4_error_u(l4_invoke_debugger(cap,
l4_msgtag(0, 2 + l, 0, 0), utcb), utcb);
269 return l4_utcb_mr_u(utcb)->
mr[0];
273 l4_debugger_query_log_name_u(
l4_cap_idx_t cap,
unsigned idx,
274 char *name,
unsigned namelen,
275 char *shortname,
unsigned shortnamelen,
280 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_QUERY_LOG_NAME_OP;
281 l4_utcb_mr_u(utcb)->
mr[1] = idx;
282 e = l4_error_u(l4_invoke_debugger(cap,
l4_msgtag(0, 2, 0, 0), utcb), utcb);
285 n = (
char *)&l4_utcb_mr_u(utcb)->
mr[0];
286 __builtin_strncpy(name, n, namelen);
287 name[namelen - 1] = 0;
288 __builtin_strncpy(shortname, n + __builtin_strlen(n) + 1, shortnamelen);
289 shortname[shortnamelen - 1] = 0;
295 l4_debugger_switch_log_u(
l4_cap_idx_t cap,
const char *name,
int on_off,
299 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_SWITCH_LOG_OP;
300 l4_utcb_mr_u(utcb)->
mr[1] = on_off;
301 l = __builtin_strlen(name);
303 __builtin_strncpy((
char *)&l4_utcb_mr_u(utcb)->mr[2], name, 31);
305 return l4_invoke_debugger(cap,
l4_msgtag(0, 2 + l, 0, 0), utcb);
309 l4_debugger_get_object_name_u(
l4_cap_idx_t cap,
unsigned id,
310 char *name,
unsigned size,
314 l4_utcb_mr_u(utcb)->
mr[0] = L4_DEBUGGER_NAME_GET_OP;
315 l4_utcb_mr_u(utcb)->
mr[1] = id;
316 t = l4_invoke_debugger(cap,
l4_msgtag(0, 2, 0, 0), utcb);
317 __builtin_strncpy(name, (
char *)&l4_utcb_mr_u(utcb)->mr[0], size);
327 return l4_debugger_set_object_name_u(cap, name,
l4_utcb());
330 L4_INLINE
unsigned long 333 return l4_debugger_global_id_u(cap,
l4_utcb());
336 L4_INLINE
unsigned long 339 return l4_debugger_kobj_to_id_u(cap, kobjp,
l4_utcb());
346 return l4_debugger_query_log_typeid_u(cap, name, idx,
l4_utcb());
351 char *name,
unsigned namelen,
352 char *shortname,
unsigned shortnamelen)
L4_NOTHROW 354 return l4_debugger_query_log_name_u(cap, idx, name, namelen,
355 shortname, shortnamelen,
l4_utcb());
362 return l4_debugger_switch_log_u(cap, name, on_off,
l4_utcb());
369 return l4_debugger_get_object_name_u(cap,
id, name, size,
l4_utcb());
Total number of message register (MRs) available.
int 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.
int 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.
unsigned long l4_debugger_global_id(l4_cap_idx_t cap) L4_NOTHROW
Get the globally unique ID of the object behind a capability.
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
unsigned long l4_cap_idx_t
L4 Capability selector Type.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
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.
L4 compiler related defines.
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.
unsigned long l4_umword_t
Unsigned machine word.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
Kernel object system calls.
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.
Message tag data structure.
unsigned long l4_addr_t
Address type.
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
l4_msgtag_t l4_debugger_switch_log(l4_cap_idx_t cap, const char *name, int on_off) L4_NOTHROW
Set or unset log.