Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pause support for RISC-V #65

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/boost/atomic/detail/pause.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ BOOST_FORCEINLINE void pause() BOOST_NOEXCEPT
__asm__ __volatile__("pause;" : : : "memory");
#elif (defined(__ARM_ARCH) && __ARM_ARCH >= 8) || defined(__ARM_ARCH_8A__) || defined(__aarch64__)
__asm__ __volatile__("yield;" : : : "memory");
#elif defined(__riscv) && __riscv_xlen == 64
#if defined(__riscv_zihintpause)
__asm__ __volatile__("pause" : : : "memory");
#else
/* Encoding of the pause instruction */
__asm__ __volatile__ (".4byte 0x100000F");
#endif
#endif
#endif
}
Expand Down