17#include <l4/sys/cxx/ipc_legacy>
19namespace L4Re {
namespace Util {
21template<
typename ICU >
25 ICU
const *this_icu()
const {
return static_cast<ICU
const *
>(
this); }
26 ICU *this_icu() {
return static_cast<ICU*
>(
this); }
29 L4_RPC_LEGACY_DISPATCH(
L4::Icu);
35 int op_info(L4::Icu::Rights, L4::Icu::_Info &info);
36 int op_msi_info(L4::Icu::Rights,
l4_umword_t irqnum,
44template<
typename ICU>
inline
46Icu_svr<ICU>::op_bind(L4::Icu::Rights,
l4_umword_t irqnum,
49 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
53 return irq->bind(this_icu(), irq_fp);
56template<
typename ICU>
inline
58Icu_svr<ICU>::op_unbind(L4::Icu::Rights,
l4_umword_t irqnum,
61 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
65 return irq->unbind(this_icu(), irq_fp);
68template<
typename ICU>
inline
70Icu_svr<ICU>::op_info(L4::Icu::Rights, L4::Icu::_Info &info)
73 this_icu()->icu_get_info(&i);
80template<
typename ICU>
inline
82Icu_svr<ICU>::op_msi_info(L4::Icu::Rights,
l4_umword_t irqnum,
85 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
88 return irq->msi_info(source, &info);
91template<
typename ICU>
inline
93Icu_svr<ICU>::op_mask(L4::Icu::Rights,
l4_umword_t irqnum)
95 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
101template<
typename ICU>
inline
103Icu_svr<ICU>::op_unmask(L4::Icu::Rights,
l4_umword_t irqnum)
105 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
112template<
typename ICU >
113class Icu_cap_array_svr :
public Icu_svr<ICU>
130 ~Irq() { ICU::free_irq_cap(_cap); }
140 void mask(
bool )
const
158 Icu_cap_array_svr(
unsigned nr_irqs, Irq *irqs)
159 : _irqs(irqs), _nr_irqs(nr_irqs)
164 if (irqnum >= _nr_irqs)
167 return _irqs + irqnum;
178template<
typename ICU >
189 int r = cfb->server_iface()->realloc_rcv_cap(0);
193 ICU::free_irq_cap(_cap);
198template<
typename ICU >
202 ICU::free_irq_cap(_cap);
void free(L4::Cap< void > cap, l4_cap_idx_t task=L4_INVALID_CAP, unsigned unmap_flags=L4_FP_ALL_SPACES) noexcept override
Free a capability.
void invalidate() noexcept
Set this capability to invalid (L4_INVALID_CAP).
C++ interface for capabilities.
C++ Icu interface, see Interrupt controller for the C interface.
Send item or return item.
bool cap_received() const noexcept
*(Defined for return items only.)* Check if at least one object capability has been mapped for this i...
unsigned long l4_umword_t
Unsigned machine word.
unsigned long long l4_uint64_t
Unsigned 64bit value.
@ L4_EINVAL
Invalid argument.
_Cap_alloc & cap_alloc
Capability allocator.
Common L4 ABI Data Types.
Info structure for an ICU.
unsigned nr_msis
The number of MSI vectors supported by the ICU,.
unsigned nr_irqs
The number of IRQ lines supported by the ICU,.
unsigned features
Feature flags.
Info to use for a specific MSI.
Common task related definitions.