L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4::Icu Class Reference

C++ Icu interface, see Interrupt controller for the C interface. More...

#include <irq>

+ Inheritance diagram for L4::Icu:
+ Collaboration diagram for L4::Icu:

Data Structures

class  Info
 This class encapsulates information about an ICU. More...
 

Public Member Functions

l4_msgtag_t bind (unsigned irqnum, L4::Cap< Triggerable > irq, l4_utcb_t *utcb=l4_utcb()) noexcept
 Bind an interrupt line of an interrupt controller to an interrupt object.
 
l4_msgtag_t unbind (unsigned irqnum, L4::Cap< Triggerable > irq, l4_utcb_t *utcb=l4_utcb()) noexcept
 Remove binding of an interrupt line from the interrupt controller object.
 
l4_msgtag_t info (l4_icu_info_t *info, l4_utcb_t *utcb=l4_utcb()) noexcept
 Get information about the ICU features.
 
l4_msgtag_t msi_info (l4_umword_t irqnum, l4_uint64_t source, l4_icu_msi_info_t *msi_info)
 Get MSI info about IRQ.
 
l4_msgtag_t mask (unsigned irqnum, l4_umword_t *label=0, l4_timeout_t to=L4_IPC_NEVER, l4_utcb_t *utcb=l4_utcb()) noexcept
 Mask an IRQ line.
 
l4_msgtag_t set_mode (unsigned irqnum, l4_umword_t mode, l4_utcb_t *utcb=l4_utcb()) noexcept
 Set interrupt mode.
 
- 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()) noexcept
 Unmask the given interrupt line.
 

Additional Inherited Members

- Protected Types inherited from L4::Kobject_t< Icu, Irq_eoi, L4_PROTO_IRQ, Type_info::Demand_t< 1 > >
typedef Icu Class
 The target interface type (inheriting from Kobject_t)
 
typedef Typeid::Iface< PROTO, Icu__Iface
 The interface description for the derived class.
 
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, typename Base::__Iface_list > __Iface_list
 The list of all RPC interfaces provided directly or through inheritance.
 
- Protected Member Functions inherited from L4::Kobject_t< Icu, Irq_eoi, L4_PROTO_IRQ, Type_info::Demand_t< 1 > >
L4::Cap< Classc () const noexcept
 Get the capability to ourselves.
 
- Static Protected Member Functions inherited from L4::Kobject_t< Icu, Irq_eoi, L4_PROTO_IRQ, Type_info::Demand_t< 1 > >
static void __check_protocols__ () noexcept
 Helper to check for protocol conflicts.
 

Detailed Description

C++ Icu interface, see Interrupt controller for the C interface.

Note
"ICU" is short for "interrupt control unit".

This class defines the interface for interrupt controllers. It defines functions for binding L4::Irq objects to interrupt lines and other interrupt sources, as well as functions for masking and unmasking of interrupts.

To setup an interrupt line the following steps are required:

  1. set_mode() (optional if interrupt has a default mode)
  2. L4::Rcv_endpoint::bind_thread() to attach the L4::Irq object to a thread
  3. bind()
  4. unmask() to receive the first interrupt

For certain interrupt sources only some of these steps are necessary and supported, see L4::Scheduler and L4::Vcon.

At most one L4::Irq object can be bound to a certain interrupt source and a certain L4::Irq object can be bound to at most one interrupt source.

Include File
#include <l4/sys/icu>
Interrupt controller.

Definition at line 257 of file irq.

Member Function Documentation

◆ bind()

l4_msgtag_t L4::Icu::bind ( unsigned  irqnum,
L4::Cap< Triggerable irq,
l4_utcb_t utcb = l4_utcb() 
)
inlinenoexcept

Bind an interrupt line of an interrupt controller to an interrupt object.

