summaryrefslogtreecommitdiffstats
path: root/cpukit/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-05 08:16:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-09 08:06:46 +0200
commitf9219db2a95c8285d1be22092572b4236bfe6488 (patch)
treec168ac7fdf7458cea6d7146584b2adb38d47f6a1 /cpukit/include
parentrtems: Add rtems_scheduler_get_processor() (diff)
downloadrtems-f9219db2a95c8285d1be22092572b4236bfe6488.tar.bz2
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.
Diffstat (limited to 'cpukit/include')
-rw-r--r--cpukit/include/rtems.h1
-rw-r--r--cpukit/include/rtems/rtems/smp.h59
-rw-r--r--cpukit/include/rtems/rtems/tasks.h33
3 files changed, 33 insertions, 60 deletions
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 <rtems/rtems/mp.h>
#endif
-#include <rtems/rtems/smp.h>
#include <rtems/rtems/support.h>
#include <rtems/score/stack.h>
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 <stdint.h>
-
-#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
@@ -618,6 +618,39 @@ rtems_get_current_processor( void )
}
/**
+ * @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.
*
* @param[in] scheduler_id Identifier of the scheduler instance.