L4Re – L4 Runtime Environment
__kernel_object_impl.h
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include <l4/sys/ipc.h>
8 
9 L4_INLINE l4_msgtag_t
10 l4_invoke_debugger(l4_cap_idx_t obj, l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW
11 {
12  l4_msgtag_t t2;
13  unsigned const words = l4_msgtag_words(tag);
14  l4_msg_regs_t *mr = l4_utcb_mr_u(utcb);
15 
16  if (l4_is_invalid_cap(obj))
17  return l4_msgtag(-L4_EINVAL, 0, 0, 0);
18 
19  if (words + 2 > L4_UTCB_GENERIC_DATA_SIZE)
20  return l4_msgtag(-L4_EMSGTOOLONG, 0, 0, 0);
21 
22  mr->mr[0] += 0x100;
23  mr->mr[words] = L4_ITEM_MAP;
24  mr->mr[words + 1] = l4_obj_fpage(obj, 0, L4_CAP_FPAGE_RWS).raw;
25  t2 = l4_msgtag(L4_PROTO_DEBUGGER, words, 1, l4_msgtag_flags(tag));
26 
27  return l4_ipc_call(L4_BASE_DEBUGGER_CAP, utcb, t2, L4_IPC_NEVER);
28 }
29 
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition: compiler.h:186
unsigned long l4_cap_idx_t
L4 Capability selector Type.
Definition: types.h:342
unsigned l4_is_invalid_cap(l4_cap_idx_t c) L4_NOTHROW
Test if a capability selector is the invalid capability.
Definition: types.h:392
@ L4_BASE_DEBUGGER_CAP
Capability selector for the debugger cap.
Definition: consts.h:282
@ L4_EINVAL
Invalid argument.
Definition: err.h:56
@ L4_EMSGTOOLONG
Message too long.
Definition: err.h:67
l4_fpage_t l4_obj_fpage(l4_cap_idx_t obj, unsigned int order, unsigned char rights) L4_NOTHROW
Create a kernel-object flex page.
Definition: __l4_fpage.h:647
@ L4_CAP_FPAGE_RWS
Read, interface specific 'W', and 'S' rights for capability flex-pages.
Definition: __l4_fpage.h:192
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:463
@ L4_ITEM_MAP
Identify a message item as map item.
Definition: consts.h:189
l4_msgtag_flags
Flags for message tags.
Definition: types.h:96
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:408
unsigned l4_msgtag_words(l4_msgtag_t t) L4_NOTHROW
Get the number of untyped words.
Definition: types.h:424
@ L4_PROTO_DEBUGGER
Protocol ID for the debugger.
Definition: types.h:75
@ L4_UTCB_GENERIC_DATA_SIZE
Total number of message register (MRs) available.
Definition: utcb.h:47
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition: utcb.h:67
Message tag data structure.
Definition: types.h:160
l4_umword_t raw
Raw value.
Definition: __l4_fpage.h:85
Encapsulation of the message-register block in the UTCB.
Definition: utcb.h:79
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition: utcb.h:80