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,12 +21,13 @@ #endif #if HAVE_DECL_PTHREAD_ATTR_SETSTACK + +#include +#include + #include #include -#include -#include - int pthread_attr_setstack( pthread_attr_t *attr, void *stackaddr, 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 +#include + #include #include -#include -#include - 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 #include #include +#include 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 + +#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 -#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 similarity index 88% rename from cpukit/score/inline/rtems/score/stack.inl rename to 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,15 +16,15 @@ * http://www.rtems.com/license/LICENSE. */ -#ifndef _RTEMS_SCORE_STACK_H -# error "Never use directly; include instead." +#ifndef _RTEMS_SCORE_STACKIMPL_H +#define _RTEMS_SCORE_STACKIMPL_H + +#include + +#ifdef __cplusplus +extern "C" { #endif -#ifndef _RTEMS_SCORE_STACK_INL -#define _RTEMS_SCORE_STACK_INL - -#include /* RTEMS_INLINE_ROUTINE */ - /** * @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 #include #include -#include +#include #include #include #include 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 #include #include +#include #include #include #include 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 #include #include +#include #include #include #include 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 #include #include +#include #include #include #include diff --git a/testsuites/psxtests/psxstack01/init.c b/testsuites/psxtests/psxstack01/init.c index ce413e7b7a..71590cfef6 100644 --- a/testsuites/psxtests/psxstack01/init.c +++ b/testsuites/psxtests/psxstack01/init.c @@ -17,7 +17,8 @@ #include #include -#include /* for PTHREAD_MINIMUM_STACK_SIZE */ +#include +#include /* forward declarations to avoid warnings */ void *POSIX_Init(void *argument); diff --git a/testsuites/psxtests/psxstack02/init.c b/testsuites/psxtests/psxstack02/init.c index b58d25726e..52cbc6a911 100644 --- a/testsuites/psxtests/psxstack02/init.c +++ b/testsuites/psxtests/psxstack02/init.c @@ -19,7 +19,8 @@ #include #include -#include /* for PTHREAD_MINIMUM_STACK_SIZE */ +#include +#include /* forward declarations to avoid warnings */ void *POSIX_Init(void *argument);