summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-10 11:02:52 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-11 08:52:54 +0200
commitcb5eaddf95d348c1c74aad3997fe012af5e7b02f (patch)
tree6576466530b1be24fbc6fc4390a77d3481362feb /cpukit/rtems
parentrtems: Rename rtems_smp_get_processor_count() (diff)
downloadrtems-cb5eaddf95d348c1c74aad3997fe012af5e7b02f.tar.bz2
rtems: Rename rtems_smp_get_current_processor()
Rename rtems_smp_get_current_processor() in rtems_get_current_processor(). Make rtems_get_current_processor() a function in uni-processor configurations to enable ABI compatibility with SMP configurations.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/Makefile.am1
-rw-r--r--cpukit/rtems/include/rtems/rtems/smp.h10
-rw-r--r--cpukit/rtems/src/getcurrentprocessor.c25
3 files changed, 30 insertions, 6 deletions
diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index 4e6438c780..a279ed7ac2 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -259,6 +259,7 @@ librtems_a_SOURCES += src/modes.c
librtems_a_SOURCES += src/status.c
librtems_a_SOURCES += src/statustext.c
+librtems_a_SOURCES += src/getcurrentprocessor.c
librtems_a_SOURCES += src/getprocessorcount.c
if HAS_MP
diff --git a/cpukit/rtems/include/rtems/rtems/smp.h b/cpukit/rtems/include/rtems/rtems/smp.h
index b327514c09..fa4d5d6e75 100644
--- a/cpukit/rtems/include/rtems/rtems/smp.h
+++ b/cpukit/rtems/include/rtems/rtems/smp.h
@@ -18,12 +18,12 @@
#ifndef _RTEMS_RTEMS_SMP_H
#define _RTEMS_RTEMS_SMP_H
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <rtems/score/smp.h>
-
/**
* @defgroup ClassicSMP SMP Services
*
@@ -55,8 +55,7 @@ uint32_t rtems_get_processor_count(void);
/**
* @brief Returns the index of the current processor.
*
- * On uni-processor configurations this is a compile time constant and defined
- * to be zero.
+ * On uni-processor configurations a value of zero will be returned.
*
* On SMP configurations an architecture specific method is used to obtain the
* index of the current processor in the system. The set of processor indices
@@ -70,8 +69,7 @@ uint32_t rtems_get_processor_count(void);
*
* @return The index of the current processor.
*/
-#define rtems_smp_get_current_processor() \
- _SMP_Get_current_processor()
+uint32_t rtems_get_current_processor(void);
/** @} */
diff --git a/cpukit/rtems/src/getcurrentprocessor.c b/cpukit/rtems/src/getcurrentprocessor.c
new file mode 100644
index 0000000000..5fc48b9426
--- /dev/null
+++ b/cpukit/rtems/src/getcurrentprocessor.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_current_processor(void)
+{
+ return _SMP_Get_current_processor();
+}