Xenomai API  2.6.5
rttesting.h
Go to the documentation of this file.
1 
60 #ifndef _RTTESTING_H
61 #define _RTTESTING_H
62 
63 #include <rtdm/rtdm.h>
64 
65 #define RTTST_PROFILE_VER 2
66 
67 typedef struct rttst_bench_res {
68  long long avg;
69  long min;
70  long max;
71  long overruns;
72  long test_loops;
73 } rttst_bench_res_t;
74 
75 typedef struct rttst_interm_bench_res {
76  struct rttst_bench_res last;
77  struct rttst_bench_res overall;
78 } rttst_interm_bench_res_t;
79 
80 typedef struct rttst_overall_bench_res {
81  struct rttst_bench_res result;
82  long *histogram_avg;
83  long *histogram_min;
84  long *histogram_max;
85  void *__padding; /* align to dwords on 32-bit archs */
86 } rttst_overall_bench_res_t;
87 
88 #define RTTST_TMBENCH_INVALID -1 /* internal use only */
89 #define RTTST_TMBENCH_TASK 0
90 #define RTTST_TMBENCH_HANDLER 1
91 
92 typedef struct rttst_tmbench_config {
93  int mode;
94  int priority;
95  nanosecs_rel_t period;
96  int warmup_loops;
97  int histogram_size;
98  int histogram_bucketsize;
99  int freeze_max;
100 } rttst_tmbench_config_t;
101 
102 #define RTTST_IRQBENCH_USER_TASK 0
103 #define RTTST_IRQBENCH_KERNEL_TASK 1
104 #define RTTST_IRQBENCH_HANDLER 2
105 #define RTTST_IRQBENCH_HARD_IRQ 3
106 
107 #define RTTST_IRQBENCH_SERPORT 0
108 #define RTTST_IRQBENCH_PARPORT 1
109 
110 typedef struct rttst_irqbench_config {
111  int mode;
112  int priority;
113  int calibration_loops;
114  unsigned int port_type;
115  unsigned long port_ioaddr;
116  unsigned int port_irq;
117 } rttst_irqbench_config_t;
118 
119 typedef struct rttst_irqbench_stats {
120  unsigned long long irqs_received;
121  unsigned long long irqs_acknowledged;
122 } rttst_irqbench_stats_t;
123 
124 struct rttst_swtest_task {
125  unsigned index;
126  unsigned flags;
127 };
128 
129 /* Possible values for struct rttst_swtest_task::flags. */
130 #define RTTST_SWTEST_FPU 0x1
131 #define RTTST_SWTEST_USE_FPU 0x2 /* Only for kernel-space tasks. */
132 #define RTTST_SWTEST_FREEZE 0x4 /* Only for kernel-space tasks. */
133 
134 struct rttst_swtest_dir {
135  unsigned from;
136  unsigned to;
137 };
138 
139 struct rttst_swtest_error {
140  struct rttst_swtest_dir last_switch;
141  unsigned fp_val;
142 };
143 
144 #define RTTST_RTDM_NORMAL_CLOSE 0
145 #define RTTST_RTDM_DEFER_CLOSE_HANDLER 1
146 #define RTTST_RTDM_DEFER_CLOSE_CONTEXT 2
147 
148 #define RTIOC_TYPE_TESTING RTDM_CLASS_TESTING
149 
154 #define RTDM_SUBCLASS_TIMERBENCH 0
155 
156 #define RTDM_SUBCLASS_IRQBENCH 1
157 
158 #define RTDM_SUBCLASS_SWITCHTEST 2
159 
160 #define RTDM_SUBCLASS_RTDMTEST 3
161 
167 #define RTTST_RTIOC_INTERM_BENCH_RES \
168  _IOWR(RTIOC_TYPE_TESTING, 0x00, struct rttst_interm_bench_res)
169 
170 #define RTTST_RTIOC_TMBENCH_START \
171  _IOW(RTIOC_TYPE_TESTING, 0x10, struct rttst_tmbench_config)
172 
173 #define RTTST_RTIOC_TMBENCH_STOP \
174  _IOWR(RTIOC_TYPE_TESTING, 0x11, struct rttst_overall_bench_res)
175 
176 #define RTTST_RTIOC_IRQBENCH_START \
177  _IOW(RTIOC_TYPE_TESTING, 0x20, struct rttst_irqbench_config)
178 
179 #define RTTST_RTIOC_IRQBENCH_STOP \
180  _IO(RTIOC_TYPE_TESTING, 0x21)
181 
182 #define RTTST_RTIOC_IRQBENCH_GET_STATS \
183  _IOR(RTIOC_TYPE_TESTING, 0x22, struct rttst_irqbench_stats)
184 
185 #define RTTST_RTIOC_IRQBENCH_WAIT_IRQ \
186  _IO(RTIOC_TYPE_TESTING, 0x23)
187 
188 #define RTTST_RTIOC_IRQBENCH_REPLY_IRQ \
189  _IO(RTIOC_TYPE_TESTING, 0x24)
190 
191 #define RTTST_RTIOC_SWTEST_SET_TASKS_COUNT \
192  _IOW(RTIOC_TYPE_TESTING, 0x30, unsigned long)
193 
194 #define RTTST_RTIOC_SWTEST_SET_CPU \
195  _IOW(RTIOC_TYPE_TESTING, 0x31, unsigned long)
196 
197 #define RTTST_RTIOC_SWTEST_REGISTER_UTASK \
198  _IOW(RTIOC_TYPE_TESTING, 0x32, struct rttst_swtest_task)
199 
200 #define RTTST_RTIOC_SWTEST_CREATE_KTASK \
201  _IOWR(RTIOC_TYPE_TESTING, 0x33, struct rttst_swtest_task)
202 
203 #define RTTST_RTIOC_SWTEST_PEND \
204  _IOR(RTIOC_TYPE_TESTING, 0x34, struct rttst_swtest_task)
205 
206 #define RTTST_RTIOC_SWTEST_SWITCH_TO \
207  _IOR(RTIOC_TYPE_TESTING, 0x35, struct rttst_swtest_dir)
208 
209 #define RTTST_RTIOC_SWTEST_GET_SWITCHES_COUNT \
210  _IOR(RTIOC_TYPE_TESTING, 0x36, unsigned long)
211 
212 #define RTTST_RTIOC_SWTEST_GET_LAST_ERROR \
213  _IOR(RTIOC_TYPE_TESTING, 0x37, struct rttst_swtest_error)
214 
215 #define RTTST_RTIOC_SWTEST_SET_PAUSE \
216  _IOW(RTIOC_TYPE_TESTING, 0x38, unsigned long)
217 
218 #define RTTST_RTIOC_RTDM_DEFER_CLOSE \
219  _IOW(RTIOC_TYPE_TESTING, 0x40, unsigned long)
220 
224 #endif /* _RTTESTING_H */
int64_t nanosecs_rel_t
RTDM type for representing relative intervals.
Definition: rtdm.h:95
Real-Time Driver Model for Xenomai, user API header.