Lines Matching refs:td
55 static int handle_op(struct test_thread_data *td, int lockwakeup) in handle_op() argument
59 switch(td->opcode) { in handle_op()
65 td->mutexes[td->opdata] = 1; in handle_op()
66 td->event = atomic_add_return(1, &rttest_event); in handle_op()
71 if (td->mutexes[i] == 4) { in handle_op()
73 td->mutexes[i] = 0; in handle_op()
87 switch(td->opcode) { in handle_op()
91 id = td->opdata; in handle_op()
95 td->mutexes[id] = 1; in handle_op()
96 td->event = atomic_add_return(1, &rttest_event); in handle_op()
98 td->event = atomic_add_return(1, &rttest_event); in handle_op()
99 td->mutexes[id] = 4; in handle_op()
104 id = td->opdata; in handle_op()
108 td->mutexes[id] = 1; in handle_op()
109 td->event = atomic_add_return(1, &rttest_event); in handle_op()
111 td->event = atomic_add_return(1, &rttest_event); in handle_op()
112 td->mutexes[id] = ret ? 0 : 4; in handle_op()
116 id = td->opdata; in handle_op()
117 if (id < 0 || id >= MAX_RT_TEST_MUTEXES || td->mutexes[id] != 4) in handle_op()
120 td->event = atomic_add_return(1, &rttest_event); in handle_op()
122 td->event = atomic_add_return(1, &rttest_event); in handle_op()
123 td->mutexes[id] = 0; in handle_op()
142 struct test_thread_data *td; in schedule_rt_mutex_test() local
152 td = &thread_data[tid]; in schedule_rt_mutex_test()
154 op = td->opcode; in schedule_rt_mutex_test()
155 dat = td->opdata; in schedule_rt_mutex_test()
165 if (td->mutexes[dat] != 1) in schedule_rt_mutex_test()
168 td->mutexes[dat] = 2; in schedule_rt_mutex_test()
169 td->event = atomic_add_return(1, &rttest_event); in schedule_rt_mutex_test()
185 if (td->mutexes[dat] != 2) in schedule_rt_mutex_test()
188 td->mutexes[dat] = 3; in schedule_rt_mutex_test()
189 td->event = atomic_add_return(1, &rttest_event); in schedule_rt_mutex_test()
197 if (td->mutexes[dat] != 2) in schedule_rt_mutex_test()
200 td->mutexes[dat] = 1; in schedule_rt_mutex_test()
201 td->event = atomic_add_return(1, &rttest_event); in schedule_rt_mutex_test()
208 td->opcode = 0; in schedule_rt_mutex_test()
213 if (td->opcode > 0) { in schedule_rt_mutex_test()
217 ret = handle_op(td, 1); in schedule_rt_mutex_test()
219 if (td->opcode == RTTEST_LOCKCONT) in schedule_rt_mutex_test()
221 td->opcode = ret; in schedule_rt_mutex_test()
229 td->opcode = op; in schedule_rt_mutex_test()
230 td->opdata = dat; in schedule_rt_mutex_test()
235 struct test_thread_data *td = data; in test_func() local
246 if (td->opcode > 0) { in test_func()
248 ret = handle_op(td, 0); in test_func()
250 td->opcode = ret; in test_func()
280 struct test_thread_data *td; in sysfs_test_command() local
284 td = container_of(dev, struct test_thread_data, dev); in sysfs_test_command()
285 tid = td->dev.id; in sysfs_test_command()
324 if (td->opcode > 0) in sysfs_test_command()
326 td->opdata = dat; in sysfs_test_command()
327 td->opcode = op; in sysfs_test_command()
342 struct test_thread_data *td; in sysfs_test_status() local
347 td = container_of(dev, struct test_thread_data, dev); in sysfs_test_status()
348 tsk = threads[td->dev.id]; in sysfs_test_status()
354 td->opcode, td->event, tsk->state, in sysfs_test_status()
360 curr += sprintf(curr, "%d", td->mutexes[i]); in sysfs_test_status()
365 mutexes[td->dev.id].owner); in sysfs_test_status()