Added the inline x86 asm version of find_thread() as it is found on BeOS.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6865 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-03-03 00:44:18 +00:00
parent 54abea93f0
commit 6f3a136e47
+15 -1
View File
@@ -271,8 +271,22 @@ extern void exit_thread(status_t status);
extern status_t wait_for_thread (thread_id thread, status_t *threadReturnValue);
extern status_t on_exit_thread(void (*callback)(void *), void *data);
// ToDo: we also need the INTEL static inline here for compatibility (and the _kfind_thread_() function)
#if __INTEL__ && !_KERNEL_MODE && !_NO_INLINE_ASM
static inline thread_id
find_thread(const char *name) {
extern thread_id _kfind_thread_(const char *name);
if (!name) {
thread_id thread;
__asm__ __volatile__ (
"movl %%fs:4, %%eax \n\t"
: "=a"(thread) );
return thread;
}
return _kfind_thread_(name);
}
#else
extern thread_id find_thread(const char *name);
#endif
extern status_t send_data(thread_id thread, int32 code, const void *buffer, size_t buffer_size);
extern status_t receive_data(thread_id *sender, void *buffer, size_t buffer_size);