26#include <l4/sys/cxx/ipc_array>
51typedef l4re_event_stream_id_t Event_stream_id;
52typedef l4re_event_absinfo_t Event_absinfo;
57 static unsigned __get_idx(
unsigned idx)
58 {
return idx / (
sizeof(
unsigned long)*8); }
60 static unsigned long __get_mask(
unsigned idx)
61 {
return 1ul << (idx % (
sizeof(
unsigned long)*8)); }
63 static bool __get_bit(
unsigned long const *bm,
unsigned max,
unsigned idx)
66 return bm[__get_idx(idx)] & __get_mask(idx);
70 static void __set_bit(
unsigned long *bm,
unsigned max,
unsigned idx,
bool v)
76 bm[__get_idx(idx)] |= __get_mask(idx);
78 bm[__get_idx(idx)] &= ~__get_mask(idx);
83:
public l4re_event_stream_info_t,
84 private Event_stream_bitmap_h
87 bool get_propbit(
unsigned idx)
const
88 {
return __get_bit(propbits, L4RE_EVENT_PROP_MAX, idx); }
90 void set_propbit(
unsigned idx,
bool v)
91 { __set_bit(propbits, L4RE_EVENT_PROP_MAX, idx, v); }
93 bool get_evbit(
unsigned idx)
const
94 {
return __get_bit(evbits, L4RE_EVENT_EV_MAX, idx); }
96 void set_evbit(
unsigned idx,
bool v)
97 { __set_bit(evbits, L4RE_EVENT_EV_MAX, idx, v); }
99 bool get_keybit(
unsigned idx)
const
100 {
return __get_bit(keybits, L4RE_EVENT_KEY_MAX, idx); }
102 void set_keybit(
unsigned idx,
bool v)
103 { __set_bit(keybits, L4RE_EVENT_KEY_MAX, idx, v); }
105 bool get_relbit(
unsigned idx)
const
106 {
return __get_bit(relbits, L4RE_EVENT_REL_MAX, idx); }
108 void set_relbit(
unsigned idx,
bool v)
109 { __set_bit(relbits, L4RE_EVENT_REL_MAX, idx, v); }
111 bool get_absbit(
unsigned idx)
const
112 {
return __get_bit(absbits, L4RE_EVENT_ABS_MAX, idx); }
114 void set_absbit(
unsigned idx,
bool v)
115 { __set_bit(absbits, L4RE_EVENT_ABS_MAX, idx, v); }
117 bool get_swbit(
unsigned idx)
const
118 {
return __get_bit(swbits, L4RE_EVENT_SW_MAX, idx); }
120 void set_swbit(
unsigned idx,
bool v)
121 { __set_bit(swbits, L4RE_EVENT_SW_MAX, idx, v); }
125:
public l4re_event_stream_state_t,
126 private Event_stream_bitmap_h
129 bool get_keybit(
unsigned idx)
const
130 {
return __get_bit(keybits, L4RE_EVENT_KEY_MAX, idx); }
132 void set_keybit(
unsigned idx,
bool v)
133 { __set_bit(keybits, L4RE_EVENT_KEY_MAX, idx, v); }
135 bool get_swbit(
unsigned idx)
const
136 {
return __get_bit(swbits, L4RE_EVENT_SW_MAX, idx); }
138 void set_swbit(
unsigned idx,
bool v)
139 { __set_bit(swbits, L4RE_EVENT_SW_MAX, idx, v); }
181 L4_RPC(
long, get_stream_info, (
int idx, Event_stream_info *info));
209 unsigned const *axis, Event_absinfo *info)
const noexcept
212 return get_axis_info_t::call(c(), stream_id,
226 Event_stream_state *state));
232 get_stream_info_for_id_t,
234 get_stream_state_for_id_t
255template<
typename PAYLOAD = Default_event_payload >
282 if (_current == _end)
288 Event_buffer_t() : _current(0), _begin(0), _end(0) {}
292 for (Event *i = _begin; i != _end; ++i)
304 : _current(static_cast<
Event*>(buffer)), _begin(_current),
305 _end(_begin + size / sizeof(
Event))
337 c->payload = ev.payload;
344typedef Event_buffer_t<Default_event_payload> Event_buffer;
L4::Cap related definitions.
Event_buffer_t(void *buffer, l4_addr_t size)
Initialize event buffer.
Event * next() noexcept
Next event in buffer.
bool put(Event const &ev) noexcept
Put event into buffer at current position.
long get_axis_info(l4_umword_t stream_id, unsigned naxes, unsigned const *axis, Event_absinfo *info) const noexcept
Get event stream axis infos.
C++ interface for capabilities.
Helper class to create an L4Re interface class that is derived from a single base class.
unsigned long l4_umword_t
Unsigned machine word.
unsigned long l4_addr_t
Address type.
void l4_wmb(void)
Write memory barrier.
void l4_mb(void)
Memory barrier.
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Interface Definition Language.
#define L4_RPC(res, name, args, attr...)
Define an RPC call (type and callable).
#define L4_RPC_NF(res, name, args...)
Define an RPC call type (the type only, no callable).
Default event stream payload.
l4_umword_t stream_id
Stream ID.
unsigned short code
Code of event.
unsigned short type
Type of event.
Event structure used in buffer.
void free() noexcept
Free the entry.
long long time
Event time stamp.
Array data type for dynamically sized arrays in RPCs.
Mark an argument as a output value in an RPC signature.
Standard list of RPCs of an interface.