L4Re - L4 Runtime Environment
|
The C Icu interface. More...
Data Structures | |
struct | l4_icu_info_t |
Info structure for an ICU. More... | |
Typedefs | |
typedef struct l4_icu_info_t | l4_icu_info_t |
Info structure for an ICU. More... | |
Enumerations | |
enum | L4_icu_flags { L4_ICU_FLAG_MSI } |
Flags for IRQ numbers used for the ICU. More... | |
Functions | |
l4_msgtag_t | l4_icu_bind (l4_cap_idx_t icu, unsigned irqnum, l4_cap_idx_t irq) L4_NOTHROW |
Bind an interrupt line of an interrupt controller to an interrupt object. More... | |
l4_msgtag_t | l4_icu_bind_u (l4_cap_idx_t icu, unsigned irqnum, l4_cap_idx_t irq, l4_utcb_t *utcb) L4_NOTHROW |
Bind an interrupt line of an interrupt controller to an interrupt object. More... | |
l4_msgtag_t | l4_icu_unbind (l4_cap_idx_t icu, unsigned irqnum, l4_cap_idx_t irq) L4_NOTHROW |
Remove binding of an interrupt line from the interrupt controller object. More... | |
l4_msgtag_t | l4_icu_unbind_u (l4_cap_idx_t icu, unsigned irqnum, l4_cap_idx_t irq, l4_utcb_t *utcb) L4_NOTHROW |
Remove binding of an interrupt line from the interrupt controller object. More... | |
l4_msgtag_t | l4_icu_set_mode (l4_cap_idx_t icu, unsigned irqnum, l4_umword_t mode) L4_NOTHROW |
Set interrupt mode. More... | |
l4_msgtag_t | l4_icu_set_mode_u (l4_cap_idx_t icu, unsigned irqnum, l4_umword_t mode, l4_utcb_t *utcb) L4_NOTHROW |
Set interrupt mode. More... | |
l4_msgtag_t | l4_icu_info (l4_cap_idx_t icu, l4_icu_info_t *info) L4_NOTHROW |
Get information about the capabilites of the ICU. More... | |
l4_msgtag_t | l4_icu_info_u (l4_cap_idx_t icu, l4_icu_info_t *info, l4_utcb_t *utcb) L4_NOTHROW |
Get information about the capabilities of the ICU. More... | |
l4_msgtag_t | l4_icu_msi_info (l4_cap_idx_t icu, unsigned irqnum, l4_uint64_t source, l4_icu_msi_info_t *msi_info) L4_NOTHROW |
Get MSI info about IRQ. More... | |
l4_msgtag_t | l4_icu_msi_info_u (l4_cap_idx_t icu, unsigned irqnum, l4_uint64_t source, l4_icu_msi_info_t *msi_info, l4_utcb_t *utcb) L4_NOTHROW |
Get MSI info about IRQ. More... | |
l4_msgtag_t | l4_icu_unmask (l4_cap_idx_t icu, unsigned irqnum, l4_umword_t *label, l4_timeout_t to) L4_NOTHROW |
Unmask an IRQ line. More... | |
l4_msgtag_t | l4_icu_unmask_u (l4_cap_idx_t icu, unsigned irqnum, l4_umword_t *label, l4_timeout_t to, l4_utcb_t *utcb) L4_NOTHROW |
Acknowledge the given interrupt line. More... | |
l4_msgtag_t | l4_icu_mask (l4_cap_idx_t icu, unsigned irqnum, l4_umword_t *label, l4_timeout_t to) L4_NOTHROW |
Mask an IRQ line. More... | |
l4_msgtag_t | l4_icu_mask_u (l4_cap_idx_t icu, unsigned irqnum, l4_umword_t *label, l4_timeout_t to, l4_utcb_t *utcb) L4_NOTHROW |
Mask an IRQ line. More... | |
The C Icu interface.
To setup an IRQ line the following steps are required:
typedef struct l4_icu_info_t l4_icu_info_t |
Info structure for an ICU.
This structure contains information about the features of an ICU.
enum L4_icu_flags |
Flags for IRQ numbers used for the ICU.
Enumerator | |
---|---|
L4_ICU_FLAG_MSI | Flag to denote that the IRQ is actually an MSI. This flag may be used for l4_icu_bind() and l4_icu_unbind() functions to denote that the IRQ number is meant to be an MSI. |
|
inline |
Bind an interrupt line of an interrupt controller to an interrupt object.
icu | ICU object to bind irq to. |
irqnum | IRQ line at the ICU. |
irq | IRQ object to bind to this ICU. |
< 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(). Definition at line 473 of file icu.h.
References l4_icu_bind_u(), and l4_utcb().
|
inline |
Bind an interrupt line of an interrupt controller to an interrupt object.
icu | The ICU objecte to bind irq to. |
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, usually the UTCB of the calling thread. |
< 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. Definition at line 373 of file icu.h.
Referenced by L4::Icu::bind(), and l4_icu_bind().
|
inline |
Get information about the capabilites of the ICU.
icu | The ICU object from which information shall be retrieved. | |
[out] | info | Pointer to an info structure to be filled with information. The memory for this structure has to be allocated by the caller. |
Definition at line 481 of file icu.h.
References l4_icu_info_u(), and l4_utcb().
|
inline |
Get information about the capabilities of the ICU.
icu | The ICU object from which MSI information shall be retrieved. | |
[out] | info | Info structure to be filled with information. |
utcb | UTCB to be used for this operation, usually the UTCB of the calling thread. |
Definition at line 397 of file icu.h.
Referenced by L4::Icu::info(), and l4_icu_info().
|
inline |
Mask an IRQ line.
icu | The ICU object where the IRQ line 'irqnum' shall be masked. |
irqnum | IRQ line at the ICU. |
label | If non-NULL the function also waits for the next message. |
to | Timeout for message to ICU, if unsure use L4_IPC_NEVER. |
|
inline |
Mask an IRQ line.
icu | The ICU object where the IRQ line 'irqnum' shall be masked. |
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. |
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, usually the UTCB of the calling thread. |
Definition at line 460 of file icu.h.
Referenced by L4::Icu::mask().
|
inline |
Get MSI info about IRQ.
icu | The ICU object from which MSI information shall be retrieved. | |
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. |
Definition at line 485 of file icu.h.
References l4_icu_msi_info_u(), and l4_utcb().
|
inline |
Get MSI info about IRQ.
utcb | UTCB to be used for this operation, usually the UTCB of the calling thread. | |
icu | The ICU object from which MSI information shall be retrieved. | |
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. |
Definition at line 411 of file icu.h.
Referenced by l4_icu_msi_info().
|
inline |
Set interrupt mode.
icu | The ICU object. |
irqnum | IRQ line at the ICU. |
mode | Mode, see L4_irq_mode. |
Definition at line 500 of file icu.h.
References l4_icu_set_mode_u(), and l4_utcb().
|
inline |
Set interrupt mode.
icu | The ICU object. |
irqnum | IRQ line at the ICU. |
mode | Mode, see L4_irq_mode. |
utcb | UTCB to be used for this operation, usually the UTCB of the calling thread. |
Definition at line 434 of file icu.h.
Referenced by l4_icu_set_mode(), and L4::Icu::set_mode().
|
inline |
Remove binding of an interrupt line from the interrupt controller object.
icu | The ICU object from where the binding shall be removed. |
irqnum | IRQ line at the ICU. |
irq | IRQ object to remove from the ICU. |
Definition at line 477 of file icu.h.
References l4_icu_unbind_u(), and l4_utcb().
|
inline |
Remove binding of an interrupt line from the interrupt controller object.
icu | The ICU object from where the binding shall be removed. |
irqnum | IRQ line at the ICU. |
irq | IRQ object to remove from the ICU. |
utcb | UTCB to be used for this operation, usually the UTCB of the calling thread. |
Definition at line 385 of file icu.h.
Referenced by l4_icu_unbind(), and L4::Icu::unbind().
|
inline |
Unmask an IRQ line.
icu | The ICU object where the IRQ line shall be unmasked. |
irqnum | IRQ line at the ICU. |
label | If non-NULL the function also waits for the next message. |
to | Timeout for message to ICU, if unsure use L4_IPC_NEVER. |
|
inline |
Acknowledge the given interrupt line.
icu | The ICU object where the IRQ line shall be unmasked. | |
irqnum | The interrupt line that shall be acknowledged. | |
[out] | label | If NULL this is a send-only unmask, if not NULL then this operation enters an open wait and the protected label shall be received 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, usually the UTCB of the calling thread. |
label
is NULL this function is a send-only operation and there is no return value except for a failed send operation. In this case use l4_ipc_error() to check for errors, do not use l4_error(), because l4_error() will always return an error.