L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
irq.h
Go to the documentation of this file.
1
6/*
7 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8 * Alexander Warg <warg@os.inf.tu-dresden.de>,
9 * Björn Döbel <doebel@os.inf.tu-dresden.de>
10 * economic rights: Technische Universität Dresden (Germany)
11 *
12 * This file is part of TUD:OS and distributed under the terms of the
13 * GNU General Public License 2.
14 * Please see the COPYING-GPL-2 file for details.
15 *
16 * As a special exception, you may use this file as part of a free software
17 * library without restriction. Specifically, if other files instantiate
18 * templates or use macros or inline functions from this file, or you compile
19 * this file and link it with other files to produce an executable, this
20 * file does not by itself cause the resulting executable to be covered by
21 * the GNU General Public License. This exception does not however
22 * invalidate any other reasons why the executable file might be covered by
23 * the GNU General Public License.
24 */
25#pragma once
26
28#include <l4/sys/ipc.h>
29#include <l4/sys/rcv_endpoint.h>
30
80
89 l4_utcb_t *utcb) L4_NOTHROW;
90
106
115
116
134
143
155
164
178
187 l4_timeout_t timeout, l4_utcb_t *utcb) L4_NOTHROW;
188
201
210
214enum L4_irq_sender_op
215{
216 L4_IRQ_SENDER_OP_RESERVED1 = 0, // Ex ATTACH
217 L4_IRQ_SENDER_OP_DETACH = 1
218};
219
223enum L4_irq_mux_op
224{
225 L4_IRQ_MUX_OP_CHAIN = 0
226};
227
231enum L4_irq_op
232{
233 L4_IRQ_OP_TRIGGER = 2,
234 L4_IRQ_OP_EOI = 4
235};
236
237/**************************************************************************
238 * Implementations
239 */
240
243 l4_utcb_t *utcb) L4_NOTHROW
244{
245 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
246 m->mr[0] = L4_IRQ_MUX_OP_CHAIN;
247 m->mr[1] = l4_map_obj_control(0, 0);
248 m->mr[2] = l4_obj_fpage(slave, 0, L4_CAP_FPAGE_RWS).raw;
249 return l4_ipc_call(irq, utcb, l4_msgtag(L4_PROTO_IRQ_MUX, 1, 1, 0),
251}
252
255{
256 l4_utcb_mr_u(utcb)->mr[0] = L4_IRQ_SENDER_OP_DETACH;
257 return l4_ipc_call(irq, utcb, l4_msgtag(L4_PROTO_IRQ_SENDER, 1, 0, 0),
259}
260
267
270{
271 l4_utcb_mr_u(utcb)->mr[0] = L4_IRQ_OP_EOI;
272 return l4_ipc_call(irq, utcb, l4_msgtag(L4_PROTO_IRQ, 1, 0, 0), to);
273}
274
278{
279 l4_utcb_mr_u(utcb)->mr[0] = L4_IRQ_OP_EOI;
280 return l4_ipc_send_and_wait(irq, utcb, l4_msgtag(L4_PROTO_IRQ, 1, 0, 0),
281 label, to);
282}
283
286{
287 l4_utcb_mr_u(utcb)->mr[0] = L4_IRQ_OP_EOI;
288 return l4_ipc_send(irq, utcb, l4_msgtag(L4_PROTO_IRQ, 1, 0, 0), L4_IPC_NEVER);
289}
290
291
294{
295 return l4_irq_mux_chain_u(irq, slave, l4_utcb());
296}
297
303
309
315
319{
320 return l4_irq_wait_u(irq, label, to, l4_utcb());
321}
322
328
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:359
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:680
@ L4_CAP_FPAGE_RWS
Read, interface specific 'W', and 'S' rights for capability flex-pages.
Definition __l4_fpage.h:209
l4_msgtag_t l4_ipc_send_and_wait(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_msgtag_t tag, l4_umword_t *label, l4_timeout_t timeout) L4_NOTHROW
Send a message and do an open wait.
Definition ipc.h:590
l4_msgtag_t l4_ipc_send(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_msgtag_t tag, l4_timeout_t timeout) L4_NOTHROW
Send a message to an object (do not wait for a reply).
Definition ipc.h:597
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:576
l4_msgtag_t l4_irq_mux_chain_u(l4_cap_idx_t irq, l4_cap_idx_t slave, l4_utcb_t *utcb) L4_NOTHROW
Attach an IRQ to this multiplexer.
Definition irq.h:242
l4_msgtag_t l4_irq_wait_u(l4_cap_idx_t irq, l4_umword_t *label, l4_timeout_t timeout, l4_utcb_t *utcb) L4_NOTHROW
Unmask IRQ and (open) wait for any message.
Definition irq.h:276
l4_msgtag_t l4_irq_trigger_u(l4_cap_idx_t irq, l4_utcb_t *utcb) L4_NOTHROW
Trigger the object.
Definition irq.h:262
l4_msgtag_t l4_irq_detach(l4_cap_idx_t irq) L4_NOTHROW
Detach from an interrupt source.
Definition irq.h:299
l4_msgtag_t l4_irq_unmask_u(l4_cap_idx_t irq, l4_utcb_t *utcb) L4_NOTHROW
Unmask this IRQ.
Definition irq.h:285
l4_msgtag_t l4_irq_unmask(l4_cap_idx_t irq) L4_NOTHROW
Unmask IRQ.
Definition irq.h:324
l4_msgtag_t l4_irq_mux_chain(l4_cap_idx_t irq, l4_cap_idx_t slave) L4_NOTHROW
Chain an IRQ to another master IRQ source.
Definition irq.h:293
l4_msgtag_t l4_irq_receive_u(l4_cap_idx_t irq, l4_timeout_t timeout, l4_utcb_t *utcb) L4_NOTHROW
Unmask and wait for this IRQ.
Definition irq.h:269
l4_msgtag_t l4_irq_detach_u(l4_cap_idx_t irq, l4_utcb_t *utcb) L4_NOTHROW
Detach from this interrupt.
Definition irq.h:254
l4_msgtag_t l4_irq_receive(l4_cap_idx_t irq, l4_timeout_t to) L4_NOTHROW
Unmask and wait for specified IRQ.
Definition irq.h:311
l4_msgtag_t l4_irq_wait(l4_cap_idx_t irq, l4_umword_t *label, l4_timeout_t to) L4_NOTHROW
Unmask IRQ and wait for any message.
Definition irq.h:317
l4_msgtag_t l4_irq_trigger(l4_cap_idx_t irq) L4_NOTHROW
Trigger an IRQ.
Definition irq.h:305
l4_umword_t l4_map_obj_control(l4_umword_t spot, unsigned grant) L4_NOTHROW
Create the first word for a map item for the object space.
Definition __l4_fpage.h:714
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:428
@ L4_PROTO_IRQ
IRQ message.
Definition types.h:55
@ L4_PROTO_IRQ_SENDER
Protocol for IRQ senders (IRQ -> IPC)
Definition types.h:70
@ L4_PROTO_IRQ_MUX
Protocol for IRQ mux (IRQ -> n x IRQ)
Definition types.h:71
#define L4_IPC_BOTH_TIMEOUT_0
0 receive and send timeout
Definition __timeout.h:87
#define L4_IPC_NEVER
never timeout
Definition __timeout.h:84
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:67
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:340
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:188
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:62
Kernel object system calls.
Receive endpoint C interface.
Message tag data structure.
Definition types.h:164
l4_umword_t raw
Raw value.
Definition __l4_fpage.h:87
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
Timeout pair.
Definition __timeout.h:61