L4Re - L4 Runtime Environment
L4::Irq Class Reference

C++ Irq interface. More...

+ Inheritance diagram for L4::Irq:
+ Collaboration diagram for L4::Irq:

Public Member Functions

l4_msgtag_t attach (l4_umword_t label, Cap< Thread > const &thread=Cap< Thread >::Invalid, l4_utcb_t *utcb=l4_utcb()) throw ()
 Attach a thread to this interrupt. More...
 
l4_msgtag_t detach (l4_utcb_t *utcb=l4_utcb()) throw ()
 Detach from this interrupt. More...
 
l4_msgtag_t receive (l4_timeout_t timeout=L4_IPC_NEVER, l4_utcb_t *utcb=l4_utcb()) throw ()
 Unmask and wait for this IRQ. More...
 
l4_msgtag_t wait (l4_umword_t *label, l4_timeout_t timeout=L4_IPC_NEVER, l4_utcb_t *utcb=l4_utcb()) throw ()
 Unmask IRQ and (open) wait for any message. More...
 
l4_msgtag_t unmask (l4_utcb_t *utcb=l4_utcb()) throw ()
 Unmask IRQ. More...
 
- Public Member Functions inherited from L4::Triggerable
l4_msgtag_t trigger (l4_utcb_t *utcb=l4_utcb()) throw ()
 Trigger. More...
 
- Public Member Functions inherited from L4::Irq_eoi
l4_msgtag_t unmask (unsigned irqnum, l4_umword_t *label=0, l4_timeout_t to=L4_IPC_NEVER, l4_utcb_t *utcb=l4_utcb()) throw ()
 Acknowledge the given interrupt line. More...
 
- Public Member Functions inherited from L4::Rcv_endpoint
l4_msgtag_t bind_thread (Ipc::Opt< Ipc::Cap< Thread > > t, l4_umword_t label)
 Bind a thread to an IPC receive endpoint. More...
 
- Public Member Functions inherited from L4::Kobject
l4_msgtag_t dec_refcnt (l4_mword_t diff, l4_utcb_t *utcb=l4_utcb())
 Decrement the in kernel reference counter for the object. More...
 

Additional Inherited Members

- Protected Types inherited from L4::Kobject_2t< Irq, Triggerable, Rcv_endpoint, L4_PROTO_IRQ_SENDER >
typedef Irq Class
 The target interface type (inheriting from Kobject_t) More...
 
typedef Typeid::Iface< PROTO, Irq__Iface
 The interface description for the derived class. More...
 
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, Typeid::Merge_list< typename Triggerable ::__Iface_list, typename Rcv_endpoint ::__Iface_list > > __Iface_list
 The list of all RPC interfaces provided directly or through inheritance. More...
 
- Protected Types inherited from L4::Kobject_t< Triggerable, Irq_eoi, L4_PROTO_IRQ >
typedef Triggerable Class
 The target interface type (inheriting from Kobject_t)
 
typedef Typeid::Iface< PROTO, Triggerable__Iface
 The interface description for the derived class.
 
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, typename Irq_eoi ::__Iface_list > __Iface_list
 The list of all RPC interfaces provided directly or through inheritance.
 
- Protected Types inherited from L4::Kobject_t< Rcv_endpoint, Kobject, L4_PROTO_KOBJECT, Type_info::Demand_t< 1 > >
typedef Rcv_endpoint Class
 The target interface type (inheriting from Kobject_t)
 
typedef Typeid::Iface< PROTO, Rcv_endpoint__Iface
 The interface description for the derived class.
 
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, typename Kobject ::__Iface_list > __Iface_list
 The list of all RPC interfaces provided directly or through inheritance.
 
- Protected Member Functions inherited from L4::Kobject_2t< Irq, Triggerable, Rcv_endpoint, L4_PROTO_IRQ_SENDER >
L4::Cap< Classc () const
 Get the capability to ourselves. More...
 
- Protected Member Functions inherited from L4::Kobject_t< Triggerable, Irq_eoi, L4_PROTO_IRQ >
L4::Cap< Classc () const
 Get the capability to ourselves.
 
- Protected Member Functions inherited from L4::Kobject_t< Rcv_endpoint, Kobject, L4_PROTO_KOBJECT, Type_info::Demand_t< 1 > >
L4::Cap< Classc () const
 Get the capability to ourselves.
 
