Xenomai API
2.5.6.1
|
00001 00060 #ifndef _RTTESTING_H 00061 #define _RTTESTING_H 00062 00063 #include <rtdm/rtdm.h> 00064 00065 #define RTTST_PROFILE_VER 2 00066 00067 typedef struct rttst_bench_res { 00068 long long avg; 00069 long min; 00070 long max; 00071 long overruns; 00072 long test_loops; 00073 } rttst_bench_res_t; 00074 00075 typedef struct rttst_interm_bench_res { 00076 struct rttst_bench_res last; 00077 struct rttst_bench_res overall; 00078 } rttst_interm_bench_res_t; 00079 00080 typedef struct rttst_overall_bench_res { 00081 struct rttst_bench_res result; 00082 long *histogram_avg; 00083 long *histogram_min; 00084 long *histogram_max; 00085 void *__padding; /* align to dwords on 32-bit archs */ 00086 } rttst_overall_bench_res_t; 00087 00088 #define RTTST_TMBENCH_INVALID -1 /* internal use only */ 00089 #define RTTST_TMBENCH_TASK 0 00090 #define RTTST_TMBENCH_HANDLER 1 00091 00092 typedef struct rttst_tmbench_config { 00093 int mode; 00094 int priority; 00095 nanosecs_rel_t period; 00096 int warmup_loops; 00097 int histogram_size; 00098 int histogram_bucketsize; 00099 int freeze_max; 00100 } rttst_tmbench_config_t; 00101 00102 #define RTTST_IRQBENCH_USER_TASK 0 00103 #define RTTST_IRQBENCH_KERNEL_TASK 1 00104 #define RTTST_IRQBENCH_HANDLER 2 00105 #define RTTST_IRQBENCH_HARD_IRQ 3 00106 00107 #define RTTST_IRQBENCH_SERPORT 0 00108 #define RTTST_IRQBENCH_PARPORT 1 00109 00110 typedef struct rttst_irqbench_config { 00111 int mode; 00112 int priority; 00113 int calibration_loops; 00114 unsigned int port_type; 00115 unsigned long port_ioaddr; 00116 unsigned int port_irq; 00117 } rttst_irqbench_config_t; 00118 00119 typedef struct rttst_irqbench_stats { 00120 unsigned long long irqs_received; 00121 unsigned long long irqs_acknowledged; 00122 } rttst_irqbench_stats_t; 00123 00124 struct rttst_swtest_task { 00125 unsigned index; 00126 unsigned flags; 00127 }; 00128 00129 /* Possible values for struct rttst_swtest_task::flags. */ 00130 #define RTTST_SWTEST_FPU 0x1 00131 #define RTTST_SWTEST_USE_FPU 0x2 /* Only for kernel-space tasks. */ 00132 #define RTTST_SWTEST_FREEZE 0x4 /* Only for kernel-space tasks. */ 00133 00134 struct rttst_swtest_dir { 00135 unsigned from; 00136 unsigned to; 00137 }; 00138 00139 struct rttst_swtest_error { 00140 struct rttst_swtest_dir last_switch; 00141 unsigned fp_val; 00142 }; 00143 00144 #define RTTST_RTDM_NORMAL_CLOSE 0 00145 #define RTTST_RTDM_DEFER_CLOSE_HANDLER 1 00146 #define RTTST_RTDM_DEFER_CLOSE_CONTEXT 2 00147 00148 #define RTIOC_TYPE_TESTING RTDM_CLASS_TESTING 00149 00154 #define RTDM_SUBCLASS_TIMERBENCH 0 00155 00156 #define RTDM_SUBCLASS_IRQBENCH 1 00157 00158 #define RTDM_SUBCLASS_SWITCHTEST 2 00159 00160 #define RTDM_SUBCLASS_RTDMTEST 3 00161 00167 #define RTTST_RTIOC_INTERM_BENCH_RES \ 00168 _IOWR(RTIOC_TYPE_TESTING, 0x00, struct rttst_interm_bench_res) 00169 00170 #define RTTST_RTIOC_TMBENCH_START \ 00171 _IOW(RTIOC_TYPE_TESTING, 0x10, struct rttst_tmbench_config) 00172 00173 #define RTTST_RTIOC_TMBENCH_STOP \ 00174 _IOWR(RTIOC_TYPE_TESTING, 0x11, struct rttst_overall_bench_res) 00175 00176 #define RTTST_RTIOC_IRQBENCH_START \ 00177 _IOW(RTIOC_TYPE_TESTING, 0x20, struct rttst_irqbench_config) 00178 00179 #define RTTST_RTIOC_IRQBENCH_STOP \ 00180 _IO(RTIOC_TYPE_TESTING, 0x21) 00181 00182 #define RTTST_RTIOC_IRQBENCH_GET_STATS \ 00183 _IOR(RTIOC_TYPE_TESTING, 0x22, struct rttst_irqbench_stats) 00184 00185 #define RTTST_RTIOC_IRQBENCH_WAIT_IRQ \ 00186 _IO(RTIOC_TYPE_TESTING, 0x23) 00187 00188 #define RTTST_RTIOC_IRQBENCH_REPLY_IRQ \ 00189 _IO(RTIOC_TYPE_TESTING, 0x24) 00190 00191 #define RTTST_RTIOC_SWTEST_SET_TASKS_COUNT \ 00192 _IOW(RTIOC_TYPE_TESTING, 0x30, unsigned long) 00193 00194 #define RTTST_RTIOC_SWTEST_SET_CPU \ 00195 _IOW(RTIOC_TYPE_TESTING, 0x31, unsigned long) 00196 00197 #define RTTST_RTIOC_SWTEST_REGISTER_UTASK \ 00198 _IOW(RTIOC_TYPE_TESTING, 0x32, struct rttst_swtest_task) 00199 00200 #define RTTST_RTIOC_SWTEST_CREATE_KTASK \ 00201 _IOWR(RTIOC_TYPE_TESTING, 0x33, struct rttst_swtest_task) 00202 00203 #define RTTST_RTIOC_SWTEST_PEND \ 00204 _IOR(RTIOC_TYPE_TESTING, 0x34, struct rttst_swtest_task) 00205 00206 #define RTTST_RTIOC_SWTEST_SWITCH_TO \ 00207 _IOR(RTIOC_TYPE_TESTING, 0x35, struct rttst_swtest_dir) 00208 00209 #define RTTST_RTIOC_SWTEST_GET_SWITCHES_COUNT \ 00210 _IOR(RTIOC_TYPE_TESTING, 0x36, unsigned long) 00211 00212 #define RTTST_RTIOC_SWTEST_GET_LAST_ERROR \ 00213 _IOR(RTIOC_TYPE_TESTING, 0x37, struct rttst_swtest_error) 00214 00215 #define RTTST_RTIOC_SWTEST_SET_PAUSE \ 00216 _IOW(RTIOC_TYPE_TESTING, 0x38, unsigned long) 00217 00218 #define RTTST_RTIOC_RTDM_DEFER_CLOSE \ 00219 _IOW(RTIOC_TYPE_TESTING, 0x40, unsigned long) 00220 00224 #endif /* _RTTESTING_H */