From edde99bd213d20c55430dd29089e0d8a807ab6d8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Jun 2013 14:26:34 +0200 Subject: score: Rename rtems_smp_get_number_of_processors() Rename in rtems_smp_get_processor_count(). Always provide and . Add _SMP_Get_processor_count(). This function will be a compile time constant defined to be one on uni-processor configurations. This allows iterations over all processors without overhead on uni-processor configurations. --- cpukit/score/include/rtems/score/smp.h | 60 ++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'cpukit/score/include') diff --git a/cpukit/score/include/rtems/score/smp.h b/cpukit/score/include/rtems/score/smp.h index c7de6d64a9..ea073ac24b 100644 --- a/cpukit/score/include/rtems/score/smp.h +++ b/cpukit/score/include/rtems/score/smp.h @@ -1,10 +1,9 @@ /** - * @file rtems/score/smp.h + * @file * - * @brief Interface to the SuperCore SMP Support used Internally to RTEMS + * @ingroup ScoreSMP * - * This include file defines the interface to the SuperCore - * SMP support that is used internally to RTEMS. + * @brief SuperCore SMP Support API */ /* @@ -19,24 +18,22 @@ #ifndef _RTEMS_SCORE_SMP_H #define _RTEMS_SCORE_SMP_H -#if defined (RTEMS_SMP) -#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /** - * @defgroup SuperCoreSMP SMP Support + * @defgroup ScoreSMP SMP Support + * + * @ingroup Score * - * @ingroup Score + * This defines the interface of the SuperCore SMP support. * - * This defines the interface of the SuperCore support - * code for SMP support. + * @{ */ -/**@{*/ - -#ifdef __cplusplus -extern "C" { -#endif - /** * This defines the bit which indicates the interprocessor interrupt * has been requested so that RTEMS will reschedule on this CPU @@ -58,14 +55,20 @@ extern "C" { */ #define RTEMS_BSP_SMP_SHUTDOWN 0x04 -#ifndef ASM -/** - * @brief Number of CPUs in a SMP system. - * - * This variable is set during the SMP initialization sequence to - * indicate the number of CPUs in this system. - */ -SCORE_EXTERN uint32_t _SMP_Processor_count; +#if !defined( ASM ) + +#if defined( RTEMS_SMP ) + SCORE_EXTERN uint32_t _SMP_Processor_count; + + static inline uint32_t _SMP_Get_processor_count( void ) + { + return _SMP_Processor_count; + } +#else + #define _SMP_Get_processor_count() ( ( uint32_t ) 1 ) +#endif + +#if defined( RTEMS_SMP ) /** * @brief Sends a SMP message to a processor. @@ -114,14 +117,15 @@ void _SMP_Request_other_cores_to_dispatch(void); */ void _SMP_Request_other_cores_to_shutdown(void); -#endif +#endif /* defined( RTEMS_SMP ) */ + +#endif /* !defined( ASM ) */ + +/** @} */ #ifdef __cplusplus } #endif -#endif - -/**@}*/ #endif /* end of include file */ -- cgit v1.2.3