summaryrefslogtreecommitdiffstats
path: root/src/vlib/global_funcs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/global_funcs.h')
-rw-r--r--src/vlib/global_funcs.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vlib/global_funcs.h b/src/vlib/global_funcs.h
index 63f8115a181..3c0fdb78364 100644
--- a/src/vlib/global_funcs.h
+++ b/src/vlib/global_funcs.h
@@ -22,14 +22,14 @@
always_inline u32
vlib_get_n_threads ()
{
- return vec_len (vlib_mains);
+ return vec_len (vlib_global_main.vlib_mains);
}
always_inline vlib_main_t *
vlib_get_main_by_index (u32 thread_index)
{
vlib_main_t *vm;
- vm = vlib_mains[thread_index];
+ vm = vlib_global_main.vlib_mains[thread_index];
ASSERT (vm);
return vm;
}
@@ -46,6 +46,12 @@ vlib_get_first_main (void)
return vlib_get_main_by_index (0);
}
+always_inline vlib_global_main_t *
+vlib_get_global_main (void)
+{
+ return &vlib_global_main;
+}
+
always_inline vlib_thread_main_t *
vlib_get_thread_main ()
{
@@ -55,8 +61,8 @@ vlib_get_thread_main ()
always_inline elog_main_t *
vlib_get_elog_main ()
{
- vlib_main_t *vm = vlib_get_first_main ();
- return &vm->elog_main;
+ vlib_global_main_t *vgm = vlib_get_global_main ();
+ return &vgm->elog_main;
}
#endif /* included_vlib_global_funcs_h_ */