dfaf77
commit 547f44124e1a38b8c5c635f673d88054ce6ff0d3
dfaf77
Author: Asim YarKhan <yarkhan@icl.utk.edu>
dfaf77
Date:   Thu Oct 16 12:19:34 2014 -0400
dfaf77
dfaf77
    byte_profile.c: PPC64 add support for PPC64 Little Endian to byte_profile.c
dfaf77
    
dfaf77
    Thanks to Carl Love for this patch and the following description:
dfaf77
    The POWER 8 platform is Little Endian.  It uses ELF
dfaf77
    version 2 which does not use function descriptors.  This
dfaf77
    patch adds the needed #ifdef support to correctly compile
dfaf77
    the test case for Big Endian or Little Endian.
dfaf77
    
dfaf77
    This patch is untested by the PAPI developers (hardware not easily accessible).
dfaf77
dfaf77
diff --git a/src/ctests/byte_profile.c b/src/ctests/byte_profile.c
dfaf77
index 0f33c0d..f693e9f 100644
dfaf77
--- a/src/ctests/byte_profile.c
dfaf77
+++ b/src/ctests/byte_profile.c
dfaf77
@@ -213,9 +213,14 @@ main( int argc, char **argv )
dfaf77
 /* Itanium and PowerPC64 processors return function descriptors instead
dfaf77
  * of function addresses. You must dereference the descriptor to get the address.
dfaf77
 */
dfaf77
-#if defined(ITANIUM1) || defined(ITANIUM2) || defined(__powerpc64__)
dfaf77
+#if defined(ITANIUM1) || defined(ITANIUM2) \
dfaf77
+    || (defined(__powerpc64__) && (_CALL_ELF != 2))
dfaf77
 	start = ( caddr_t ) ( ( ( struct fdesc * ) start )->ip );
dfaf77
 	end = ( caddr_t ) ( ( ( struct fdesc * ) end )->ip );
dfaf77
+        /* PPC64 Big Endian is ELF version 1 which uses function descriptors.
dfaf77
+         *  PPC64 Little Endian is ELF version 2 which does not use
dfaf77
+         * function descriptors
dfaf77
+         */
dfaf77
 #endif
dfaf77
 
dfaf77
 	/* call dummy so it doesn't get optimized away */
dfaf77
commit 14f70ebc77deaad4a3fc3f808613772ef1165137
dfaf77
Author: Asim YarKhan <yarkhan@icl.utk.edu>
dfaf77
Date:   Wed Oct 15 14:48:05 2014 -0400
dfaf77
dfaf77
    PPC64 add support for PPC64 Little Endian to sprofile.c
dfaf77
    
dfaf77
    Thanks to Carl Love for this patch and the following description:
dfaf77
    The POWER 8 platform is Little Endian.  It uses ELF
dfaf77
    version 2 which does not use function descriptors.  This
dfaf77
    patch adds the needed #ifdef support to correctly compile
dfaf77
    the test case for Big Endian or Little Endian.
dfaf77
dfaf77
diff --git a/src/ctests/sprofile.c b/src/ctests/sprofile.c
dfaf77
index e7ee47a..4bd7cc7 100644
dfaf77
--- a/src/ctests/sprofile.c
dfaf77
+++ b/src/ctests/sprofile.c
dfaf77
@@ -1,4 +1,4 @@
dfaf77
-/* 
dfaf77
+/*
dfaf77
 * File:    sprofile.c
dfaf77
 * Author:  Philip Mucci
dfaf77
 *          mucci@cs.utk.edu
dfaf77
@@ -10,10 +10,15 @@
dfaf77
 
dfaf77
 /* These architectures use Function Descriptors as Function Pointers */
dfaf77
 
dfaf77
-#if (defined(linux) && defined(__ia64__)) || (defined(_AIX)) ||(defined(__powerpc64__))
dfaf77
+#if (defined(linux) && defined(__ia64__)) || (defined(_AIX)) \
dfaf77
+  || ((defined(__powerpc64__) && (_CALL_ELF != 2)))
dfaf77
+/* PPC64 Big Endian is ELF version 1 which uses function descriptors */
dfaf77
 #define DO_READS (unsigned long)(*(void **)do_reads)
dfaf77
 #define DO_FLOPS (unsigned long)(*(void **)do_flops)
dfaf77
 #else
dfaf77
+/* PPC64 Little Endian is ELF version 2 which does not use
dfaf77
+ * function descriptors
dfaf77
+ */
dfaf77
 #define DO_READS (unsigned long)(do_reads)
dfaf77
 #define DO_FLOPS (unsigned long)(do_flops)
dfaf77
 #endif