19#include <l4/re/util/event_buffer>
21#include <l4/cxx/type_traits>
23namespace L4Re {
namespace Util {
31template<
typename PAYLOAD >
58 template<
typename IRQ_TYPE>
64 if (!ev_ds.is_valid())
70 if (!ev_irq.is_valid())
73 if ((r =
l4_error(env->factory()->create(ev_irq.get()))))
76 if ((r =
l4_error(event->bind(0, ev_irq.get()))))
79 if ((r = event->get_buffer(ev_ds.get())))
82 long sz = ev_ds->size();
88 if ((r = env->rm()->attach(&buf, sz,
94 _ev_ds = cxx::move(ev_ds);
95 _ev_irq = cxx::move(ev_irq);
96 _buf = cxx::move(buf);
117 if (!ev_ds.is_valid())
122 if ((r = event->get_buffer(ev_ds.get())))
125 long sz = ev_ds->size();
131 if ((r = env->rm()->attach(&buf, sz,
137 _ev_ds = cxx::move(ev_ds);
138 _buf = cxx::move(buf);
164typedef Event_t<Default_event_payload>
Event;
Abstract capability-allocator interface.
Capability allocator interface.
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::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::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.