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
13void
14fssh_atomic_set(int32_t* value, int32_t newValue)
15{
16	atomic_set((int32*)value, newValue);
17}
18
19
20int32_t
21fssh_atomic_get_and_set(int32_t* value, int32_t newValue)
22{
23	return atomic_get_and_set((int32*)value, newValue);
24}
25
26
27int32_t
28fssh_atomic_test_and_set(int32_t *value, int32_t newValue, int32_t testAgainst)
29{
30	return atomic_test_and_set((int32*)value, newValue, testAgainst);
31}
32
33
34int32_t
35fssh_atomic_add(int32_t *value, int32_t addValue)
36{
37	return atomic_add((int32*)value, addValue);
38}
39
40
41int32_t
42fssh_atomic_and(int32_t *value, int32_t andValue)
43{
44	return atomic_and((int32*)value, andValue);
45}
46
47
48int32_t
49fssh_atomic_or(int32_t *value, int32_t orValue)
50{
51	return atomic_or((int32*)value, orValue);
52}
53
54
55int32_t
56fssh_atomic_get(int32_t *value)
57{
58	return atomic_get((int32*)value);
59}
60
61
62void
63fssh_atomic_set64(int64_t *value, int64_t newValue)
64{
65	atomic_set64((int64*)value, newValue);
66}
67
68
69int64_t
70fssh_atomic_get_and_set64(int64_t* value, int64_t newValue)
71{
72	return atomic_get_and_set64((int64*)value, newValue);
73}
74
75
76int64_t
77fssh_atomic_test_and_set64(int64_t *value, int64_t newValue, int64_t testAgainst)
78{
79	return atomic_test_and_set64((int64 *)value, newValue, testAgainst);
80}
81
82
83int64_t
84fssh_atomic_add64(int64_t *value, int64_t addValue)
85{
86	return atomic_add64((int64*)value, addValue);
87}
88
89
90int64_t
91fssh_atomic_and64(int64_t *value, int64_t andValue)
92{
93	return atomic_and64((int64*)value, andValue);
94}
95
96
97int64_t
98fssh_atomic_or64(int64_t *value, int64_t orValue)
99{
100	return atomic_or64((int64*)value, orValue);
101}
102
103
104int64_t
105fssh_atomic_get64(int64_t *value)
106{
107	return atomic_get64((int64*)value);
108}
109
110