Xenomai  3.0.5
vdso.h
1 /*
2  * Copyright (C) 2009 Wolfgang Mauerer <wolfgang.mauerer@siemens.com>.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18 #ifndef _COBALT_UAPI_KERNEL_VDSO_H
19 #define _COBALT_UAPI_KERNEL_VDSO_H
20 
21 #include <cobalt/uapi/kernel/urw.h>
22 
23 struct xnvdso_hostrt_data {
24  __u64 wall_sec;
25  __u64 wtom_sec;
26  __u64 cycle_last;
27  __u64 mask;
28  __u32 wall_nsec;
29  __u32 wtom_nsec;
30  __u32 mult;
31  __u32 shift;
32  __u32 live;
33  urw_t lock;
34 };
35 
36 /*
37  * Data shared between the Cobalt kernel and applications, which lives
38  * in the shared memory heap (COBALT_MEMDEV_SHARED).
39  * xnvdso_hostrt_data.features tells which data is present. Notice
40  * that struct xnvdso may only grow, but never shrink.
41  */
42 struct xnvdso {
43  __u64 features;
44  /* XNVDSO_FEAT_HOST_REALTIME */
45  struct xnvdso_hostrt_data hostrt_data;
46  /* XNVDSO_FEAT_WALLCLOCK_OFFSET */
47  __u64 wallclock_offset;
48 };
49 
50 /* For each shared feature, add a flag below. */
51 
52 #define XNVDSO_FEAT_HOST_REALTIME 0x0000000000000001ULL
53 #define XNVDSO_FEAT_WALLCLOCK_OFFSET 0x0000000000000002ULL
54 
55 static inline int xnvdso_test_feature(struct xnvdso *vdso,
56  __u64 feature)
57 {
58  return (vdso->features & feature) != 0;
59 }
60 
61 #endif /* !_COBALT_UAPI_KERNEL_VDSO_H */