Xenomai  3.0.8
testing.h
Go to the documentation of this file.
1 
23 #ifndef _RTDM_UAPI_TESTING_H
24 #define _RTDM_UAPI_TESTING_H
25 
26 #include <linux/types.h>
27 
28 #define RTTST_PROFILE_VER 2
29 
30 typedef struct rttst_bench_res {
31  __s32 avg;
32  __s32 min;
33  __s32 max;
34  __s32 overruns;
35  __s32 test_loops;
36 } rttst_bench_res_t;
37 
38 typedef struct rttst_interm_bench_res {
39  struct rttst_bench_res last;
40  struct rttst_bench_res overall;
41 } rttst_interm_bench_res_t;
42 
43 typedef struct rttst_overall_bench_res {
44  struct rttst_bench_res result;
45  __s32 *histogram_avg;
46  __s32 *histogram_min;
47  __s32 *histogram_max;
48 } rttst_overall_bench_res_t;
49 
50 #define RTTST_TMBENCH_INVALID -1 /* internal use only */
51 #define RTTST_TMBENCH_TASK 0
52 #define RTTST_TMBENCH_HANDLER 1
53 
54 typedef struct rttst_tmbench_config {
55  int mode;
56  int priority;
57  __u64 period;
58  int warmup_loops;
59  int histogram_size;
60  int histogram_bucketsize;
61  int freeze_max;
62 } rttst_tmbench_config_t;
63 
64 struct rttst_swtest_task {
65  unsigned int index;
66  unsigned int flags;
67 };
68 
69 /* Possible values for struct rttst_swtest_task::flags. */
70 #define RTTST_SWTEST_FPU 0x1
71 #define RTTST_SWTEST_USE_FPU 0x2 /* Only for kernel-space tasks. */
72 #define RTTST_SWTEST_FREEZE 0x4 /* Only for kernel-space tasks. */
73 
74 struct rttst_swtest_dir {
75  unsigned int from;
76  unsigned int to;
77 };
78 
79 struct rttst_swtest_error {
80  struct rttst_swtest_dir last_switch;
81  unsigned int fp_val;
82 };
83 
84 #define RTTST_RTDM_NORMAL_CLOSE 0
85 #define RTTST_RTDM_DEFER_CLOSE_CONTEXT 1
86 
87 #define RTTST_RTDM_MAGIC_PRIMARY 0xfefbfefb
88 #define RTTST_RTDM_MAGIC_SECONDARY 0xa5b9a5b9
89 
90 #define RTIOC_TYPE_TESTING RTDM_CLASS_TESTING
91 
96 #define RTDM_SUBCLASS_TIMERBENCH 0
97 
98 #define RTDM_SUBCLASS_IRQBENCH 1
99 
100 #define RTDM_SUBCLASS_SWITCHTEST 2
101 
102 #define RTDM_SUBCLASS_RTDMTEST 3
103 
109 #define RTTST_RTIOC_INTERM_BENCH_RES \
110  _IOWR(RTIOC_TYPE_TESTING, 0x00, struct rttst_interm_bench_res)
111 
112 #define RTTST_RTIOC_TMBENCH_START \
113  _IOW(RTIOC_TYPE_TESTING, 0x10, struct rttst_tmbench_config)
114 
115 #define RTTST_RTIOC_TMBENCH_STOP \
116  _IOWR(RTIOC_TYPE_TESTING, 0x11, struct rttst_overall_bench_res)
117 
118 #define RTTST_RTIOC_SWTEST_SET_TASKS_COUNT \
119  _IOW(RTIOC_TYPE_TESTING, 0x30, __u32)
120 
121 #define RTTST_RTIOC_SWTEST_SET_CPU \
122  _IOW(RTIOC_TYPE_TESTING, 0x31, __u32)
123 
124 #define RTTST_RTIOC_SWTEST_REGISTER_UTASK \
125  _IOW(RTIOC_TYPE_TESTING, 0x32, struct rttst_swtest_task)
126 
127 #define RTTST_RTIOC_SWTEST_CREATE_KTASK \
128  _IOWR(RTIOC_TYPE_TESTING, 0x33, struct rttst_swtest_task)
129 
130 #define RTTST_RTIOC_SWTEST_PEND \
131  _IOR(RTIOC_TYPE_TESTING, 0x34, struct rttst_swtest_task)
132 
133 #define RTTST_RTIOC_SWTEST_SWITCH_TO \
134  _IOR(RTIOC_TYPE_TESTING, 0x35, struct rttst_swtest_dir)
135 
136 #define RTTST_RTIOC_SWTEST_GET_SWITCHES_COUNT \
137  _IOR(RTIOC_TYPE_TESTING, 0x36, __u32)
138 
139 #define RTTST_RTIOC_SWTEST_GET_LAST_ERROR \
140  _IOR(RTIOC_TYPE_TESTING, 0x37, struct rttst_swtest_error)
141 
142 #define RTTST_RTIOC_SWTEST_SET_PAUSE \
143  _IOW(RTIOC_TYPE_TESTING, 0x38, __u32)
144 
145 #define RTTST_RTIOC_RTDM_DEFER_CLOSE \
146  _IOW(RTIOC_TYPE_TESTING, 0x40, __u32)
147 
148 #define RTTST_RTIOC_RTDM_ACTOR_GET_CPU \
149  _IOR(RTIOC_TYPE_TESTING, 0x41, __u32)
150 
151 #define RTTST_RTIOC_RTDM_PING_PRIMARY \
152  _IOR(RTIOC_TYPE_TESTING, 0x42, __u32)
153 
154 #define RTTST_RTIOC_RTDM_PING_SECONDARY \
155  _IOR(RTIOC_TYPE_TESTING, 0x43, __u32)
156 
159 #endif /* !_RTDM_UAPI_TESTING_H */