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.
20 #include <l4/re/video/goos>
21 #include <l4/re/video/goos-sys.h>
23 #include <l4/re/dataspace>
24 #include <l4/re/protocols>
26 #include <l4/cxx/ipc_helper>
27 #include <l4/cxx/ipc_stream>
29 #include <l4/sys/err.h>
32 namespace L4Re { namespace Video {
37 Goos::info(Info *info) const throw()
39 L4::Ipc_iostream io(l4_utcb());
40 io << Opcode(Goos_::Info);
41 long err = l4_error(io.call(cap(), L4Re::Protocol::Goos));
42 if (EXPECT_FALSE(err < 0))
50 Goos::get_static_buffer(unsigned idx, L4::Cap<Dataspace> ds) const throw()
52 L4::Ipc_iostream io(l4_utcb());
53 io << Opcode(Goos_::Get_buffer) << idx;
54 io << L4::Small_buf(ds.cap());
55 return l4_error(io.call(cap(), L4Re::Protocol::Goos));
59 Goos::create_buffer(unsigned long size, L4::Cap<Dataspace> ds) const throw()
61 L4::Ipc_iostream io(l4_utcb());
62 io << Opcode(Goos_::Create_buffer) << size;
63 io << L4::Small_buf(ds.cap());
64 return l4_error(io.call(cap(), L4Re::Protocol::Goos));
68 Goos::delete_buffer(unsigned idx) const throw()
70 L4::Ipc_iostream io(l4_utcb());
71 io << Opcode(Goos_::Delete_buffer) << idx;
72 return l4_error(io.call(cap(), L4Re::Protocol::Goos));
76 Goos::create_view(View *view) const throw()
78 L4::Ipc_iostream io(l4_utcb());
79 io << Opcode(Goos_::Create_view);
80 int err = l4_error(io.call(cap(), L4Re::Protocol::Goos));
84 *view = View(cap(), err);
89 Goos::delete_view(View const &v) const throw()
91 L4::Ipc_iostream io(l4_utcb());
92 io << Opcode(Goos_::Delete_view) << v._view_idx;
93 return l4_error(io.call(cap(), L4Re::Protocol::Goos));
97 Goos::refresh(int x, int y, int w, int h) throw()
99 L4::Ipc_iostream io(l4_utcb());
100 io << Opcode(Goos_::Screen_refresh) << x << y << w << h;
101 return l4_error(io.call(cap(), L4Re::Protocol::Goos));