diff --git a/config/cpu/generic/atomicity.h b/config/cpu/generic/atomicity.h index 655cc14..0b25100 100644 --- a/config/cpu/generic/atomicity.h +++ b/config/cpu/generic/atomicity.h @@ -20,24 +20,20 @@ #ifndef _ATOMICITY_H #define _ATOMICITY_H 1 -#warning "stub atomicity functions are not atomic on this platform" - typedef int _Atomic_word; static inline _Atomic_word __attribute__ ((__unused__)) __exchange_and_add(volatile _Atomic_word* mem, int val) { - int result = *mem; - *mem += val; - return result; + return __sync_fetch_and_add(mem, val); } static inline void __attribute__ ((__unused__)) __atomic_add(volatile _Atomic_word* mem, int val) { - *mem += val; + __sync_add_and_fetch(mem, val); } #endif /* atomicity.h */ diff --git a/config/cpu/generic/cycles.h b/config/cpu/generic/cycles.h index 8213a05..b05fb0e 100644 --- a/config/cpu/generic/cycles.h +++ b/config/cpu/generic/cycles.h @@ -22,17 +22,16 @@ /* generic solution that is not really a solution at all */ -#warning You are compiling JACK on a platform for which jack/config/sysdep/cycles.h needs work #include typedef long cycles_t; static inline cycles_t get_cycles(void) { - struct timeval tv; - gettimeofday (&tv, NULL); + struct timespec time; + clock_gettime(CLOCK_REALTIME, &time); - return ((cycles_t) tv.tv_sec * 1000000) + tv.tv_usec; + return ((cycles_t) time.tv_sec * 1000000) + time.tv_nsec*1000; } #endif /* __jack_cycles_h__ */