diff options
-rw-r--r-- | example/timer/odp_timer_test.c | 2 | ||||
-rw-r--r-- | include/odp/api/thread.h | 8 | ||||
-rw-r--r-- | platform/linux-generic/odp_thread.c | 3 | ||||
-rw-r--r-- | test/performance/odp_scheduling.c | 2 | ||||
-rw-r--r-- | test/validation/odp_synchronizers.c | 12 |
5 files changed, 10 insertions, 17 deletions
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 9d16b8e58..1961dad11 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -192,7 +192,7 @@ static void *run_thread(void *ptr) args = ptr; thr = odp_thread_id(); - printf("Thread %i starts on cpu %i\n", thr, odp_thread_cpu()); + printf("Thread %i starts on cpu %i\n", thr, odp_cpu_id()); /* * Find the pool diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h index e5185f297..4eb69cb83 100644 --- a/include/odp/api/thread.h +++ b/include/odp/api/thread.h @@ -29,14 +29,6 @@ extern "C" { */ int odp_thread_id(void); - -/** - * Get CPU number - * - * @return CPU number where the thread is currently running - */ -int odp_thread_cpu(void); - /** * @} */ diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index e66b8c1cc..ac8c9dea0 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -16,6 +16,7 @@ #include <odp_debug_internal.h> #include <odp/shared_memory.h> #include <odp/align.h> +#include <odp/cpu.h> #include <string.h> #include <stdio.h> @@ -118,7 +119,7 @@ int odp_thread_id(void) } -int odp_thread_cpu(void) +int odp_cpu_id(void) { return this_thread->cpu; } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 46af479e7..b62d7a8ff 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -610,7 +610,7 @@ static void *run_thread(void *arg) thr = odp_thread_id(); - printf("Thread %i starts on CPU %i\n", thr, odp_thread_cpu()); + printf("Thread %i starts on CPU %i\n", thr, odp_cpu_id()); shm = odp_shm_lookup("test_globals"); globals = odp_shm_addr(shm); diff --git a/test/validation/odp_synchronizers.c b/test/validation/odp_synchronizers.c index 33618352a..8786c6947 100644 --- a/test/validation/odp_synchronizers.c +++ b/test/validation/odp_synchronizers.c @@ -119,7 +119,7 @@ static per_thread_mem_t *thread_init(void) per_thread_mem->delay_counter = 1; per_thread_mem->thread_id = odp_thread_id(); - per_thread_mem->thread_core = odp_thread_cpu(); + per_thread_mem->thread_core = odp_cpu_id(); global_shm = odp_shm_lookup(GLOBAL_SHM_NAME); global_mem = odp_shm_addr(global_shm); @@ -165,7 +165,7 @@ static uint32_t barrier_test(per_thread_mem_t *per_thread_mem, uint32_t thread_num, slow_thread_num, next_slow_thread, num_threads; uint32_t lock_owner_delay, barrier_cnt1, barrier_cnt2; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu_id() + 1; global_mem = per_thread_mem->global_mem; num_threads = global_mem->g_num_threads; iterations = BARRIER_ITERATIONS; @@ -389,7 +389,7 @@ static void *no_lock_functional_test(void *arg UNUSED) uint32_t thread_num, resync_cnt, rs_idx, iterations, cnt; uint32_t sync_failures, current_errs, lock_owner_delay; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu_id() + 1; per_thread_mem = thread_init(); global_mem = per_thread_mem->global_mem; iterations = global_mem->g_iterations; @@ -460,7 +460,7 @@ static void *spinlock_functional_test(void *arg UNUSED) uint32_t sync_failures, is_locked_errs, current_errs; uint32_t lock_owner_delay; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu_id() + 1; per_thread_mem = thread_init(); global_mem = per_thread_mem->global_mem; iterations = global_mem->g_iterations; @@ -543,7 +543,7 @@ static void *ticketlock_functional_test(void *arg UNUSED) uint32_t sync_failures, is_locked_errs, current_errs; uint32_t lock_owner_delay; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu_id() + 1; per_thread_mem = thread_init(); global_mem = per_thread_mem->global_mem; iterations = global_mem->g_iterations; @@ -627,7 +627,7 @@ static void *rwlock_functional_test(void *arg UNUSED) uint32_t thread_num, resync_cnt, rs_idx, iterations, cnt; uint32_t sync_failures, current_errs, lock_owner_delay; - thread_num = odp_thread_cpu() + 1; + thread_num = odp_cpu_id() + 1; per_thread_mem = thread_init(); global_mem = per_thread_mem->global_mem; iterations = global_mem->g_iterations; |