Skip to content

Commit

Permalink
Add YieldProcessor implementation for arm (#54829)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbalykov authored Jun 28, 2021
1 parent 26f0ade commit 909b1b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions src/coreclr/gc/env/gcenv.base.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,10 @@ typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(void* lpThreadParameter);

#endif // defined(__i386__) || defined(__x86_64__)

#ifdef __aarch64__
#if defined(__arm__) || defined(__aarch64__)
#define YieldProcessor() asm volatile ("yield")
#define MemoryBarrier __sync_synchronize
#endif // __aarch64__

#ifdef __arm__
#define YieldProcessor()
#define MemoryBarrier __sync_synchronize
#endif // __arm__
#endif // __arm__ || __aarch64__

#endif // _MSC_VER

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/pal/inc/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3582,7 +3582,7 @@ YieldProcessor()
__asm__ __volatile__(
"rep\n"
"nop");
#elif defined(HOST_ARM64)
#elif defined(HOST_ARM) || defined(HOST_ARM64)
__asm__ __volatile__( "yield");
#else
return;
Expand Down

0 comments on commit 909b1b2

Please sign in to comment.