xref: /linux-6.15/tools/testing/selftests/sync/sync.h (revision 82208160)
1*82208160SEmilio López /*
2*82208160SEmilio López  *  sync abstraction
3*82208160SEmilio López  *  Copyright 2015-2016 Collabora Ltd.
4*82208160SEmilio López  *
5*82208160SEmilio López  *  Based on the implementation from the Android Open Source Project,
6*82208160SEmilio López  *
7*82208160SEmilio López  *  Copyright 2012 Google, Inc
8*82208160SEmilio López  *
9*82208160SEmilio López  *  Permission is hereby granted, free of charge, to any person obtaining a
10*82208160SEmilio López  *  copy of this software and associated documentation files (the "Software"),
11*82208160SEmilio López  *  to deal in the Software without restriction, including without limitation
12*82208160SEmilio López  *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
13*82208160SEmilio López  *  and/or sell copies of the Software, and to permit persons to whom the
14*82208160SEmilio López  *  Software is furnished to do so, subject to the following conditions:
15*82208160SEmilio López  *
16*82208160SEmilio López  *  The above copyright notice and this permission notice shall be included in
17*82208160SEmilio López  *  all copies or substantial portions of the Software.
18*82208160SEmilio López  *
19*82208160SEmilio López  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20*82208160SEmilio López  *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21*82208160SEmilio López  *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22*82208160SEmilio López  *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23*82208160SEmilio López  *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24*82208160SEmilio López  *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25*82208160SEmilio López  *  OTHER DEALINGS IN THE SOFTWARE.
26*82208160SEmilio López  */
27*82208160SEmilio López 
28*82208160SEmilio López #ifndef SELFTESTS_SYNC_H
29*82208160SEmilio López #define SELFTESTS_SYNC_H
30*82208160SEmilio López 
31*82208160SEmilio López #define FENCE_STATUS_ERROR	(-1)
32*82208160SEmilio López #define FENCE_STATUS_ACTIVE	(0)
33*82208160SEmilio López #define FENCE_STATUS_SIGNALED	(1)
34*82208160SEmilio López 
35*82208160SEmilio López int sync_wait(int fd, int timeout);
36*82208160SEmilio López int sync_merge(const char *name, int fd1, int fd2);
37*82208160SEmilio López int sync_fence_size(int fd);
38*82208160SEmilio López int sync_fence_count_with_status(int fd, int status);
39*82208160SEmilio López 
40*82208160SEmilio López #endif
41