From 03c9f2406127b71ad5abdfd02af1609f8a67f012 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 5 Apr 2019 08:03:12 +0200 Subject: rtems: Add rtems_scheduler_get_processor() Add rtems_scheduler_get_processor() as a replacement for rtems_get_current_processor(). The rtems_get_current_processor() is a bit orphaned. Adopt it by the Scheduler Manager. This is in line with the glibc sched_getcpu() function. Deprecate rtems_get_current_processor(). Update #3731. --- cpukit/include/rtems/rtems/smp.h | 19 ------------------- cpukit/include/rtems/rtems/tasks.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 19 deletions(-) (limited to 'cpukit/include') diff --git a/cpukit/include/rtems/rtems/smp.h b/cpukit/include/rtems/rtems/smp.h index 2e0fd67d99..046c306290 100644 --- a/cpukit/include/rtems/rtems/smp.h +++ b/cpukit/include/rtems/rtems/smp.h @@ -49,25 +49,6 @@ extern "C" { */ uint32_t rtems_get_processor_count(void); -/** - * @brief Returns the index of the current processor. - * - * On uni-processor configurations a value of zero will be returned. - * - * On SMP configurations an architecture specific method is used to obtain the - * index of the current processor in the system. The set of processor indices - * is the range of integers starting with zero up to the processor count minus - * one. - * - * Outside of sections with disabled thread dispatching the current processor - * index may change after every instruction since the thread may migrate from - * one processor to another. Sections with disabled interrupts are sections - * with thread dispatching disabled. - * - * @return The index of the current processor. - */ -uint32_t rtems_get_current_processor(void); - /** @} */ #ifdef __cplusplus diff --git a/cpukit/include/rtems/rtems/tasks.h b/cpukit/include/rtems/rtems/tasks.h index 4a04e71349..630a5c5295 100644 --- a/cpukit/include/rtems/rtems/tasks.h +++ b/cpukit/include/rtems/rtems/tasks.h @@ -583,6 +583,40 @@ rtems_status_code rtems_scheduler_ident_by_processor_set( rtems_id *id ); +/** + * @brief Returns the index of the current processor. + * + * In uniprocessor configurations, a value of zero will be returned. + * + * In SMP configurations, an architecture specific method is used to obtain the + * index of the current processor in the system. The set of processor indices + * is the range of integers starting with zero up to the processor count minus + * one. + * + * Outside of sections with disabled thread dispatching the current processor + * index may change after every instruction since the thread may migrate from + * one processor to another. Sections with disabled interrupts are sections + * with thread dispatching disabled. + * + * @return The index of the current processor. + */ +uint32_t rtems_scheduler_get_processor( void ); + +/** + * @brief Returns the index of the current processor. + * + * @return The index of the current processor. + * + * @deprecated + * + * Use rtems_scheduler_get_processor() instead. + */ +RTEMS_DEPRECATED RTEMS_INLINE_ROUTINE uint32_t +rtems_get_current_processor( void ) +{ + return rtems_scheduler_get_processor(); +} + /** * @brief Gets the set of processors owned by the specified scheduler instance. * -- cgit v1.2.3