Lines Matching full:count

23 static int read_sem_state(int sem, __u32 *count, __u32 *max)
30 *count = args.count;
35 #define check_sem_state(sem, count, max) \
40 EXPECT_EQ((count), __count); \
44 static int release_sem(int sem, __u32 *count)
46 return ioctl(sem, NTSYNC_IOC_SEM_RELEASE, count);
49 static int read_mutex_state(int mutex, __u32 *count, __u32 *owner)
56 *count = args.count;
61 #define check_mutex_state(mutex, count, owner) \
66 EXPECT_EQ((count), __count); \
70 static int unlock_mutex(int mutex, __u32 owner, __u32 *count)
76 args.count = 0xdeadbeef;
78 *count = args.count;
103 static int wait_objs(int fd, unsigned long request, __u32 count,
113 args.count = count;
123 static int wait_any(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index)
125 return wait_objs(fd, NTSYNC_IOC_WAIT_ANY, count, objs, owner, 0, index);
128 static int wait_all(int fd, __u32 count, const int *objs, __u32 owner, __u32 *index)
130 return wait_objs(fd, NTSYNC_IOC_WAIT_ALL, count, objs, owner, 0, index);
133 static int wait_any_alert(int fd, __u32 count, const int *objs,
137 count, objs, owner, alert, index);
140 static int wait_all_alert(int fd, __u32 count, const int *objs,
144 count, objs, owner, alert, index);
151 __u32 count, index;
159 sem_args.count = 3;
165 sem_args.count = 2;
171 count = 0;
172 ret = release_sem(sem, &count);
174 EXPECT_EQ(2, count);
177 count = 1;
178 ret = release_sem(sem, &count);
197 count = 3;
198 ret = release_sem(sem, &count);
203 count = 2;
204 ret = release_sem(sem, &count);
206 EXPECT_EQ(0, count);
214 count = 1;
215 ret = release_sem(sem, &count);
217 EXPECT_EQ(0, count);
220 count = ~0u;
221 ret = release_sem(sem, &count);
234 __u32 owner, count, index;
244 mutex_args.count = 0;
250 mutex_args.count = 2;
256 mutex_args.count = 2;
261 ret = unlock_mutex(mutex, 0, &count);
265 ret = unlock_mutex(mutex, 456, &count);
270 ret = unlock_mutex(mutex, 123, &count);
272 EXPECT_EQ(2, count);
275 ret = unlock_mutex(mutex, 123, &count);
277 EXPECT_EQ(1, count);
280 ret = unlock_mutex(mutex, 123, &count);
294 ret = unlock_mutex(mutex, 456, &count);
296 EXPECT_EQ(2, count);
322 EXPECT_EQ(0, mutex_args.count);
329 EXPECT_EQ(0, mutex_args.count);
346 EXPECT_EQ(0, mutex_args.count);
358 mutex_args.count = 0;
371 mutex_args.count = ~0u;
511 __u32 owner, index, count, i;
519 sem_args.count = 2;
525 mutex_args.count = 0;
547 count = 1;
548 ret = release_sem(objs[0], &count);
550 EXPECT_EQ(0, count);
585 count = 2;
586 ret = release_sem(objs[0], &count);
588 EXPECT_EQ(0, count);
625 __u32 owner, index, count;
631 sem_args.count = 2;
637 mutex_args.count = 0;
665 count = 3;
666 ret = release_sem(objs[0], &count);
668 EXPECT_EQ(0, count);
759 __u32 count, index, signaled;
766 sem_args.count = 0;
772 mutex_args.count = 1;
780 wait_args.count = 2;
792 count = 1;
793 ret = release_sem(objs[0], &count);
795 EXPECT_EQ(0, count);
818 ret = unlock_mutex(objs[1], 123, &count);
820 EXPECT_EQ(2, count);
825 ret = unlock_mutex(objs[1], 123, &count);
827 EXPECT_EQ(1, mutex_args.count);
952 __u32 count, index, signaled;
959 sem_args.count = 0;
965 mutex_args.count = 1;
981 wait_args.count = 4;
992 count = 1;
993 ret = release_sem(objs[0], &count);
995 EXPECT_EQ(0, count);
1006 ret = unlock_mutex(objs[1], 123, &count);
1008 EXPECT_EQ(1, count);
1019 count = 2;
1020 ret = release_sem(objs[0], &count);
1022 EXPECT_EQ(0, count);
1074 __u32 index, count, signaled;
1082 sem_args.count = 0;
1087 sem_args.count = 1;
1126 wait_args.count = 2;
1156 count = 1;
1157 ret = release_sem(objs[0], &count);
1186 __u32 index, count, signaled;
1193 sem_args.count = 2;
1198 sem_args.count = 1;
1223 wait_args.count = 2;
1253 count = 2;
1254 ret = release_sem(objs[1], &count);
1286 __u32 index, count, i;
1290 wait_args.count = 1;
1304 unlock_mutex(stress_mutex, wait_args.owner, &count);
1322 mutex_args.count = 0;
1351 struct ntsync_sem_args sem_args = { .count = 1, .max = 1 };
1376 wait_args.count = 0;
1434 sem_args.count = 0;
1443 wait_args.count = 1;