30#include <l4/re/util/event_buffer>
32#include <l4/cxx/type_traits>
34namespace L4Re {
namespace Util {
42template<
typename PAYLOAD >
69 template<
typename IRQ_TYPE>
75 if (!ev_ds.is_valid())
81 if (!ev_irq.is_valid())
84 if ((r =
l4_error(env->factory()->create(ev_irq.get()))))
87 if ((r =
l4_error(event->bind(0, ev_irq.get()))))
90 if ((r = event->get_buffer(ev_ds.get())))
93 long sz = ev_ds->size();
99 if ((r = env->rm()->attach(&buf, sz,
105 _ev_ds = cxx::move(ev_ds);
106 _ev_irq = cxx::move(ev_irq);
107 _buf = cxx::move(buf);
128 if (!ev_ds.is_valid())
133 if ((r = event->get_buffer(ev_ds.get())))
136 long sz = ev_ds->size();
142 if ((r = env->rm()->attach(&buf, sz,
148 _ev_ds = cxx::move(ev_ds);
149 _buf = cxx::move(buf);
175typedef Event_t<Default_event_payload>
Event;
Abstract capability-allocator interface.
Capability allocator interface.
static L4Re::Cap_alloc * get_cap_alloc(CAP_ALLOC &ca)
Construct an instance of a capability allocator.
Interface for memory-like objects.
C++ interface of the initial environment that is provided to an L4 task.
static Env const * env() noexcept
Returns the initial environment for the current task.
T get() const noexcept
Return the address.
Convenience wrapper for getting access to an event object.
int init_poll(L4::Cap< L4Re::Event > event, L4Re::Env const *env=L4Re::Env::env(), L4Re::Cap_alloc *ca=L4Re::Cap_alloc::get_cap_alloc(L4Re::Util::cap_alloc))
Initialise an event object in polling mode.
L4::Cap< L4::Triggerable > irq() const
Get event IRQ.
int init(L4::Cap< L4Re::Event > event, L4Re::Env const *env=L4Re::Env::env(), L4Re::Cap_alloc *ca=L4Re::Cap_alloc::get_cap_alloc(L4Re::Util::cap_alloc))
Initialise an event object.
@ Mode_irq
Create an IRQ and attach, to get notifications.
@ Mode_polling
Do not use an IRQ.
L4Re::Event_buffer_t< PAYLOAD > & buffer()
Get event buffer.
C++ interface for capabilities.
Common factory related definitions.
long l4_error(l4_msgtag_t tag) L4_NOTHROW
Get IPC error code if any or message tag label otherwise for an IPC call.
_Cap_alloc & cap_alloc
Capability allocator.
L4::Detail::Unique_cap_impl< T, Smart_cap_auto< L4_FP_ALL_SPACES > > Unique_cap
Unique capability that implements automatic free and unmap of the capability selector.
L4::Detail::Unique_cap_impl< T, Smart_cap_auto< L4_FP_DELETE_OBJ > > Unique_del_cap
Unique capability that implements automatic free and unmap+delete of the capability selector.
Cap< T > make_cap_rw(L4::Cap< T > cap) noexcept
Make an L4::Ipc::Cap<T> for the given capability with L4_CAP_FPAGE_RW rights.
@ RW
Readable and writable region.
@ Search_addr
Search for a suitable address range.
Unique_cap / Unique_del_cap.