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;
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,
/* zap the (per worker) frame freelists, etc */
nm_clone->frame_sizes = 0;
- nm_clone->frame_size_hash = 0;
+ nm_clone->frame_size_hash = hash_create (0, sizeof (uword));
/* Packet trace buffers are guaranteed to be empty, nothing to do here */
VLIB_EARLY_CONFIG_FUNCTION (cpu_config, "cpu");
-#if !defined (__x86_64__) && !defined (__aarch64__) && !defined (__powerpc64__) && !defined(__arm__)
+#if !defined (__x86_64__) && !defined (__i386__) && !defined (__aarch64__) && !defined (__powerpc64__) && !defined(__arm__)
void
__sync_fetch_and_add_8 (void)
{