c7ea89
commit 071943b6ffb67047c78bc7e7c370fc41c16ef538
c7ea89
Author: William Cohen <wcohen@redhat.com>
c7ea89
Date:   Fri Oct 11 13:41:41 2013 -0400
c7ea89
c7ea89
    add preliminary aarch64 (arm64) support
c7ea89
    
c7ea89
    There has been some work to build fedora 19 on 64-bit arm armv8 machines
c7ea89
    (aarch64).  I took a look that the why the papi build was failing.  The
c7ea89
    attached is a set of minimal patches to get papi to build.  The patch is
c7ea89
    just a step toward getting aarch64 support for papi. Things are not all
c7ea89
    there for papi to work in that environment.  Still need libpfm to
c7ea89
    support aarch64 and papi_events.csv describing mappings to machine
c7ea89
    specific events.
c7ea89
c7ea89
diff --git a/src/configure b/src/configure
c7ea89
index 7cbd262..3c50e20 100755
c7ea89
--- a/src/configure
c7ea89
+++ b/src/configure
c7ea89
@@ -4262,7 +4262,7 @@ _ACEOF
c7ea89
 
c7ea89
 # First set pthread-mutexes based on arch
c7ea89
 case $arch in
c7ea89
-  arm*)
c7ea89
+  aarch64|arm*)
c7ea89
     pthread_mutexes=yes
c7ea89
     CFLAGS="$CFLAGS -DUSE_PTHREAD_MUTEXES"
c7ea89
     echo "forcing use of pthread mutexes... " >&6
c7ea89
diff --git a/src/configure.in b/src/configure.in
c7ea89
index 2a73ad6..acc8bfc 100644
c7ea89
--- a/src/configure.in
c7ea89
+++ b/src/configure.in
c7ea89
@@ -382,7 +382,7 @@ AC_DEFINE_UNQUOTED(CPU,$CPU,[cpu type])
c7ea89
 
c7ea89
 # First set pthread-mutexes based on arch                                       
c7ea89
 case $arch in
c7ea89
-  arm*)
c7ea89
+  aarch64|arm*)
c7ea89
     pthread_mutexes=yes
c7ea89
     CFLAGS="$CFLAGS -DUSE_PTHREAD_MUTEXES"
c7ea89
     echo "forcing use of pthread mutexes... " >&6
c7ea89
diff --git a/src/linux-context.h b/src/linux-context.h
c7ea89
index 2135695..524490b 100644
c7ea89
--- a/src/linux-context.h
c7ea89
+++ b/src/linux-context.h
c7ea89
@@ -31,6 +31,8 @@ typedef ucontext_t hwd_ucontext_t;
c7ea89
 #define OVERFLOW_ADDRESS(ctx) ((struct sigcontext *)ctx.ucontext)->si_regs.pc
c7ea89
 #elif defined(__arm__)
c7ea89
 #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.arm_pc
c7ea89
+#elif defined(__aarch64__)
c7ea89
+#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc
c7ea89
 #elif defined(__mips__)
c7ea89
 #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc
c7ea89
 #else
c7ea89
diff --git a/src/linux-timer.c b/src/linux-timer.c
c7ea89
index 8e2d21f..9b918cd 100644
c7ea89
--- a/src/linux-timer.c
c7ea89
+++ b/src/linux-timer.c
c7ea89
@@ -215,7 +215,7 @@ get_cycles( void )
c7ea89
 /* POWER get_cycles()   */
c7ea89
 /************************/
c7ea89
 
c7ea89
-#elif (defined(__powerpc__) || defined(__arm__) || defined(__mips__))
c7ea89
+#elif (defined(__powerpc__) || defined(__arm__) || defined(__mips__) || defined(__aarch64__))
c7ea89
 /*
c7ea89
  * It's not possible to read the cycles from user space on ppc970.
c7ea89
  * There is a 64-bit time-base register (TBU|TBL), but its
c7ea89
commit 479e89a51ee18ba331c86a41be9ff17cd501e6d9
c7ea89
Author: William Cohen <wcohen@redhat.com>
c7ea89
Date:   Wed May 28 17:01:41 2014 -0400
c7ea89
c7ea89
    Add aarch64 Cortex A57 presets
c7ea89
    
c7ea89
    The events for the ARM Cortex A57 events look to be the same as the
c7ea89
    events for the ARM Cortex A15 events. Add an entry so the preset are
c7ea89
    available for the ARM Cortex A57.
c7ea89
c7ea89
diff --git a/src/papi_events.csv b/src/papi_events.csv
c7ea89
index 441844e..dbbc8d8 100644
c7ea89
--- a/src/papi_events.csv
c7ea89
+++ b/src/papi_events.csv
c7ea89
@@ -1473,6 +1473,7 @@ PRESET,PAPI_L1_DCM,NOT_DERIVED,DCACHE_REFILL
c7ea89
 PRESET,PAPI_L1_ICM,NOT_DERIVED,IFETCH_MISS
c7ea89
 #
c7ea89
 CPU,arm_ac15
c7ea89
+CPU,arm_ac57
c7ea89
 #
c7ea89
 PRESET,PAPI_TOT_INS,NOT_DERIVED,INST_RETIRED
c7ea89
 PRESET,PAPI_TOT_IIS,NOT_DERIVED,INST_SPEC_EXEC