xref: /haiku/headers/private/kernel/user_atomic.h (revision 2b76973fa2401f7a5edf68e6470f3d3210cbcff3)
1 /*
2 ** Copyright 2003, Marcus Overhagen. All rights reserved.
3 ** Distributed under the terms of the OpenBeOS License.
4 */
5 #ifndef _KERNEL_USER_ATOMIC_H
6 #define _KERNEL_USER_ATOMIC_H
7 
8 /* If the architecture doesn't support atomic functions
9  * in userspace, they are implemented as these syscalls.
10  */
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 int32 _user_atomic_set(vint32 *value, int32 newValue);
17 int32 _user_atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst);
18 int32 _user_atomic_add(vint32 *value, int32 addValue);
19 int32 _user_atomic_and(vint32 *value, int32 andValue);
20 int32 _user_atomic_or(vint32 *value, int32 orValue);
21 int32 _user_atomic_get(vint32 *value);
22 
23 int64 _user_atomic_set64(vint64 *value, int64 newValue);
24 int64 _user_atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst);
25 int64 _user_atomic_add64(vint64 *value, int64 addValue);
26 int64 _user_atomic_and64(vint64 *value, int64 andValue);
27 int64 _user_atomic_or64(vint64 *value, int64 orValue);
28 int64 _user_atomic_get64(vint64 *value);
29 
30 #ifdef __cplusplus
31 }
32 #endif
33 
34 
35 #endif	/* _KERNEL_USER_ATOMIC_H */
36