From f9219db2a95c8285d1be22092572b4236bfe6488 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 5 Apr 2019 08:16:05 +0200 Subject: rtems: Add rtems_scheduler_get_processor_maximum() Add rtems_scheduler_get_processor_maximum() as a replacement for rtems_get_processor_count(). The rtems_get_processor_count() is a bit orphaned. Adopt it by the Scheduler Manager. The count is also misleading, since the processor set may have gaps and the actual count of online processors may be less than the value returned by rtems_get_processor_count(). Update #3732. --- cpukit/include/rtems.h | 1 - cpukit/include/rtems/rtems/smp.h | 59 -------------------------------------- cpukit/include/rtems/rtems/tasks.h | 33 +++++++++++++++++++++ 3 files changed, 33 insertions(+), 60 deletions(-) delete mode 100644 cpukit/include/rtems/rtems/smp.h (limited to 'cpukit/include') diff --git a/cpukit/include/rtems.h b/cpukit/include/rtems.h index 20a1705dc5..9f6f9cc659 100644 --- a/cpukit/include/rtems.h +++ b/cpukit/include/rtems.h @@ -55,7 +55,6 @@ #if defined(RTEMS_MULTIPROCESSING) #include #endif -#include #include #include diff --git a/cpukit/include/rtems/rtems/smp.h b/cpukit/include/rtems/rtems/smp.h deleted file mode 100644 index 046c306290..0000000000 --- a/cpukit/include/rtems/rtems/smp.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * - * @ingroup ClassicSMP - * - * @brief SMP Services API - */ - -/* - * COPYRIGHT (c) 1989-2011. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#ifndef _RTEMS_RTEMS_SMP_H -#define _RTEMS_RTEMS_SMP_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup ClassicSMP SMP Services - * - * @ingroup RTEMSAPIClassic - * - * This encapsulates functionality which is useful for SMP applications. - * - * @{ - */ - -/** - * @brief Returns the count of processors in the system. - * - * On uni-processor configurations a value of one will be returned. - * - * On SMP configurations this returns the value of a global variable set during - * system initialization to indicate the count of utilized processors. The - * processor count depends on the physically or virtually available processors - * and application configuration. The value will always be less than or equal - * to the maximum count of application configured processors. - * - * @return The count of processors being utilized. - */ -uint32_t rtems_get_processor_count(void); - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/cpukit/include/rtems/rtems/tasks.h b/cpukit/include/rtems/rtems/tasks.h index 630a5c5295..307b1b13aa 100644 --- a/cpukit/include/rtems/rtems/tasks.h +++ b/cpukit/include/rtems/rtems/tasks.h @@ -617,6 +617,39 @@ rtems_get_current_processor( void ) return rtems_scheduler_get_processor(); } +/** + * @brief Returns the processor maximum supported by the system. + * + * In uniprocessor configurations, a value of one will be returned. + * + * In SMP configurations, this function returns the minimum of the processors + * (physically or virtually) available by the platform and the configured + * processor maximum. Not all processors in the range from processor index + * zero to the last processor index (which is the processor maximum minus one) + * may be configured to be used by a scheduler or online (online processors + * have a scheduler assigned). + * + * @return The processor maximum supported by the system. + * + * @see rtems_scheduler_add_processor() and rtems_scheduler_remove_processor(). + */ +RTEMS_CONST uint32_t rtems_scheduler_get_processor_maximum( void ); + +/** + * @brief Returns the processor maximum supported by the system. + * + * @return The processor maximum supported by the system. + * + * @deprecated + * + * Use rtems_scheduler_get_processor_maximum() instead. + */ +RTEMS_DEPRECATED RTEMS_INLINE_ROUTINE uint32_t +rtems_get_processor_count( void ) +{ + return rtems_scheduler_get_processor_maximum(); +} + /** * @brief Gets the set of processors owned by the specified scheduler instance. * -- cgit v1.2.3