L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
__ktrace-impl.h
Go to the documentation of this file.
1
6/*
7 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8 * Björn Döbel <doebel@os.inf.tu-dresden.de>,
9 * Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
10 * economic rights: Technische Universität Dresden (Germany)
11 *
12 * License: see LICENSE.spdx (in this directory or the directories above)
13 */
14#pragma once
15
16#include <l4/sys/types.h>
17#include <l4/sys/kdebug.h>
18#include <l4/sys/task.h>
19
20/*****************************************************************************
21 *** Implementation
22 *****************************************************************************/
23
27
29fiasco_tbuf_log(const char *text)
30{
31 enum { TBUF_LOG = L4_KDEBUG_GROUP_TRACE + 0x01 };
32 return l4_error(__l4_kdebug_text(TBUF_LOG, text, __builtin_strlen(text)));
33}
34
37 l4_umword_t v3)
38{
39 enum { TBUF_LOG_3VAL = L4_KDEBUG_GROUP_TRACE + 0x04 };
40 return l4_error(__l4_kdebug_3_text(TBUF_LOG_3VAL, text,
41 __builtin_strlen(text), v1, v2, v3));
42}
43
44L4_INLINE void
46{
47 enum { TBUF_CLEAR = L4_KDEBUG_GROUP_TRACE + 0x02 };
48 __l4_kdebug_op(TBUF_CLEAR);
49}
50
51L4_INLINE void
53{
54 enum { TBUF_DUMP = L4_KDEBUG_GROUP_TRACE + 0x03 };
55 __l4_kdebug_op(TBUF_DUMP);
56}
57
59fiasco_tbuf_log_binary(const unsigned char *data)
60{
61 enum { TBUF_LOG_BIN = L4_KDEBUG_GROUP_TRACE + 0x08 };
62 return l4_error(__l4_kdebug_text(TBUF_LOG_BIN, (const char *)data, 24));
63}
64
67{
68 enum { TBUF_MAP_STATUS = L4_KDEBUG_GROUP_TRACE + 0x10 };
69
70 l4_utcb_t *utcb = l4_utcb();
71 l4_msg_regs_t *mr = l4_utcb_mr_u(utcb);
72 l4_msgtag_t ret;
73
74 mr->mr[0] = TBUF_MAP_STATUS;
75 mr->mr[1] = ku_mem->raw;
78 if (!l4_msgtag_has_error(ret))
79 ku_mem->raw = mr->mr[0];
80
81 return ret;
82}
83
86{
87 enum { TBUF_MAP_SLOTS = L4_KDEBUG_GROUP_TRACE + 0x11 };
88
89 l4_utcb_t *utcb = l4_utcb();
90 l4_msg_regs_t *mr = l4_utcb_mr_u(utcb);
91 l4_msgtag_t ret;
92
93 mr->mr[0] = TBUF_MAP_SLOTS;
94 mr->mr[1] = ku_mem->raw;
97 if (!l4_msgtag_has_error(ret))
98 ku_mem->raw = mr->mr[0];
99
100 return ret;
101}
l4_umword_t fiasco_tbuf_log(const char *text)
Create new trace-buffer entry with describing <text>.
l4_msgtag_t fiasco_tbuf_map_status(l4_fpage_t *ku_mem)
Map kernel trace-buffer status page.
void fiasco_tbuf_clear(void)
Clear trace-buffer.
l4_msgtag_t fiasco_tbuf_map_slots(l4_fpage_t *ku_mem)
Map kernel trace-buffer slots.
l4_msgtag_t fiasco_tbuf_validate(void)
Validate the kernel base debugger capability.
l4_umword_t fiasco_tbuf_log_3val(const char *text, l4_umword_t v1, l4_umword_t v2, l4_umword_t v3)
Create new trace-buffer entry with describing <text> and three additional values.
l4_umword_t fiasco_tbuf_log_binary(const unsigned char *data)
Create new trace-buffer entry with binary data.
void fiasco_tbuf_dump(void)
Dump trace-buffer to kernel console.
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
@ L4_BASE_DEBUGGER_CAP
Capability selector for the debugger cap.
Definition consts.h:385
@ L4_BASE_TASK_CAP
Capability selector for the current task.
Definition consts.h:346
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).
Definition ipc.h:599
l4_ret_t l4_error(l4_msgtag_t tag) L4_NOTHROW
Get IPC error code if any or message tag label otherwise for an IPC call.
Definition ipc.h:688
unsigned l4_msgtag_has_error(l4_msgtag_t t) L4_NOTHROW
Test for error indicator flag.
Definition types.h:461
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
Definition types.h:426
@ L4_PROTO_DEBUGGER
Protocol ID for the debugger.
Definition types.h:79
l4_msgtag_t l4_task_cap_valid(l4_cap_idx_t task, l4_cap_idx_t cap) L4_NOTHROW
Check whether a capability is present (refers to an object).
Definition task.h:484
#define L4_IPC_NEVER
never timeout
Definition __timeout.h:76
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:369
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
Functionality for invoking the kernel debugger.
l4_msgtag_t __l4_kdebug_3_text(unsigned op, char const *text, unsigned len, l4_umword_t v1, l4_umword_t v2, l4_umword_t v3) L4_NOTHROW
Invoke a text output operation with 3 additional machine word arguments on the base debugger capabili...
Definition kdebug.h:139
l4_msgtag_t __l4_kdebug_text(unsigned op, char const *text, unsigned len) L4_NOTHROW
Invoke a text output operation on the base debugger capability.
Definition kdebug.h:98
l4_msgtag_t __l4_kdebug_op(unsigned op) L4_NOTHROW
Invoke a nullary operation on the base debugger capability.
Definition kdebug.h:68
Common task related definitions.
Common L4 ABI Data Types.
Message tag data structure.
Definition types.h:266
L4 flexpage type.
Definition __l4_fpage.h:76
l4_umword_t raw
Raw value.
Definition __l4_fpage.h:78
Encapsulation of the message-register block in the UTCB.
Definition utcb.h:133
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition utcb.h:134