2003-08-21 23:02:00 +00:00
|
|
|
/*
|
|
|
|
|
** Copyright 2003, Marcus Overhagen. All rights reserved.
|
2004-09-10 15:20:37 +00:00
|
|
|
** Distributed under the terms of the Haiku License.
|
2003-08-21 23:02:00 +00:00
|
|
|
*/
|
|
|
|
|
|
2004-09-10 15:20:37 +00:00
|
|
|
|
2003-08-21 23:02:00 +00:00
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
2004-09-10 15:20:37 +00:00
|
|
|
#include <arch_config.h>
|
2003-08-21 23:02:00 +00:00
|
|
|
#include <syscalls.h>
|
|
|
|
|
|
2004-09-10 15:20:37 +00:00
|
|
|
|
2003-08-21 23:02:00 +00:00
|
|
|
#ifdef ATOMIC_FUNCS_ARE_SYSCALLS
|
2004-09-10 15:20:37 +00:00
|
|
|
|
2003-08-21 23:02:00 +00:00
|
|
|
int32
|
|
|
|
|
atomic_set(vint32 *value, int32 newValue)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_set(value, newValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32
|
|
|
|
|
atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_test_and_set(value, newValue, testAgainst);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32
|
|
|
|
|
atomic_add(vint32 *value, int32 addValue)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_add(value, addValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32
|
|
|
|
|
atomic_and(vint32 *value, int32 andValue)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_and(value, andValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32
|
|
|
|
|
atomic_or(vint32 *value, int32 orValue)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_or(value, orValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32
|
2003-08-31 01:21:56 +00:00
|
|
|
atomic_get(vint32 *value)
|
2003-08-21 23:02:00 +00:00
|
|
|
{
|
2003-08-31 01:21:56 +00:00
|
|
|
return _kern_atomic_get(value);
|
2003-08-21 23:02:00 +00:00
|
|
|
}
|
2004-09-10 15:20:37 +00:00
|
|
|
|
|
|
|
|
#endif /* ATOMIC_FUNCS_ARE_SYSCALLS */
|
2003-08-21 23:02:00 +00:00
|
|
|
|
|
|
|
|
#ifdef ATOMIC64_FUNCS_ARE_SYSCALLS
|
2004-09-10 15:20:37 +00:00
|
|
|
|
2003-08-21 23:02:00 +00:00
|
|
|
int64
|
|
|
|
|
atomic_set64(vint64 *value, int64 newValue)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_set64(value, newValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int64
|
|
|
|
|
atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_test_and_set64(value, newValue, testAgainst);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int64
|
|
|
|
|
atomic_add64(vint64 *value, int64 addValue)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_add64(value, addValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int64
|
|
|
|
|
atomic_and64(vint64 *value, int64 andValue)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_and64(value, andValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int64
|
|
|
|
|
atomic_or64(vint64 *value, int64 orValue)
|
|
|
|
|
{
|
|
|
|
|
return _kern_atomic_or64(value, orValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int64
|
2003-08-31 01:21:56 +00:00
|
|
|
atomic_get64(vint64 *value)
|
2003-08-21 23:02:00 +00:00
|
|
|
{
|
2003-08-31 01:21:56 +00:00
|
|
|
return _kern_atomic_get64(value);
|
2003-08-21 23:02:00 +00:00
|
|
|
}
|
2004-09-10 15:20:37 +00:00
|
|
|
|
|
|
|
|
#endif /* ATOMIC64_FUNCS_ARE_SYSCALLS */
|