2 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3 * Alexander Warg <warg@os.inf.tu-dresden.de>
4 * economic rights: Technische Universität Dresden (Germany)
6 * This file is part of TUD:OS and distributed under the terms of the
7 * GNU General Public License 2.
8 * Please see the COPYING-GPL-2 file for details.
10 * As a special exception, you may use this file as part of a free software
11 * library without restriction. Specifically, if other files instantiate
12 * templates or use macros or inline functions from this file, or you compile
13 * this file and link it with other files to produce an executable, this
14 * file does not by itself cause the resulting executable to be covered by
15 * the GNU General Public License. This exception does not however
16 * invalidate any other reasons why the executable file might be covered by
17 * the GNU General Public License.
19 #include <l4/re/event>
20 #include <l4/re/event-sys.h>
21 #include <l4/re/dataspace>
22 #include <l4/re/protocols>
24 #include <l4/sys/err.h>
26 #include <l4/cxx/ipc_stream>
34 Event::get_buffer(L4::Cap<Dataspace> ds) const throw()
36 L4::Ipc::Iostream io(l4_utcb());
37 io << Opcode(Event_::Get);
38 io << L4::Ipc::Small_buf(ds.cap());
39 return l4_error(io.call(cap(), L4Re::Protocol::Event));
43 Event::get_num_streams() const throw()
45 L4::Ipc::Iostream io(l4_utcb());
46 io << Opcode(Event_::Get_num_streams);
47 return l4_error(io.call(cap(), L4Re::Protocol::Event));
51 Event::get_stream_info(int idx, Event_stream_info *info) const throw()
53 L4::Ipc::Iostream io(l4_utcb());
54 io << Opcode(Event_::Get_stream_info) << idx;
55 long res = l4_error(io.call(cap(), L4Re::Protocol::Event));
64 Event::get_stream_info_for_id(l4_umword_t id, Event_stream_info *info) const throw()
66 L4::Ipc::Iostream io(l4_utcb());
67 io << Opcode(Event_::Get_stream_info_for_id) << id;
68 long res = l4_error(io.call(cap(), L4Re::Protocol::Event));
77 Event::get_axis_info(l4_umword_t id, unsigned naxes, unsigned *axis,
78 Event_absinfo *info) const throw()
80 L4::Ipc::Iostream io(l4_utcb());
81 io << Opcode(Event_::Get_axis_info) << id << L4::Ipc::buf_cp_out(axis, naxes);
82 long res = l4_error(io.call(cap(), L4Re::Protocol::Event));
86 long unsigned a = naxes;
87 io >> L4::Ipc::buf_cp_in(info, a);
92 Event::get_stream_state_for_id(l4_umword_t stream_id, Event_stream_state *state) const throw()
94 L4::Ipc::Iostream io(l4_utcb());
95 io << Opcode(Event_::Get_stream_state_for_id) << stream_id;
96 long res = l4_error(io.call(cap(), L4Re::Protocol::Event));