24#include <l4/re/event-sys.h>
29namespace L4Re {
namespace Util {
35template<
typename PAYLOAD >
46 void *
buf() const noexcept {
return _buf; }
61 long r = rm->attach(&_buf, sz,
83 return rm->detach(_buf, &ds);
93template<
typename PAYLOAD >
104 template<
typename CB,
typename D >
125 template<
typename CB,
typename D >
128 CB
const &cb, D data = D())
131 if (
l4_error(irq->bind_thread(thread, 0)))
148typedef Event_buffer_consumer_t<Default_event_payload> Event_buffer_consumer;
An event buffer consumer.
void process(L4::Cap< L4::Irq > irq, L4::Cap< L4::Thread > thread, CB const &cb, D data=D())
Continuously wait for events and process them.
void foreach_available_event(CB const &cb, D data=D())
Call function on every available event.
Event_buffer utility class.
long detach(L4::Cap< L4Re::Rm > rm) noexcept
Detach event buffer from address space.
long attach(L4::Cap< L4Re::Dataspace > ds, L4::Cap< L4Re::Rm > rm) noexcept
Attach event buffer from address space.
void * buf() const noexcept
Return the buffer.
l4_cap_idx_t cap() const noexcept
Return capability selector.
C++ interface for capabilities.
unsigned long l4_addr_t
Address type.
long l4_error(l4_msgtag_t tag) L4_NOTHROW
Get IPC error code if any or message tag label otherwise for an IPC call.
l4_umword_t l4_ipc_error(l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW
Get the IPC error code for an IPC operation.
l4_msgtag_t l4_irq_receive(l4_cap_idx_t irq, l4_timeout_t to) L4_NOTHROW
Unmask and wait for specified IRQ.
#define L4_IPC_NEVER
never timeout
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
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.
Event structure used in buffer.
void free() noexcept
Free the entry.
@ RW
Readable and writable region.
@ Search_addr
Search for a suitable address range.