summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/rtems')
-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
3 files changed, 29 insertions, 4 deletions
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();
+}