12 #include <l4/sys/cxx/ipc_legacy> 14 namespace L4Re {
namespace Util {
16 template<
typename ICU >
20 ICU
const *this_icu()
const {
return static_cast<ICU
const *
>(
this); }
21 ICU *this_icu() {
return static_cast<ICU*
>(
this); }
24 L4_RPC_LEGACY_DISPATCH(
L4::Icu);
30 int op_info(L4::Icu::Rights, L4::Icu::_Info &info);
31 int op_msi_info(L4::Icu::Rights,
l4_umword_t irqnum,
39 template<
typename ICU>
inline 41 Icu_svr<ICU>::op_bind(L4::Icu::Rights,
l4_umword_t irqnum,
44 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
48 return irq->bind(this_icu(), irq_fp);
51 template<
typename ICU>
inline 53 Icu_svr<ICU>::op_unbind(L4::Icu::Rights,
l4_umword_t irqnum,
56 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
60 return irq->unbind(this_icu(), irq_fp);
63 template<
typename ICU>
inline 65 Icu_svr<ICU>::op_info(L4::Icu::Rights, L4::Icu::_Info &info)
68 this_icu()->icu_get_info(&i);
75 template<
typename ICU>
inline 77 Icu_svr<ICU>::op_msi_info(L4::Icu::Rights,
l4_umword_t irqnum,
80 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
83 return irq->msi_info(source, &info);
86 template<
typename ICU>
inline 88 Icu_svr<ICU>::op_mask(L4::Icu::Rights,
l4_umword_t irqnum)
90 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
96 template<
typename ICU>
inline 98 Icu_svr<ICU>::op_unmask(L4::Icu::Rights,
l4_umword_t irqnum)
100 typename ICU::Irq *irq = this_icu()->icu_get_irq(irqnum);
107 template<
typename ICU >
108 class Icu_cap_array_svr :
public Icu_svr<ICU>
125 ~Irq() { ICU::free_irq_cap(_cap); }
128 {
if (_cap) _cap->trigger(); }
132 void mask(
bool mask)
const 150 Icu_cap_array_svr(
unsigned nr_irqs, Irq *irqs)
151 : _irqs(irqs), _nr_irqs(nr_irqs)
156 if (irqnum >= _nr_irqs)
159 return _irqs + irqnum;
170 template<
typename ICU >
181 int r = cfb->server_iface()->realloc_rcv_cap(0);
189 template<
typename ICU >
unsigned features
Feature flags.
bool cap_received() const
Check if the capability has been mapped.
Info to use for a specific MSI.
Common L4 ABI Data Types.
Read-write-execute flex page.
Info structure for an ICU.
Common task related definitions.
Flag to tell the unmap operation to unmap all child mappings including the mapping in the invoked tas...
bool free(L4::Cap< void > cap, l4_cap_idx_t task=L4_INVALID_CAP, unsigned unmap_flags=L4_FP_ALL_SPACES)
Free the capability.
void invalidate()
Set this capability to invalid (L4_INVALID_CAP).
static Env const * env()
Returns the initial environment for the current task.
_Cap_alloc & cap_alloc
Capability allocator.
unsigned long l4_umword_t
Unsigned machine word.
unsigned nr_irqs
The number of IRQ lines supported by the ICU,.
L4::Cap< L4::Task > task() const
Object-capability of the user task.
unsigned nr_msis
The number of MSI vectors supported by the ICU,.
unsigned long long l4_uint64_t
Unsigned 64bit value.
Generic RPC wrapper for L4 flex-pages.