summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libmisc/cpuuse/cpuusagereset.c2
-rw-r--r--cpukit/rtems/Makefile.am2
-rw-r--r--cpukit/rtems/include/rtems/rtems/smp.h6
-rw-r--r--cpukit/rtems/src/getprocessorcount.c25
-rw-r--r--cpukit/sapi/src/profilingiterate.c2
5 files changed, 31 insertions, 6 deletions
diff --git a/cpukit/libmisc/cpuuse/cpuusagereset.c b/cpukit/libmisc/cpuuse/cpuusagereset.c
index b74414b8de..e77ac2c006 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereset.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereset.c
@@ -45,7 +45,7 @@ void rtems_cpu_usage_reset( void )
_TOD_Get_uptime( &CPU_usage_Uptime_at_last_reset );
- processor_count = rtems_smp_get_processor_count();
+ processor_count = rtems_get_processor_count();
for ( processor = 0 ; processor < processor_count ; ++processor ) {
Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( processor );
diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index 6cb5181188..4e6438c780 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -259,6 +259,8 @@ librtems_a_SOURCES += src/modes.c
librtems_a_SOURCES += src/status.c
librtems_a_SOURCES += src/statustext.c
+librtems_a_SOURCES += src/getprocessorcount.c
+
if HAS_MP
# We only build multiprocessing related files if HAS_MP was defined
librtems_a_SOURCES += src/eventmp.c
diff --git a/cpukit/rtems/include/rtems/rtems/smp.h b/cpukit/rtems/include/rtems/rtems/smp.h
index d2904e4191..b327514c09 100644
--- a/cpukit/rtems/include/rtems/rtems/smp.h
+++ b/cpukit/rtems/include/rtems/rtems/smp.h
@@ -40,8 +40,7 @@ extern "C" {
/**
* @brief Returns the count of processors in the system.
*
- * On uni-processor configurations this is a compile time constant and defined
- * to be one.
+ * 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 processors. The processor
@@ -51,8 +50,7 @@ extern "C" {
*
* @return The count of processors in the system.
*/
-#define rtems_smp_get_processor_count() \
- _SMP_Get_processor_count()
+uint32_t rtems_get_processor_count(void);
/**
* @brief Returns the index of the current processor.
diff --git a/cpukit/rtems/src/getprocessorcount.c b/cpukit/rtems/src/getprocessorcount.c
new file mode 100644
index 0000000000..438eec6635
--- /dev/null
+++ b/cpukit/rtems/src/getprocessorcount.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * 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.
+ */
+
+#if HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include <rtems/rtems/smp.h>
+#include <rtems/score/smp.h>
+
+uint32_t rtems_get_processor_count(void)
+{
+ return _SMP_Get_processor_count();
+}
diff --git a/cpukit/sapi/src/profilingiterate.c b/cpukit/sapi/src/profilingiterate.c
index bc98205c36..0fd96fa12d 100644
--- a/cpukit/sapi/src/profilingiterate.c
+++ b/cpukit/sapi/src/profilingiterate.c
@@ -30,7 +30,7 @@ static void per_cpu_stats_iterate(
)
{
#ifdef RTEMS_PROFILING
- uint32_t n = rtems_smp_get_processor_count();
+ uint32_t n = rtems_get_processor_count();
uint32_t i;
memset(data, 0, sizeof(*data));