Skip to content

Commit

Permalink
thread: Move a declaration into #if block where it is used
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse committed Dec 29, 2023
1 parent 2084f4d commit d79c8ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mcfgthread/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ uint32_t
_MCF_thread_self_tid(void) __MCF_NOEXCEPT
{
uint32_t __tid;
char* __teb __attribute__((__unused__));
#if defined(__amd64__)
/* Current TEB starts at `gs:0`. */
__asm__ ("{ movl %%gs:0x48, %0 | mov %0, dword ptr gs:[0x48] }" : "=r"(__tid));
Expand All @@ -305,6 +304,7 @@ _MCF_thread_self_tid(void) __MCF_NOEXCEPT
__asm__ ("ldr %w0, [x18, #0x48]" : "=r"(__tid));
#elif defined(__arm__)
/* Current TEB base is moved from co-processor p15. */
char* __teb;
__asm__ ("mrc p15, #0, %0, c13, c0, #2" : "=r"(__teb));
__tid = *(uint32_t*) (__teb + 0x24);
#else
Expand Down

0 comments on commit d79c8ef

Please sign in to comment.