diff options
author | Damjan Marion <damarion@cisco.com> | 2017-05-10 21:06:28 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-05-10 22:01:15 +0000 |
commit | f55f9b851f59264d737d92c6277a87588c565d24 (patch) | |
tree | 4e1c69bed3ff6b0968b9558a814a23edac4f9ae6 /src/vppinfra/os.h | |
parent | e5f1d27695e2e6b9be17198e9b49e95639a15c58 (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/vppinfra/os.h')
-rw-r--r-- | src/vppinfra/os.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/vppinfra/os.h b/src/vppinfra/os.h index a5c74f8ce72..33300716103 100644 --- a/src/vppinfra/os.h +++ b/src/vppinfra/os.h @@ -56,8 +56,24 @@ void os_out_of_memory (void); /* Estimate, measure or divine CPU timestamp clock frequency. */ f64 os_cpu_clock_frequency (void); -uword os_get_cpu_number (void); -uword os_get_ncpus (void); +extern __thread uword __os_thread_index; + +static_always_inline uword +os_get_thread_index (void) +{ + return __os_thread_index; +} + +static_always_inline uword +os_get_cpu_number (void) __attribute__ ((deprecated)); + +static_always_inline uword +os_get_cpu_number (void) +{ + return __os_thread_index; +} + +uword os_get_nthreads (void); #include <vppinfra/smp.h> |