#include <stdlib.h>
#include <sys/time.h>
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles (void)
-{
- cycles_t thetime;
- struct timeval tv;
-
- if (gettimeofday(&tv, NULL) != 0)
- return 0;
- thetime = ((cycles_t)tv.tv_sec) * 1000000ULL + ((cycles_t)tv.tv_usec);
- return (cycles_t)thetime;
-}
-
/*
* Define the membarrier system call number if not yet available in the
* system headers. aarch64 implements asm-generic/unistd.h system call
#define cmm_wmb() __asm__ __volatile__ ("wmb":::"memory")
#define cmm_read_barrier_depends() __asm__ __volatile__ ("mb":::"memory")
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles (void)
-{
- return 0; /* not supported */
-}
-
#ifdef __cplusplus
}
#endif
#include <stdlib.h>
#include <sys/time.h>
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles (void)
-{
- cycles_t thetime;
- struct timeval tv;
-
- if (gettimeofday(&tv, NULL) != 0)
- return 0;
- thetime = ((cycles_t)tv.tv_sec) * 1000000ULL + ((cycles_t)tv.tv_usec);
- return (cycles_t)thetime;
-}
-
/*
* Define the membarrier system call number if not yet available in the
* system headers.
#include <stdlib.h>
#include <sys/time.h>
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles (void)
-{
- cycles_t thetime;
- struct timeval tv;
-
- if (gettimeofday(&tv, NULL) != 0)
- return 0;
- thetime = ((cycles_t)tv.tv_sec) * 1000000ULL + ((cycles_t)tv.tv_usec);
- return (cycles_t)thetime;
-}
-
#ifdef __cplusplus
}
#endif
#define caa_cpu_relax() cmm_barrier()
#endif
+#ifndef HAS_CAA_GET_CYCLES
+#define HAS_CAA_GET_CYCLES
+typedef unsigned long long cycles_t;
+
+static inline cycles_t caa_get_cycles (void)
+{
+ cycles_t thetime;
+ struct timeval tv;
+
+ if (gettimeofday(&tv, NULL) != 0)
+ return 0;
+ thetime = ((cycles_t)tv.tv_sec) * 1000000ULL + ((cycles_t)tv.tv_usec);
+ return (cycles_t)thetime;
+}
+#endif /* HAS_CAA_GET_CYCLES */
+
#ifdef __cplusplus
}
#endif
#ifndef _URCU_ARCH_HPPA_H
#define _URCU_ARCH_HPPA_H
+/*
+ * arch/hppa.h: definitions for hppa architecture
+ *
+ * Copyright (c) 2014 Helge Deller <deller@gmx.de>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#include <urcu/compiler.h>
#include <urcu/config.h>
#include <urcu/syscall-compat.h>
#include <stdlib.h>
#include <sys/time.h>
+#define HAS_CAA_GET_CYCLES
typedef unsigned long cycles_t;
static inline cycles_t caa_get_cycles(void)
#include <stdlib.h>
#include <sys/time.h>
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles (void)
-{
- cycles_t thetime;
- struct timeval tv;
-
- if (gettimeofday(&tv, NULL) != 0)
- return 0;
- thetime = ((cycles_t)tv.tv_sec) * 1000000ULL + ((cycles_t)tv.tv_usec);
- return (cycles_t)thetime;
-}
-
/*
* Define the membarrier system call number if not yet available in the
* system headers.
" .set mips0 \n" \
:::"memory")
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles(void)
-{
- return 0; /* not supported */
-}
-
#ifdef __cplusplus
}
#endif
rval; \
})
+#define HAS_CAA_GET_CYCLES
+
typedef unsigned long long cycles_t;
#ifdef __powerpc64__
#define cmm_mb() __asm__ __volatile__("bcr 15,0" : : : "memory")
+#define HAS_CAA_GET_CYCLES
+
typedef unsigned long long cycles_t;
static inline cycles_t caa_get_cycles (void)
#define cmm_rmb() membar_safe("#LoadLoad")
#define cmm_wmb() membar_safe("#StoreStore")
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles (void)
-{
- return 0; /* unimplemented */
-}
-
#ifdef __cplusplus
}
#endif
#include <stdlib.h>
#include <sys/time.h>
-typedef unsigned long long cycles_t;
-
-static inline cycles_t caa_get_cycles (void)
-{
- cycles_t thetime;
- struct timeval tv;
-
- if (gettimeofday(&tv, NULL) != 0)
- return 0;
- thetime = ((cycles_t)tv.tv_sec) * 1000000ULL + ((cycles_t)tv.tv_usec);
- return (cycles_t)thetime;
-}
-
/*
* Define the membarrier system call number if not yet available in the
* system headers. tile implements asm-generic/unistd.h system call
#define caa_cpu_relax() __asm__ __volatile__ ("rep; nop" : : : "memory")
+#define HAS_CAA_GET_CYCLES
+
#define rdtscll(val) \
do { \
unsigned int __a, __d; \