diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2016-01-13 15:21:39 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-02-08 20:45:23 +0300 |
commit | 54b34bb48576fc6c7258a522871555388415bb69 (patch) | |
tree | afdd89540bdc3388e008335134942823110e0c90 /helper | |
parent | 59128f5dc4cc831f569567917069b20ab045771e (diff) |
helper: deleted odph_pause
Deleted odph_pause() and replaced usage with odp_cpu_pause()
calls.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper')
-rw-r--r-- | helper/Makefile.am | 1 | ||||
-rw-r--r-- | helper/odph_pause.h | 54 | ||||
-rw-r--r-- | helper/ring.c | 10 | ||||
-rw-r--r-- | helper/test/Makefile.am | 2 | ||||
-rw-r--r-- | helper/test/odph_pause.c | 14 |
5 files changed, 3 insertions, 78 deletions
diff --git a/helper/Makefile.am b/helper/Makefile.am index 876e541a0..a8665b287 100644 --- a/helper/Makefile.am +++ b/helper/Makefile.am @@ -24,7 +24,6 @@ helperinclude_HEADERS = \ noinst_HEADERS = \ $(srcdir)/odph_debug.h \ - $(srcdir)/odph_pause.h \ $(srcdir)/odph_hashtable.h \ $(srcdir)/odph_lineartable.h \ $(srcdir)/odph_list_internal.h diff --git a/helper/odph_pause.h b/helper/odph_pause.h deleted file mode 100644 index 5618f1fee..000000000 --- a/helper/odph_pause.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODPH_PAUSE_H_ -#define ODPH_PAUSE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Spin loop for helper internal use - */ -static inline void odph_pause(void) -{ -#if defined __x86_64__ || defined __i386__ - -#ifdef __SSE2__ - __asm__ __volatile__ ("pause"); -#else - __asm__ __volatile__ ("rep; nop"); -#endif - -#elif defined __arm__ - -#if __ARM_ARCH == 7 - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); -#endif - -#elif defined __OCTEON__ - - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - -#endif -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/helper/ring.c b/helper/ring.c index 312217377..669918682 100644 --- a/helper/ring.c +++ b/helper/ring.c @@ -69,15 +69,11 @@ * ***************************************************************************/ -#include <odp/shared_memory.h> -#include <odp/spinlock.h> -#include "odph_pause.h" -#include <odp/align.h> +#include <odp.h> #include <fcntl.h> #include <stdio.h> #include <string.h> #include "odph_debug.h" -#include <odp/rwlock.h> #include <odp/helper/ring.h> static TAILQ_HEAD(, odph_ring) odp_ring_list; @@ -283,7 +279,7 @@ int __odph_ring_mp_do_enqueue(odph_ring_t *r, void * const *obj_table, * we need to wait for them to complete */ while (odp_unlikely(r->prod.tail != prod_head)) - odph_pause(); + odp_cpu_pause(); /* Release our entries and the memory they refer to */ __atomic_thread_fence(__ATOMIC_RELEASE); @@ -400,7 +396,7 @@ int __odph_ring_mc_do_dequeue(odph_ring_t *r, void **obj_table, * we need to wait for them to complete */ while (odp_unlikely(r->cons.tail != cons_head)) - odph_pause(); + odp_cpu_pause(); /* Release our entries and the memory they refer to */ __atomic_thread_fence(__ATOMIC_RELEASE); diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am index d6820e188..bbad2a58b 100644 --- a/helper/test/Makefile.am +++ b/helper/test/Makefile.am @@ -8,7 +8,6 @@ TESTS_ENVIRONMENT += TEST_DIR=${builddir} EXECUTABLES = odp_chksum$(EXEEXT) \ odp_thread$(EXEEXT) \ odp_process$(EXEEXT)\ - odph_pause$(EXEEXT)\ odp_table$(EXEEXT) COMPILE_ONLY = @@ -29,5 +28,4 @@ dist_odp_thread_SOURCES = odp_thread.c odp_thread_LDADD = $(LIB)/libodphelper.la $(LIB)/libodp.la dist_odp_process_SOURCES = odp_process.c odp_process_LDADD = $(LIB)/libodphelper.la $(LIB)/libodp.la -odph_pause_SOURCES = odph_pause.c dist_odp_table_SOURCES = odp_table.c diff --git a/helper/test/odph_pause.c b/helper/test/odph_pause.c deleted file mode 100644 index f5f5da341..000000000 --- a/helper/test/odph_pause.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include <test_debug.h> -#include "../odph_pause.h" - -int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) -{ - odph_pause(); - return 0; -} |