L4Re - L4 Runtime Environment
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IRQs

The IRQ and ICU class. More...

+ Collaboration diagram for IRQs:

Data Structures

class  L4::Irq
 C++ version of an L4 IRQ. More...

Enumerations

enum  L4_irq_flow_type {
  L4_IRQ_F_NONE = 0, L4_IRQ_F_LEVEL = 0x2, L4_IRQ_F_EDGE = 0x0, L4_IRQ_F_POS = 0x0,
  L4_IRQ_F_NEG = 0x4, L4_IRQ_F_BOTH = 0x8, L4_IRQ_F_LEVEL_HIGH = 0x3, L4_IRQ_F_LEVEL_LOW = 0x7,
  L4_IRQ_F_POS_EDGE = 0x1, L4_IRQ_F_NEG_EDGE = 0x5, L4_IRQ_F_BOTH_EDGE = 0x9, L4_IRQ_F_MASK = 0xf
}
 Interrupt flow types. More...

Functions

l4_msgtag_t l4_irq_attach (l4_cap_idx_t irq, l4_umword_t label, l4_cap_idx_t thread) L4_NOTHROW
 Attach to an interrupt source.
l4_msgtag_t l4_irq_chain (l4_cap_idx_t irq, l4_umword_t label, l4_cap_idx_t slave) L4_NOTHROW
 Chain an IRQ to another master IRQ source.
l4_msgtag_t l4_irq_detach (l4_cap_idx_t irq) L4_NOTHROW
 Detach from an interrupt source.
l4_msgtag_t l4_irq_trigger (l4_cap_idx_t irq) L4_NOTHROW
 Trigger an IRQ.
l4_msgtag_t l4_irq_receive (l4_cap_idx_t irq, l4_timeout_t to) L4_NOTHROW
 Unmask and wait for specified IRQ.
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.
l4_msgtag_t l4_irq_unmask (l4_cap_idx_t irq) L4_NOTHROW
 Unmask IRQ.

Detailed Description

The IRQ and ICU class.

#include <l4/sys/irq.h>

The IRQ class provides access to abstract interrupts provided by the micro kernel. Interrupts may be hardware interrupts provided by the platform interrupt controller, virtual device interrupts provided by the micro kernel virtual devices (virtual serial or trace buffer), or IRQs (virtual interrupts that can be triggered by user programs).

IRQ objects can be created using a Factory, see Factory (l4_factory_create_irq()).

Enumeration Type Documentation

Interrupt flow types.

Enumerator:
L4_IRQ_F_NONE 

None.

L4_IRQ_F_LEVEL 

Level triggered.

L4_IRQ_F_EDGE 

Edge triggered.

L4_IRQ_F_POS 

Positive trigger.

L4_IRQ_F_NEG 

Negative trigger.

L4_IRQ_F_BOTH 

Both edges trigger.

L4_IRQ_F_LEVEL_HIGH 

Level high trigger.

L4_IRQ_F_LEVEL_LOW 

Level low trigger.

L4_IRQ_F_POS_EDGE 

Positive edge trigger.

L4_IRQ_F_NEG_EDGE 

Negative edge trigger.

L4_IRQ_F_BOTH_EDGE 

Both edges trigger.

L4_IRQ_F_MASK 

Mask.

Definition at line 61 of file icu.h.

Function Documentation

l4_msgtag_t l4_irq_attach ( l4_cap_idx_t  irq,
l4_umword_t  label,
l4_cap_idx_t  thread 
)
inline

Attach to an interrupt source.

Parameters
irqIRQ to attach to.
labelIdentifier of the IRQ.
threadThread to attach the interrupt to.
Returns
Syscall return tag
Examples:
examples/sys/isr/main.c.

Definition at line 281 of file irq.h.

References l4_utcb().

+ Here is the call graph for this function:

l4_msgtag_t l4_irq_chain ( l4_cap_idx_t  irq,
l4_umword_t  label,
l4_cap_idx_t  slave 
)
inline

Chain an IRQ to another master IRQ source.

The chaining feature of IRQ objects allows to deal with shared IRQs. For chaining IRQs there must be a master IRQ object, bound to the real IRQ source. Note, the master IRQ must not have a thread attached to it. This function allows to add a limited number of slave IRQs to this master IRQ, with the semantics that each of the slave IRQs is triggered whenever the master IRQ is triggered. The master IRQ will be masked automatically when an IRQ is delivered and shall be unmasked when all attached slave IRQs are unmasked.

Parameters
irqThe master IRQ object.
labelIdentifier of the IRQ.
slaveThe slave that shall be attached to the master.
Returns
Syscall return tag

Definition at line 288 of file irq.h.

References l4_utcb().

+ Here is the call graph for this function:

l4_msgtag_t l4_irq_detach ( l4_cap_idx_t  irq)
inline

Detach from an interrupt source.

Parameters
irqIRQ to detach from.
Returns
Syscall return tag
Examples:
examples/sys/isr/main.c.

Definition at line 295 of file irq.h.

References l4_utcb().

+ Here is the call graph for this function:

l4_msgtag_t l4_irq_trigger ( l4_cap_idx_t  irq)
inline

Trigger an IRQ.

Parameters
irqIRQ to trigger.
Precondition
irq must be a reference to an IRQ.
Returns
Syscall return tag.

Note that this function is a send only operation, i.e. there is no return value except for a failed send operation. Especially l4_error() will return an error value from the message tag which still contains the IRQ protocol used for the send operation.

Use l4_ipc_error() to check for (send) errors.

Definition at line 301 of file irq.h.

References l4_utcb().

+ Here is the call graph for this function:

l4_msgtag_t l4_irq_receive ( l4_cap_idx_t  irq,
l4_timeout_t  to 
)
inline

Unmask and wait for specified IRQ.

Parameters
irqIRQ to wait for.
toTimeout.
Returns
Syscall return tag
Examples:
examples/sys/isr/main.c.

Definition at line 307 of file irq.h.

References l4_utcb().

Referenced by L4Re::Util::Event_buffer_consumer_t< PAYLOAD >::process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

l4_msgtag_t l4_irq_wait ( l4_cap_idx_t  irq,
l4_umword_t label,
l4_timeout_t  to 
)
inline

Unmask IRQ and wait for any message.

Parameters
irqIRQ to wait for.
labelReceive label.
toTimeout.
Returns
Syscall return tag

Definition at line 313 of file irq.h.

References l4_utcb().

+ Here is the call graph for this function:

l4_msgtag_t l4_irq_unmask ( l4_cap_idx_t  irq)
inline

Unmask IRQ.

Parameters
irqIRQ to unmask.
Returns
Syscall return tag
Note
l4_irq_wait and l4_irq_receive are doing the unmask themselves.

Definition at line 320 of file irq.h.

References l4_utcb().

+ Here is the call graph for this function:

L4Re - L4 Runtime Environment