summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-23 17:17:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-23 17:19:08 +0200
commit218286bc055e9d9bcbefd3dfa2b38f92a95b15a6 (patch)
treedfd79ee383ba1192fa1a71d40bd52d5742601b76 /cpukit
parentposix: Include missing <stdint.h> (diff)
downloadrtems-218286bc055e9d9bcbefd3dfa2b38f92a95b15a6.tar.bz2
score: Create stack implementation header
Move implementation specific parts of stack.h and stack.inl into new header file stackimpl.h. The stack.h contains now only the application visible API.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/posix/src/pthreadattrsetstack.c7
-rw-r--r--cpukit/posix/src/pthreadattrsetstacksize.c6
-rw-r--r--cpukit/posix/src/pthreadcreate.c1
-rw-r--r--cpukit/score/Makefile.am2
-rw-r--r--cpukit/score/include/rtems/score/stack.h16
-rw-r--r--cpukit/score/include/rtems/score/stackimpl.h (renamed from cpukit/score/inline/rtems/score/stack.inl)16
-rw-r--r--cpukit/score/preinstall.am8
-rw-r--r--cpukit/score/src/isr.c2
-rw-r--r--cpukit/score/src/threadcreateidle.c1
-rw-r--r--cpukit/score/src/threadinitialize.c1
-rw-r--r--cpukit/score/src/threadstackallocate.c1
11 files changed, 34 insertions, 27 deletions
diff --git a/cpukit/posix/src/pthreadattrsetstack.c b/cpukit/posix/src/pthreadattrsetstack.c
index 7c4f14b6a4..699d2fec93 100644
--- a/cpukit/posix/src/pthreadattrsetstack.c
+++ b/cpukit/posix/src/pthreadattrsetstack.c
@@ -21,11 +21,12 @@
#endif
#if HAVE_DECL_PTHREAD_ATTR_SETSTACK
-#include <pthread.h>
-#include <errno.h>
-#include <rtems/system.h>
#include <rtems/posix/pthreadimpl.h>
+#include <rtems/score/stackimpl.h>
+
+#include <pthread.h>
+#include <errno.h>
int pthread_attr_setstack(
pthread_attr_t *attr,
diff --git a/cpukit/posix/src/pthreadattrsetstacksize.c b/cpukit/posix/src/pthreadattrsetstacksize.c
index 3fd78b3615..79c683b99f 100644
--- a/cpukit/posix/src/pthreadattrsetstacksize.c
+++ b/cpukit/posix/src/pthreadattrsetstacksize.c
@@ -20,12 +20,12 @@
#include "config.h"
#endif
+#include <rtems/posix/pthreadimpl.h>
+#include <rtems/score/stackimpl.h>
+
#include <pthread.h>
#include <errno.h>
-#include <rtems/system.h>
-#include <rtems/posix/pthreadimpl.h>
-
int pthread_attr_setstacksize(
pthread_attr_t *attr,
size_t stacksize
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index fcac8d4e91..4742b596d6 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -31,6 +31,7 @@
#include <rtems/posix/time.h>
#include <rtems/score/apimutex.h>
#include <rtems/score/watchdogimpl.h>
+#include <rtems/score/stackimpl.h>
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index 4b0e15dd99..82eb254244 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -50,6 +50,7 @@ include_rtems_score_HEADERS += include/rtems/score/schedulersimple.h
include_rtems_score_HEADERS += include/rtems/score/smp.h
include_rtems_score_HEADERS += include/rtems/score/smplock.h
include_rtems_score_HEADERS += include/rtems/score/stack.h
+include_rtems_score_HEADERS += include/rtems/score/stackimpl.h
include_rtems_score_HEADERS += include/rtems/score/states.h
include_rtems_score_HEADERS += include/rtems/score/sysstate.h
include_rtems_score_HEADERS += include/rtems/score/thread.h
@@ -99,7 +100,6 @@ include_rtems_score_HEADERS += inline/rtems/score/prioritybitmap.inl
include_rtems_score_HEADERS += inline/rtems/score/scheduler.inl
include_rtems_score_HEADERS += inline/rtems/score/schedulerpriority.inl
include_rtems_score_HEADERS += inline/rtems/score/schedulersimple.inl
-include_rtems_score_HEADERS += inline/rtems/score/stack.inl
include_rtems_score_HEADERS += inline/rtems/score/states.inl
include_rtems_score_HEADERS += inline/rtems/score/sysstate.inl
include_rtems_score_HEADERS += inline/rtems/score/thread.inl
diff --git a/cpukit/score/include/rtems/score/stack.h b/cpukit/score/include/rtems/score/stack.h
index 9aa90425c4..452525e6ae 100644
--- a/cpukit/score/include/rtems/score/stack.h
+++ b/cpukit/score/include/rtems/score/stack.h
@@ -20,6 +20,12 @@
#ifndef _RTEMS_SCORE_STACK_H
#define _RTEMS_SCORE_STACK_H
+#include <rtems/score/basedefs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @defgroup ScoreStack Stack Handler
*
@@ -30,10 +36,6 @@
*/
/**@{*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* The following constant defines the minimum stack size which every
* thread must exceed.
@@ -57,15 +59,11 @@ typedef struct {
*/
extern uint32_t rtems_minimum_stack_size;
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/stack.inl>
-#endif
+/**@}*/
#ifdef __cplusplus
}
#endif
-/**@}*/
-
#endif
/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/stack.inl b/cpukit/score/include/rtems/score/stackimpl.h
index 7cb73eef9e..87629011d9 100644
--- a/cpukit/score/inline/rtems/score/stack.inl
+++ b/cpukit/score/include/rtems/score/stackimpl.h
@@ -16,14 +16,14 @@
* http://www.rtems.com/license/LICENSE.
*/
-#ifndef _RTEMS_SCORE_STACK_H
-# error "Never use <rtems/score/stack.inl> directly; include <rtems/score/stack.h> instead."
-#endif
+#ifndef _RTEMS_SCORE_STACKIMPL_H
+#define _RTEMS_SCORE_STACKIMPL_H
-#ifndef _RTEMS_SCORE_STACK_INL
-#define _RTEMS_SCORE_STACK_INL
+#include <rtems/score/stack.h>
-#include <rtems/score/basedefs.h> /* RTEMS_INLINE_ROUTINE */
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @addtogroup ScoreStack
@@ -91,5 +91,9 @@ RTEMS_INLINE_ROUTINE size_t _Stack_Ensure_minimum (
/** @} */
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* end of include file */
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index fe19329646..6df393d2e2 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -183,6 +183,10 @@ $(PROJECT_INCLUDE)/rtems/score/stack.h: include/rtems/score/stack.h $(PROJECT_IN
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stack.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/stack.h
+$(PROJECT_INCLUDE)/rtems/score/stackimpl.h: include/rtems/score/stackimpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stackimpl.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/stackimpl.h
+
$(PROJECT_INCLUDE)/rtems/score/states.h: include/rtems/score/states.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/states.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/states.h
@@ -327,10 +331,6 @@ $(PROJECT_INCLUDE)/rtems/score/schedulersimple.inl: inline/rtems/score/scheduler
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersimple.inl
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersimple.inl
-$(PROJECT_INCLUDE)/rtems/score/stack.inl: inline/rtems/score/stack.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stack.inl
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/stack.inl
-
$(PROJECT_INCLUDE)/rtems/score/states.inl: inline/rtems/score/states.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/states.inl
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/states.inl
diff --git a/cpukit/score/src/isr.c b/cpukit/score/src/isr.c
index e7ad33b473..eaf6ba60fb 100644
--- a/cpukit/score/src/isr.c
+++ b/cpukit/score/src/isr.c
@@ -21,7 +21,7 @@
#include <rtems/system.h>
#include <rtems/score/address.h>
#include <rtems/score/isr.h>
-#include <rtems/score/stack.h>
+#include <rtems/score/stackimpl.h>
#include <rtems/score/interr.h>
#include <rtems/score/wkspace.h>
#include <rtems/config.h>
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c
index d075510135..d11b296157 100644
--- a/cpukit/score/src/threadcreateidle.c
+++ b/cpukit/score/src/threadcreateidle.c
@@ -26,6 +26,7 @@
#include <rtems/score/object.h>
#include <rtems/score/priority.h>
#include <rtems/score/smp.h>
+#include <rtems/score/stackimpl.h>
#include <rtems/score/states.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/thread.h>
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index 64071e1199..f3b25e9bd4 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -26,6 +26,7 @@
#include <rtems/score/object.h>
#include <rtems/score/priority.h>
#include <rtems/score/scheduler.h>
+#include <rtems/score/stackimpl.h>
#include <rtems/score/states.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/thread.h>
diff --git a/cpukit/score/src/threadstackallocate.c b/cpukit/score/src/threadstackallocate.c
index dd2049ba42..0f64f59e1b 100644
--- a/cpukit/score/src/threadstackallocate.c
+++ b/cpukit/score/src/threadstackallocate.c
@@ -26,6 +26,7 @@
#include <rtems/score/isr.h>
#include <rtems/score/object.h>
#include <rtems/score/priority.h>
+#include <rtems/score/stackimpl.h>
#include <rtems/score/states.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/thread.h>