diff mbox

[2/4] api: cpu: Renamed odp_thread_cpu to odp_cpu

Message ID 1422617966-27160-2-git-send-email-petri.savolainen@linaro.org
State New
Headers show

Commit Message

Petri Savolainen Jan. 30, 2015, 11:39 a.m. UTC
This return system cpu number.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 example/timer/odp_timer_test.c      |  2 +-
 include/odp/api/thread.h            |  8 --------
 platform/linux-generic/odp_thread.c |  3 ++-
 test/performance/odp_scheduling.c   |  2 +-
 test/validation/odp_synchronizers.c | 12 ++++++------
 5 files changed, 10 insertions(+), 17 deletions(-)
diff mbox

Patch

diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index 0df041f..35ea2a1 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());
 
 	/*
 	 * Find the pool
diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h
index 469d298..97d5de7 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 ID 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 e66b8c1..9169191 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(void)
 {
 	return this_thread->cpu;
 }
diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c
index 3d7167f..2f32d96 100644
--- a/test/performance/odp_scheduling.c
+++ b/test/performance/odp_scheduling.c
@@ -606,7 +606,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());
 
 	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 3361835..f48141a 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();
 
 	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() + 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() + 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() + 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() + 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() + 1;
 	per_thread_mem = thread_init();
 	global_mem = per_thread_mem->global_mem;
 	iterations = global_mem->g_iterations;