xref: /haiku/src/tools/fs_shell/atomic.cpp (revision 2f470aec1c92ce6917b8a903e343795dc77af41f)
1 /*
2  * Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include "compatibility.h"
7 
8 #include <OS.h>
9 
10 #include "fssh_atomic.h"
11 
12 
13 int32_t
14 fssh_atomic_set(vint32_t *value, int32_t newValue)
15 {
16 	return atomic_set((vint32*)value, newValue);
17 }
18 
19 
20 int32_t
21 fssh_atomic_test_and_set(vint32_t *value, int32_t newValue, int32_t testAgainst)
22 {
23 	return atomic_test_and_set((vint32*)value, newValue, testAgainst);
24 }
25 
26 
27 int32_t
28 fssh_atomic_add(vint32_t *value, int32_t addValue)
29 {
30 	return atomic_add((vint32*)value, addValue);
31 }
32 
33 
34 int32_t
35 fssh_atomic_and(vint32_t *value, int32_t andValue)
36 {
37 	return atomic_and((vint32*)value, andValue);
38 }
39 
40 
41 int32_t
42 fssh_atomic_or(vint32_t *value, int32_t orValue)
43 {
44 	return atomic_or((vint32*)value, orValue);
45 }
46 
47 
48 int32_t
49 fssh_atomic_get(vint32_t *value)
50 {
51 	return atomic_get((vint32*)value);
52 }
53