Skip to content

Commit

Permalink
Fix compilation on AArch64
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Dec 29, 2015
1 parent c072d1c commit 45d08d6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ void jl_dump_asm_internal(uintptr_t Fptr, size_t Fsize, size_t slide,
switch (S) {
case MCDisassembler::Fail:
if (insSize == 0) // skip illegible bytes
#if defined(_CPU_PPC_) || defined(_CPU_PPC64_) || defined(_CPU_ARM_)
#if defined(_CPU_PPC_) || defined(_CPU_PPC64_) || defined(_CPU_ARM_) || defined(_CPU_AARCH64_)
insSize = 4; // instructions are always 4 bytes
#else
insSize = 1; // attempt to slide 1 byte forward
Expand Down
24 changes: 23 additions & 1 deletion src/ia_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,29 @@ STATIC_INLINE void cpu_lfence(void)
_mm_lfence();
}

#elif defined(__ARM_ARCH) && __ARM_ARCH >= 7
#elif defined(_CPU_AARCH64_)

STATIC_INLINE void cpu_pause(void)
{
__asm__ volatile ("wfe" ::: "memory");
}

STATIC_INLINE void cpu_mfence(void)
{
__asm__ volatile ("dmb ish" ::: "memory");
}

STATIC_INLINE void cpu_sfence(void)
{
__asm__ volatile ("dmb ishst" ::: "memory");
}

STATIC_INLINE void cpu_lfence(void)
{
__asm__ volatile ("dmb ishld" ::: "memory");
}

#elif defined(_CPU_ARM_) && __ARM_ARCH >= 7

STATIC_INLINE void cpu_pause(void)
{
Expand Down
2 changes: 2 additions & 0 deletions src/support/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
#define _CPU_X86_64_
#elif defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(_X86_)
#define _CPU_X86_
#elif defined(__aarch64__)
#define _CPU_AARCH64_
#elif defined(__arm__) || defined(_M_ARM)
#define _CPU_ARM_
#elif defined(__PPC64__)
Expand Down

0 comments on commit 45d08d6

Please sign in to comment.