Skip to content

Commit

Permalink
Add arm64 support to leveldb.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmumford committed Dec 11, 2014
1 parent cea9b10 commit c4c38f9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions port/atomic_pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#define ARCH_CPU_X86_FAMILY 1
#elif defined(__ARMEL__)
#define ARCH_CPU_ARM_FAMILY 1
#elif defined(__aarch64__)
#define ARCH_CPU_ARM64_FAMILY 1
#elif defined(__ppc__) || defined(__powerpc__) || defined(__powerpc64__)
#define ARCH_CPU_PPC_FAMILY 1
#endif
Expand Down Expand Up @@ -92,6 +94,13 @@ inline void MemoryBarrier() {
}
#define LEVELDB_HAVE_MEMORY_BARRIER

// ARM64
#elif defined(ARCH_CPU_ARM64_FAMILY)
inline void MemoryBarrier() {
asm volatile("dmb sy" : : : "memory");
}
#define LEVELDB_HAVE_MEMORY_BARRIER

// PPC
#elif defined(ARCH_CPU_PPC_FAMILY) && defined(__GNUC__)
inline void MemoryBarrier() {
Expand Down Expand Up @@ -215,6 +224,7 @@ class AtomicPointer {
#undef LEVELDB_HAVE_MEMORY_BARRIER
#undef ARCH_CPU_X86_FAMILY
#undef ARCH_CPU_ARM_FAMILY
#undef ARCH_CPU_ARM64_FAMILY
#undef ARCH_CPU_PPC_FAMILY

} // namespace port
Expand Down

0 comments on commit c4c38f9

Please sign in to comment.