diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-12-23 04:17:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-23 04:17:42 +0100 |
| commit | eec61c3f6f58b095243f5da66c71d5ee00283c10 (patch) | |
| tree | 153f9675c0351376d4e0e9f0ca3f3fd65ef60c2f /src/threading.cpp | |
| parent | 5752a374ab5b072e9d02efe396cc5f92e93e5ebf (diff) | |
| parent | dce120258fbca70dfaa9a738bc168463df7a3dda (diff) | |
Merge pull request #1388 from Yawning/feature/linux-aarch64
src: Add preliminary support for Linux AArch64
Diffstat (limited to 'src/threading.cpp')
| -rw-r--r-- | src/threading.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/threading.cpp b/src/threading.cpp index e9412b411..b318e4ff1 100644 --- a/src/threading.cpp +++ b/src/threading.cpp @@ -296,6 +296,8 @@ u32 thread_current_id(void) { __asm__("mov %%gs:0x08,%0" : "=r"(thread_id)); #elif defined(GB_ARCH_64_BIT) && defined(GB_CPU_X86) __asm__("mov %%fs:0x10,%0" : "=r"(thread_id)); +#elif defined(GB_SYSTEM_LINUX) + thread_id = gettid(); #else #error Unsupported architecture for thread_current_id() #endif @@ -315,6 +317,8 @@ gb_inline void yield_thread(void) { #endif #elif defined(GB_CPU_X86) _mm_pause(); +#elif defined(GB_CPU_ARM) + __asm__ volatile ("yield" : : : "memory"); #else #error Unknown architecture #endif |