summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-05-10 21:06:28 +0200
committerDave Barach <openvpp@barachs.net>2017-05-10 22:01:15 +0000
commitf55f9b851f59264d737d92c6277a87588c565d24 (patch)
tree4e1c69bed3ff6b0968b9558a814a23edac4f9ae6 /src/vlib
parente5f1d27695e2e6b9be17198e9b49e95639a15c58 (diff)
completelly deprecate os_get_cpu_number, replace new occurences
Change-Id: I82c663bc0866c6c68ba354104b0bb059387f4b9d Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/main.h2
-rw-r--r--src/vlib/threads.c12
-rw-r--r--src/vlib/threads.h3
-rw-r--r--src/vlib/unix/main.c2
4 files changed, 5 insertions, 14 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h
index 329bf0733e4..0e8026d17b0 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -320,7 +320,7 @@ always_inline void vlib_set_queue_signal_callback
/* Main routine. */
int vlib_main (vlib_main_t * vm, unformat_input_t * input);
-/* Thread stacks, for os_get_cpu_number */
+/* Thread stacks, for os_get_thread_index */
extern u8 **vlib_thread_stacks;
/* Number of thread stacks that the application needs */
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index 9ccfd3a2901..b7bc9e26c0c 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -35,16 +35,8 @@ vl (void *p)
vlib_worker_thread_t *vlib_worker_threads;
vlib_thread_main_t vlib_thread_main;
-__thread uword vlib_thread_index = 0;
-
-uword
-os_get_cpu_number (void)
-{
- return vlib_thread_index;
-}
-
uword
-os_get_ncpus (void)
+os_get_nthreads (void)
{
u32 len;
@@ -467,7 +459,7 @@ vlib_worker_thread_bootstrap_fn (void *arg)
w->lwp = syscall (SYS_gettid);
w->thread_id = pthread_self ();
- vlib_thread_index = w - vlib_worker_threads;
+ __os_thread_index = w - vlib_worker_threads;
rv = (void *) clib_calljmp
((uword (*)(uword)) w->thread_function,
diff --git a/src/vlib/threads.h b/src/vlib/threads.h
index 101d3d4ac1f..17d35a24b34 100644
--- a/src/vlib/threads.h
+++ b/src/vlib/threads.h
@@ -181,11 +181,10 @@ u32 vlib_frame_queue_main_init (u32 node_index, u32 frame_queue_nelts);
void vlib_worker_thread_barrier_sync (vlib_main_t * vm);
void vlib_worker_thread_barrier_release (vlib_main_t * vm);
-extern __thread uword vlib_thread_index;
static_always_inline uword
vlib_get_thread_index (void)
{
- return vlib_thread_index;
+ return __os_thread_index;
}
always_inline void
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index db5ddd64d31..103576db01c 100644
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -565,7 +565,7 @@ vlib_unix_main (int argc, char *argv[])
vlib_thread_stack_init (0);
- vlib_thread_index = 0;
+ __os_thread_index = 0;
i = clib_calljmp (thread0, (uword) vm,
(void *) (vlib_thread_stacks[0] +