Use thread local storage for thread index
This patch deprecates stack-based thread identification,
Also removes requirement that thread stacks are adjacent.
Finally, possibly annoying for some folks, it renames
all occurences of cpu_index and cpu_number with thread
index. Using word "cpu" is misleading here as thread can
be migrated ti different CPU, and also it is not related
to linux cpu index.
Change-Id: I68cdaf661e701d2336fc953dcb9978d10a70f7c1
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vlib/global_funcs.h b/src/vlib/global_funcs.h
index f51ec38..9dd01fb 100644
--- a/src/vlib/global_funcs.h
+++ b/src/vlib/global_funcs.h
@@ -23,7 +23,7 @@
vlib_get_main (void)
{
vlib_main_t *vm;
- vm = vlib_mains[os_get_cpu_number ()];
+ vm = vlib_mains[vlib_get_thread_index ()];
ASSERT (vm);
return vm;
}