From 82e8747419db206ed697a6671785c6b19cd4e2d6 Mon Sep 17 00:00:00 2001 From: sletz Date: Mon, 23 Aug 2010 08:30:51 +0000 Subject: [PATCH] Adrian Knoth fix for linux cycle.h (ticket 188). git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4038 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 4 ++++ linux/cycles.h | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67577d3c..eddf552e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,10 @@ Adrian Knoth Jackdmp changes log --------------------------- +2010-08-23 Stephane Letz + + * Adrian Knoth fix for linux cycle.h (ticket 188). + 2010-07-07 Stephane Letz * Jan Engelhardt patch for get_cycles on SPARC. diff --git a/linux/cycles.h b/linux/cycles.h index 6b643889..20477a2e 100644 --- a/linux/cycles.h +++ b/linux/cycles.h @@ -51,7 +51,7 @@ static inline unsigned long get_cycles(void) return (((unsigned long)hi)<<32) | ((unsigned long)lo); } -#endif +#endif /* __x86_64__ */ #ifdef __sparc_v9__ /* rd is V9 only */ @@ -61,7 +61,7 @@ static inline unsigned long long get_cycles(void) __asm__ __volatile__("rd %%tick, %0" : "=r"(res)); return res; } -#endif +#endif /* __sparc_v9__ */ #ifdef __PPC__ @@ -92,7 +92,7 @@ static inline cycles_t get_cycles(void) return ret; } -#endif +#endif /* __PPC__ */ #ifdef __i386__ @@ -111,9 +111,10 @@ static inline cycles_t get_cycles (void) return ret; } -#endif +#endif /* __i386__ */ -#if defined(__FreeBSD_kernel__) +/* everything else but x86, amd64, sparcv9 or ppc */ +#if !defined (__PPC__) && !defined (__x86_64__) && !defined (__i386__) && !defined (__sparc_v9__) #warning No suitable get_cycles() implementation. Returning 0 instead @@ -124,10 +125,12 @@ static inline cycles_t get_cycles(void) return 0; } -#endif +#endif /* everything else but x86, amd64, sparcv9 or ppc */ + +#endif /* __linux__ */ -/* everything else but x86, amd64 or ppc */ -#if !defined (__PPC__) && !defined (__x86_64__) && !defined (__i386__) + +#if defined(__FreeBSD_kernel__) #warning No suitable get_cycles() implementation. Returning 0 instead @@ -138,8 +141,7 @@ static inline cycles_t get_cycles(void) return 0; } -#endif +#endif /* __FreeBSD_kernel__ */ -#endif #endif /* __jack_cycles_h__ */