On most systems, atomic functions do not need to be implemented as syscalls.

ATOMIC_FUNCS_ARE_SYSCALLS is only defined on architecture like SH4.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4341 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2003-08-20 02:34:42 +00:00
parent abe798f30b
commit b4e05c0eb8
+7
View File
@@ -27,6 +27,10 @@
#include <sys/ioccom.h> #include <sys/ioccom.h>
#include <sys/socket.h> #include <sys/socket.h>
#ifdef ATOMIC_FUNCS_ARE_SYSCALLS
#include <arch/atomic.h>
#endif
#define INT32TOINT64(x, y) ((int64)(x) | ((int64)(y) << 32)) #define INT32TOINT64(x, y) ((int64)(x) | ((int64)(y) << 32))
#define arg0 (((uint32 *)arg_buffer)[0]) #define arg0 (((uint32 *)arg_buffer)[0])
@@ -353,6 +357,8 @@ int syscall_dispatcher(unsigned long call_num, void *arg_buffer, uint64 *call_re
case SYSCALL_SETRLIMIT: case SYSCALL_SETRLIMIT:
*call_ret = user_setrlimit((int)arg0, (const struct rlimit *)arg1); *call_ret = user_setrlimit((int)arg0, (const struct rlimit *)arg1);
break; break;
#ifdef ATOMIC_FUNCS_ARE_SYSCALLS
case SYSCALL_ATOMIC_ADD: case SYSCALL_ATOMIC_ADD:
*call_ret = user_atomic_add((int32 *)arg0, (int32)arg1); *call_ret = user_atomic_add((int32 *)arg0, (int32)arg1);
break; break;
@@ -368,6 +374,7 @@ int syscall_dispatcher(unsigned long call_num, void *arg_buffer, uint64 *call_re
case SYSCALL_TEST_AND_SET: case SYSCALL_TEST_AND_SET:
*call_ret = user_test_and_set((int32 *)arg0, (int32)arg1, (int32)arg2); *call_ret = user_test_and_set((int32 *)arg0, (int32)arg1, (int32)arg2);
break; break;
#endif
// image calls // image calls
case SYSCALL_REGISTER_IMAGE: case SYSCALL_REGISTER_IMAGE: