2003-08-22 03:02:00 +04:00
|
|
|
/*
|
|
|
|
** Copyright 2003, Marcus Overhagen. All rights reserved.
|
2017-02-10 06:03:59 +03:00
|
|
|
** Distributed under the terms of the MIT License.
|
2003-08-22 03:02:00 +04:00
|
|
|
*/
|
|
|
|
#ifndef _KERNEL_USER_ATOMIC_H
|
|
|
|
#define _KERNEL_USER_ATOMIC_H
|
|
|
|
|
|
|
|
/* If the architecture doesn't support atomic functions
|
|
|
|
* in userspace, they are implemented as these syscalls.
|
|
|
|
*/
|
|
|
|
|
2009-08-03 14:10:22 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-02-15 14:36:17 +04:00
|
|
|
void _user_atomic_set(int32 *value, int32 newValue);
|
|
|
|
int32 _user_atomic_get_and_set(int32 *value, int32 newValue);
|
|
|
|
int32 _user_atomic_test_and_set(int32 *value, int32 newValue, int32 testAgainst);
|
|
|
|
int32 _user_atomic_add(int32 *value, int32 addValue);
|
|
|
|
int32 _user_atomic_and(int32 *value, int32 andValue);
|
|
|
|
int32 _user_atomic_or(int32 *value, int32 orValue);
|
|
|
|
int32 _user_atomic_get(int32 *value);
|
2003-08-22 03:02:00 +04:00
|
|
|
|
2014-02-15 14:36:17 +04:00
|
|
|
void _user_atomic_set64(int64 *value, int64 newValue);
|
|
|
|
int64 _user_atomic_get_and_set64(int64 *value, int64 newValue);
|
|
|
|
int64 _user_atomic_test_and_set64(int64 *value, int64 newValue, int64 testAgainst);
|
|
|
|
int64 _user_atomic_add64(int64 *value, int64 addValue);
|
|
|
|
int64 _user_atomic_and64(int64 *value, int64 andValue);
|
|
|
|
int64 _user_atomic_or64(int64 *value, int64 orValue);
|
|
|
|
int64 _user_atomic_get64(int64 *value);
|
2003-08-22 03:02:00 +04:00
|
|
|
|
2009-08-03 14:10:22 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2003-08-22 03:02:00 +04:00
|
|
|
#endif /* _KERNEL_USER_ATOMIC_H */
|