xref: /haiku/headers/private/fs_shell/fssh_atomic.h (revision b6f76ebe7153b94820cf35f8db4facc158841abb)
1a38a92c9SIngo Weinhold /* Modules Definitions
2a38a92c9SIngo Weinhold **
3*b6f76ebeSAugustin Cavalier ** Distributed under the terms of the MIT License.
4a38a92c9SIngo Weinhold */
5a38a92c9SIngo Weinhold 
6a38a92c9SIngo Weinhold #ifndef _FSSH_ATOMIC_H
7a38a92c9SIngo Weinhold #define _FSSH_ATOMIC_H
8a38a92c9SIngo Weinhold 
9a38a92c9SIngo Weinhold 
10a38a92c9SIngo Weinhold #include "fssh_types.h"
11a38a92c9SIngo Weinhold 
12a38a92c9SIngo Weinhold 
13a38a92c9SIngo Weinhold #ifdef __cplusplus
14a38a92c9SIngo Weinhold extern "C" {
15a38a92c9SIngo Weinhold #endif
16a38a92c9SIngo Weinhold 
17a38a92c9SIngo Weinhold 
18077c84ebSPawel Dziepak void	fssh_atomic_set(int32_t* value, int32_t newValue);
19077c84ebSPawel Dziepak int32_t	fssh_atomic_get_and_set(int32_t* value, int32_t newValue);
20077c84ebSPawel Dziepak int32_t	fssh_atomic_test_and_set(int32_t *value, int32_t newValue,
21a38a92c9SIngo Weinhold 			int32_t testAgainst);
22077c84ebSPawel Dziepak int32_t	fssh_atomic_add(int32_t *value, int32_t addValue);
23077c84ebSPawel Dziepak int32_t	fssh_atomic_and(int32_t *value, int32_t andValue);
24077c84ebSPawel Dziepak int32_t	fssh_atomic_or(int32_t *value, int32_t orValue);
25077c84ebSPawel Dziepak int32_t	fssh_atomic_get(int32_t *value);
26a38a92c9SIngo Weinhold 
27077c84ebSPawel Dziepak void	fssh_atomic_set64(int64_t* value, int64_t newValue);
28077c84ebSPawel Dziepak int64_t	fssh_atomic_get_and_set64(int64_t* value, int64_t newValue);
29077c84ebSPawel Dziepak int64_t	fssh_atomic_test_and_set64(int64_t *value, int64_t newValue,
30a3ca7ebcSJérôme Duval 			int64_t testAgainst);
31077c84ebSPawel Dziepak int64_t	fssh_atomic_add64(int64_t *value, int64_t addValue);
32077c84ebSPawel Dziepak int64_t	fssh_atomic_and64(int64_t *value, int64_t andValue);
33077c84ebSPawel Dziepak int64_t	fssh_atomic_or64(int64_t *value, int64_t orValue);
34077c84ebSPawel Dziepak int64_t	fssh_atomic_get64(int64_t *value);
35a38a92c9SIngo Weinhold 
36a38a92c9SIngo Weinhold #ifdef __cplusplus
37a38a92c9SIngo Weinhold }
38a38a92c9SIngo Weinhold #endif
39a38a92c9SIngo Weinhold 
40a38a92c9SIngo Weinhold 
41a38a92c9SIngo Weinhold #endif	/* _FSSH_ATOMIC_H */
42