Skip to content

Commit

Permalink
Merge pull request #679 from taguchi-ch/proto
Browse files Browse the repository at this point in the history
fix FreeBSD aarch64 build issue
  • Loading branch information
robertdavidgraham authored Nov 1, 2023
2 parents 6bd2af0 + abd6d44 commit c206346
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/smack1.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@
#elif defined(__FreeBSD__)
#include <sys/types.h>
#include <machine/cpufunc.h>
#define __rdtsc rdtsc
#if (__ARM_ARCH >= 6) // V6 is the earliest arch that has a standard cyclecount
unsigned long long rdtsc(void)
#if (__ARM_ARCH >= 6 && __ARM_ARCH <= 7) // V6 is the earliest arch that has a standard cyclecount
unsigned long long __rdtsc(void)
{
uint32_t pmccntr;
uint32_t pmuseren;
Expand All @@ -138,6 +137,10 @@ unsigned long long rdtsc(void)
}
return 0;
}
#elif defined(__aarch64__)
#define __rdtsc() 0
#else
#define __rdtsc rdtsc
#endif
#elif defined (__llvm__)
#if defined(i386) || defined(__i386__)
Expand Down

0 comments on commit c206346

Please sign in to comment.