xref: /haiku/src/system/libroot/os/arch/x86_64/thread.cpp (revision 04a0e9c7b68cbe3a43d38e2bca8e860fd80936fb)
1 /*
2  * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <OS.h>
8 #include "syscalls.h"
9 
10 
11 thread_id
12 find_thread(const char* name)
13 {
14 	if (!name) {
15 		thread_id thread;
16 		__asm__ __volatile__ ("movq %%fs:8, %%rax" : "=a" (thread));
17 		return thread;
18 	}
19 
20 	return _kern_find_thread(name);
21 }
22 
23