mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-29 07:29:47 +08:00
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.
This commit is contained in:
@@ -21,12 +21,13 @@
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_PTHREAD_ATTR_SETSTACK
|
||||
|
||||
#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_setstack(
|
||||
pthread_attr_t *attr,
|
||||
void *stackaddr,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
+11
-7
@@ -16,15 +16,15 @@
|
||||
* 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."
|
||||
#ifndef _RTEMS_SCORE_STACKIMPL_H
|
||||
#define _RTEMS_SCORE_STACKIMPL_H
|
||||
|
||||
#include <rtems/score/stack.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _RTEMS_SCORE_STACK_INL
|
||||
#define _RTEMS_SCORE_STACK_INL
|
||||
|
||||
#include <rtems/score/basedefs.h> /* 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 */
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <rtems/posix/pthreadimpl.h> /* for PTHREAD_MINIMUM_STACK_SIZE */
|
||||
#include <rtems/posix/pthreadimpl.h>
|
||||
#include <rtems/score/stackimpl.h>
|
||||
|
||||
/* forward declarations to avoid warnings */
|
||||
void *POSIX_Init(void *argument);
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <rtems/posix/pthreadimpl.h> /* for PTHREAD_MINIMUM_STACK_SIZE */
|
||||
#include <rtems/posix/pthreadimpl.h>
|
||||
#include <rtems/score/stackimpl.h>
|
||||
|
||||
/* forward declarations to avoid warnings */
|
||||
void *POSIX_Init(void *argument);
|
||||
|
||||
Reference in New Issue
Block a user