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

Add suport for RISCV64 #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions deps/leveldb/leveldb-1.20/port/atomic_pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#define ARCH_CPU_PPC_FAMILY 1
#elif defined(__mips__)
#define ARCH_CPU_MIPS_FAMILY 1
#elif defined(__riscv)
#define ARCH_CPU_RISCV64_FAMILY 1
#endif

namespace leveldb {
Expand Down Expand Up @@ -103,6 +105,13 @@ inline void MemoryBarrier() {
}
#define LEVELDB_HAVE_MEMORY_BARRIER

// RISCV64
#elif defined(ARCH_CPU_RISCV64_FAMILY)
inline void MemoryBarrier() {
asm volatile("fence iorw, iorw" : : : "memory");
}
#define LEVELDB_HAVE_MEMORY_BARRIER

// PPC
#elif defined(ARCH_CPU_PPC_FAMILY) && defined(__GNUC__)
inline void MemoryBarrier() {
Expand Down