Parameters
irqnumIRQ line at the ICU.
irqIRQ object for the given IRQ line to bind to this ICU.
utcbUTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.
Returns
Syscall return tag. The caller should check the return value using l4_error() to check for errors and to identify the correct method for unmasking the interrupt. Return values < 0 indicate an error. A return value of 0 means a direct unmask via the IRQ object using L4::Irq::unmask. A return value of 1 means that the interrupt has to be unmasked via the ICU using L4::Icu::unmask.
Return values
-L4_EINVALirq is bound to an interrupt source.
-L4_EPERMThe ICU instance requires L4_CAP_FPAGE_W on irq and L4_CAP_FPAGE_W was not present.

In case the irq is already bound to an interrupt source, it is unbound first. In case the irq is bound and the interrupt source is bound to a different L4::Irq object, only the unbinding happens. An L4::Irq object that is bound to an interrupt source will get unbound if the L4::Irq object is deleted.

Definition at line 316 of file irq.

References L4::Cap_base::cap(), and l4_icu_bind_u().

Referenced by L4virtio::Driver::Device::bind_notification_irq(), and L4virtio::Driver::Device::driver_connect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ info()

l4_msgtag_t L4::Icu::info ( l4_icu_info_t info,
l4_utcb_t utcb = l4_utcb() 
)
inlinenoexcept

Get information about the ICU features.

Parameters
[out]infoInfo structure to be filled with information.
utcbUTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.
Returns
Syscall return tag

Definition at line 351 of file irq.

References info(), and l4_icu_info_u().

Referenced by info().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mask()

l4_msgtag_t L4::Icu::mask ( unsigned  irqnum,
l4_umword_t label = 0,
l4_timeout_t  to = L4_IPC_NEVER,
l4_utcb_t utcb = l4_utcb() 
)
inlinenoexcept

Mask an IRQ line.

Parameters
irqnumIRQ line at the ICU.
labelIf NULL, this function is a send-only message to the ICU. If not NULL, this function will enter an open wait after sending the mask message and the received label is returned here.
toThe timeout-pair (send and receive) that shall be used for this operation. The receive timeout is used with a non-NULL label only.
utcbUTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.
Returns
Syscall return tag. If label is NULL, this function performs an IPC send-only operation and there is no return value except L4_MSGTAG_ERROR indicating success or failure of the send operation. In this case use l4_ipc_error() to check for errors and do not use l4_error().

Definition at line 399 of file irq.

References l4_icu_mask_u().

+ Here is the call graph for this function:

◆ msi_info()

l4_msgtag_t L4::Icu::msi_info ( l4_umword_t  irqnum,
l4_uint64_t  source,
l4_icu_msi_info_t msi_info 
)

Get MSI info about IRQ.

Parameters
irqnumIRQ line at the ICU.
sourcePlatform dependent requester ID for MSIs. On IA32 we use a 20bit source filter value as described in the Intel IRQ remapping specification.
[out]msi_infoA l4_icu_msi_info_t structure receiving the address and the data value to trigger this MSI.
Returns
Syscall return tag

◆ set_mode()

l4_msgtag_t L4::Icu::set_mode ( unsigned  irqnum,
l4_umword_t  mode,
l4_utcb_t utcb = l4_utcb() 
)
inlinenoexcept

Set interrupt mode.

Parameters
irqnumIRQ line at the ICU.
modeMode, see L4_irq_mode.
utcbUTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.
Returns
Syscall return tag

Definition at line 427 of file irq.

References l4_icu_set_mode_u().

+ Here is the call graph for this function:

◆ unbind()

l4_msgtag_t L4::Icu::unbind ( unsigned  irqnum,
L4::Cap< Triggerable irq,
l4_utcb_t utcb = l4_utcb() 
)
inlinenoexcept

Remove binding of an interrupt line from the interrupt controller object.

Parameters
irqnumIRQ line at the ICU.
irqIRQ object to remove from the ICU.
utcbUTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.
Returns
Syscall return tag

Definition at line 334 of file irq.

References L4::Cap_base::cap(), and l4_icu_unbind_u().

+ Here is the call graph for this function:

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