kernel: atomic_*() functions rework

* No need for the atomically changed variables to be declared as
   volatile.
 * Drop support for atomically getting and setting unaligned data.
 * Introduce atomic_get_and_set[64]() which works the same as
   atomic_set[64]() used to. atomic_set[64]() does not return the
   previous value anymore.
This commit is contained in:
Pawel Dziepak
2013-11-05 22:32:59 +01:00
parent e7dba861fd
commit 077c84eb27
47 changed files with 360 additions and 253 deletions
+14 -12
View File
@@ -15,21 +15,23 @@ extern "C" {
#endif
int32_t fssh_atomic_set(vint32_t *value, int32_t newValue);
int32_t fssh_atomic_test_and_set(vint32_t *value, int32_t newValue,
void fssh_atomic_set(int32_t* value, int32_t newValue);
int32_t fssh_atomic_get_and_set(int32_t* value, int32_t newValue);
int32_t fssh_atomic_test_and_set(int32_t *value, int32_t newValue,
int32_t testAgainst);
int32_t fssh_atomic_add(vint32_t *value, int32_t addValue);
int32_t fssh_atomic_and(vint32_t *value, int32_t andValue);
int32_t fssh_atomic_or(vint32_t *value, int32_t orValue);
int32_t fssh_atomic_get(vint32_t *value);
int32_t fssh_atomic_add(int32_t *value, int32_t addValue);
int32_t fssh_atomic_and(int32_t *value, int32_t andValue);
int32_t fssh_atomic_or(int32_t *value, int32_t orValue);
int32_t fssh_atomic_get(int32_t *value);
int64_t fssh_atomic_set64(vint64_t *value, int64_t newValue);
int64_t fssh_atomic_test_and_set64(vint64_t *value, int64_t newValue,
void fssh_atomic_set64(int64_t* value, int64_t newValue);
int64_t fssh_atomic_get_and_set64(int64_t* value, int64_t newValue);
int64_t fssh_atomic_test_and_set64(int64_t *value, int64_t newValue,
int64_t testAgainst);
int64_t fssh_atomic_add64(vint64_t *value, int64_t addValue);
int64_t fssh_atomic_and64(vint64_t *value, int64_t andValue);
int64_t fssh_atomic_or64(vint64_t *value, int64_t orValue);
int64_t fssh_atomic_get64(vint64_t *value);
int64_t fssh_atomic_add64(int64_t *value, int64_t addValue);
int64_t fssh_atomic_and64(int64_t *value, int64_t andValue);
int64_t fssh_atomic_or64(int64_t *value, int64_t orValue);
int64_t fssh_atomic_get64(int64_t *value);
#ifdef __cplusplus
}