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 Irq_eoi::__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< Class > | c () 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() or L4::Rcv_endpoint::bind_snd_destination() to attach the L4::Irq object to a send destination.
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>
  icu
  Interrupt controller.

Definition at line 250 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

  irqnum | IRQ line at the ICU.
  irq | IRQ object for the given IRQ line to bind to this ICU.
  utcb | UTCB 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_EINVAL | irq is bound to an interrupt source.
  -L4_EPERM | Insufficient permissions; see precondition.

Precondition
  The capability irq must have the permission L4_CAP_FPAGE_W.

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 310 of file irq.

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

Here is the call 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] | info | Info structure to be filled with information.
  | utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.

Returns
  Syscall return tag

Definition at line 345 of file irq.

References L4::Kobject::cap(), info(), and l4_icu_info_u().

Referenced by L4Re::Event::get_axis_info(), L4Re::Event::get_stream_info(), L4Re::Event::get_stream_info_for_id(), and 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

  irqnum | IRQ line at the ICU.
  label | If 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.
  to | The timeout-pair (send and receive) that shall be used for this operation. The receive timeout is used with a non-NULL label only.
  utcb | UTCB 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 393 of file irq.

References L4::Kobject::cap(), l4_icu_mask_u(), and L4_IPC_NEVER.

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

  | irqnum | IRQ line at the ICU.
  | source | Platform dependent requester ID for MSIs. On IA32 we use a 20bit source filter value as described in the Intel IRQ remapping specification.
  [out] | msi_info | A l4_icu_msi_info_t structure receiving the address and the data value to trigger this MSI.

Returns
  Syscall return tag

References msi_info().

Referenced by msi_info().

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

## 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

  irqnum | IRQ line at the ICU.
  mode | Mode, see L4_irq_mode.
  utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.

Returns
  Syscall return tag

Definition at line 421 of file irq.

References L4::Kobject::cap(), and 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

  irqnum | IRQ line at the ICU.
  irq | IRQ object to remove from the ICU.
  utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.

Returns
  Syscall return tag

Definition at line 328 of file irq.

References L4::Cap_base::cap(), L4::Kobject::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:

- l4/sys/irq