- Protected Member Functions inherited from L4::Kobject
l4_cap_idx_t cap () const throw ()
 Return capability selector. More...
 
- Static Protected Member Functions inherited from L4::Kobject_2t< Irq, Triggerable, Rcv_endpoint, L4_PROTO_IRQ_SENDER >
static void __check_protocols__ ()
 
- Static Protected Member Functions inherited from L4::Kobject_t< Triggerable, Irq_eoi, L4_PROTO_IRQ >
static void __check_protocols__ ()
 Helper to check for protocol conflicts.
 
- Static Protected Member Functions inherited from L4::Kobject_t< Rcv_endpoint, Kobject, L4_PROTO_KOBJECT, Type_info::Demand_t< 1 > >
static void __check_protocols__ ()
 Helper to check for protocol conflicts.
 

Detailed Description

C++ Irq interface.

Note
"IRQ" is short for "interrupt request". This is often used interchangeably for "interrupt"

The Irq class provides access to abstract interrupts provided by the microkernel. Interrupts may be

  • hardware interrupts provided by the platform interrupt controller,
  • virtual device interrupts provided by the microkernel's virtual devices (virtual serial or trace buffer) or
  • virtual interrupts that can be triggered by user programs (IRQs)

Irq objects can be created using a factory, see the L4::Factory API (L4::Factory::create()).

Include File
#include <l4/sys/irq>

For the C interface refer to the IRQs API for an overview.

Examples:
examples/libs/l4re/c++/shared_ds/ds_clnt.cc.

Definition at line 117 of file irq.

Member Function Documentation

◆ attach()

l4_msgtag_t L4::Irq::attach ( l4_umword_t  label,
Cap< Thread > const &  thread = Cap<Thread>::Invalid,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Attach a thread to this interrupt.

Parameters
labelIdentifier of the IRQ (protected label used for messages)
threadCapability of the thread to attach the IRQ to.
utcbUTCB to be used for this operation, usually the UTCB of the calling thread.
Returns
Syscall return tag

The protected label is stored in the kernel and sent to the attached thread with the IRQ-triggered notification. It allows the receiver thread to securely identify the IRQ.

Deprecated:
Use bind_thread().

Definition at line 138 of file irq.

◆ detach()

l4_msgtag_t L4::Irq::detach ( l4_utcb_t utcb = l4_utcb())
throw (
)
inline

Detach from this interrupt.

Parameters
utcbUTCB to be used for this operation, usually the UTCB of the calling thread.
Returns
Syscall return tag

Definition at line 156 of file irq.

◆ receive()

l4_msgtag_t L4::Irq::receive ( l4_timeout_t  timeout = L4_IPC_NEVER,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Unmask and wait for this IRQ.

Parameters
timeoutTimeout.
utcbUTCB to be used for this operation, usually the UTCB of the calling thread.
Returns
Syscall return tag
Note
If this is the function normally used for your IRQs consider using L4::Semaphore instead of L4::Irq.

Definition at line 171 of file irq.

◆ unmask()

l4_msgtag_t L4::Irq::unmask ( l4_utcb_t utcb = l4_utcb())
throw (
)
inline

Unmask IRQ.

Parameters
utcbUTCB to be used for this operation, usually the UTCB of the calling thread.
Returns
Syscall return tag for a send-only operation, use l4_ipc_error() to check for errors (do not use l4_error()).
Note
This function is a send-only operation, this means there is no return value except for a failed send operation. Use l4_ipc_error() to check for errors, do not use l4_error(), because l4_error() will always return an error.

Irq::wait() and Irq::receive() operations already include an unmask(), do not use an extra unmask() in these cases.

Deprecated:
Use L4::Irq_eoi::unmask()

Definition at line 207 of file irq.

◆ wait()

l4_msgtag_t L4::Irq::wait ( l4_umword_t label,
l4_timeout_t  timeout = L4_IPC_NEVER,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Unmask IRQ and (open) wait for any message.

Parameters
labelThe protected label shall be received here.
timeoutTimeout.
utcbUTCB to be used for this operation, usually the UTCB of the calling thread.
Returns
Syscall return tag

Definition at line 184 of file irq.


The documentation for this class was generated from the following file: