1 /* 2 ** Copyright 2003, Marcus Overhagen. All rights reserved. 3 ** Distributed under the terms of the MIT 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 void _user_atomic_set(int32 *value, int32 newValue); 17 int32 _user_atomic_get_and_set(int32 *value, int32 newValue); 18 int32 _user_atomic_test_and_set(int32 *value, int32 newValue, int32 testAgainst); 19 int32 _user_atomic_add(int32 *value, int32 addValue); 20 int32 _user_atomic_and(int32 *value, int32 andValue); 21 int32 _user_atomic_or(int32 *value, int32 orValue); 22 int32 _user_atomic_get(int32 *value); 23 24 void _user_atomic_set64(int64 *value, int64 newValue); 25 int64 _user_atomic_get_and_set64(int64 *value, int64 newValue); 26 int64 _user_atomic_test_and_set64(int64 *value, int64 newValue, int64 testAgainst); 27 int64 _user_atomic_add64(int64 *value, int64 addValue); 28 int64 _user_atomic_and64(int64 *value, int64 andValue); 29 int64 _user_atomic_or64(int64 *value, int64 orValue); 30 int64 _user_atomic_get64(int64 *value); 31 32 #ifdef __cplusplus 33 } 34 #endif 35 36 37 #endif /* _KERNEL_USER_ATOMIC_H */ 38