]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re_c/lib/src/video.cc
Inital import
[l4.git] / l4 / pkg / l4re_c / lib / src / video.cc
1 /*
2  * (c) 2008-2009 Technische Universität Dresden
3  * This file is part of TUD:OS and distributed under the terms of the
4  * GNU General Public License 2.
5  * Please see the COPYING-GPL-2 file for details.
6  *
7  * As a special exception, you may use this file as part of a free software
8  * library without restriction.  Specifically, if other files instantiate
9  * templates or use macros or inline functions from this file, or you compile
10  * this file and link it with other files to produce an executable, this
11  * file does not by itself cause the resulting executable to be covered by
12  * the GNU General Public License.  This exception does not however
13  * invalidate any other reasons why the executable file might be covered by
14  * the GNU General Public License.
15  */
16
17 #include <l4/re/c/video/goos.h>
18
19 #include <l4/re/video/goos>
20 #include <l4/re/video/view>
21 #include <l4/re/dataspace>
22 #include <l4/sys/err.h>
23
24 #include <cassert>
25 #include <stddef.h>
26
27 #ifndef __GXX_EXPERIMENTAL_CXX0X__
28 #define static_assert(x, y) \
29     do { (void)sizeof(char[-(!(x))]); } while (0)
30 #endif
31
32 using L4Re::Video::Goos;
33
34 L4_CV int
35 l4re_video_goos_info(l4re_video_goos_t goos,
36                      l4re_video_goos_info_t *ginfo) L4_NOTHROW
37 {
38   static_assert(   offsetof(Goos::Info, pixel_info)
39                 == offsetof(typeof(*ginfo), pixel_info),
40                 "Structure alignment mismatch");
41   L4::Cap<Goos> g(goos);
42   return g->info((Goos::Info *)ginfo);
43 }