diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-09 16:03:11 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-02-12 09:08:36 +0100 |
commit | 32991495b48d1b5e4804b2f10a67a800f4608e75 (patch) | |
tree | 2a05470107f3a8918689b9ed4c94760f08a2631a /cpukit/include/rtems | |
parent | score: Move thread stack allocation (diff) | |
download | rtems-32991495b48d1b5e4804b2f10a67a800f4608e75.tar.bz2 |
score: Statically allocate idle/MPCI stacks
Place idle and MPCI stacks into extra linker sections. This can be
optionally used by applications to control the placement of the stacks.
Update #3835.
Diffstat (limited to 'cpukit/include/rtems')
-rw-r--r-- | cpukit/include/rtems/confdefs.h | 39 | ||||
-rw-r--r-- | cpukit/include/rtems/score/mpci.h | 7 | ||||
-rw-r--r-- | cpukit/include/rtems/score/thread.h | 7 |
3 files changed, 30 insertions, 23 deletions
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h index 00303de049..f39172cffb 100644 --- a/cpukit/include/rtems/confdefs.h +++ b/cpukit/include/rtems/confdefs.h @@ -1809,6 +1809,14 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */ CONFIGURE_MP_MPCI_TABLE_POINTER /* ptr to MPCI config table */ }; + + char _MPCI_Receive_server_stack[ + CONFIGURE_MINIMUM_TASK_STACK_SIZE + + CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK + + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + + CPU_ALL_TASKS_ARE_FP * CONTEXT_FP_SIZE + ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT ) + RTEMS_SECTION( ".rtemsstack.mpci" ); #endif #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 1 @@ -2379,22 +2387,6 @@ struct _reent *__getreent(void) /* * This macro is calculated to specify the memory required for - * the Idle tasks(s) stack. - */ -#define _CONFIGURE_IDLE_TASKS_STACK \ - (_CONFIGURE_IDLE_TASKS_COUNT * \ - _Configure_From_stackspace( CONFIGURE_IDLE_TASK_STACK_SIZE ) ) - -/* - * This macro is calculated to specify the stack memory required for the MPCI - * task. - */ -#define _CONFIGURE_MPCI_RECEIVE_SERVER_STACK \ - (_CONFIGURE_MPCI_RECEIVE_SERVER_COUNT * \ - _Configure_From_stackspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE)) - -/* - * This macro is calculated to specify the memory required for * the stacks of all tasks. */ #define _CONFIGURE_TASKS_STACK \ @@ -2411,8 +2403,6 @@ struct _reent *__getreent(void) #else /* CONFIGURE_EXECUTIVE_RAM_SIZE */ -#define _CONFIGURE_IDLE_TASKS_STACK 0 -#define _CONFIGURE_MPCI_RECEIVE_SERVER_STACK 0 #define _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS 0 #define _CONFIGURE_TASKS_STACK 0 #define _CONFIGURE_POSIX_THREADS_STACK 0 @@ -2433,12 +2423,9 @@ struct _reent *__getreent(void) */ #define _CONFIGURE_STACK_SPACE_SIZE \ ( \ - _CONFIGURE_IDLE_TASKS_STACK + \ - _CONFIGURE_MPCI_RECEIVE_SERVER_STACK + \ _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS + \ _CONFIGURE_TASKS_STACK + \ _CONFIGURE_POSIX_THREADS_STACK + \ - CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK + \ _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS + \ CONFIGURE_EXTRA_TASK_STACKS + \ _CONFIGURE_HEAP_HANDLER_OVERHEAD \ @@ -2563,8 +2550,7 @@ struct _reent *__getreent(void) const uint32_t _Watchdog_Ticks_per_second = _CONFIGURE_TICKS_PER_SECOND; - const size_t _Thread_Initial_thread_count = _CONFIGURE_IDLE_TASKS_COUNT + - _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT + + const size_t _Thread_Initial_thread_count = rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) + rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS ); @@ -2575,6 +2561,13 @@ struct _reent *__getreent(void) _CONFIGURE_IDLE_TASKS_COUNT + _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT ); + char _Thread_Idle_stacks[ + _CONFIGURE_IDLE_TASKS_COUNT + * ( CONFIGURE_IDLE_TASK_STACK_SIZE + + CPU_IDLE_TASK_IS_FP * CONTEXT_FP_SIZE ) + ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT ) + RTEMS_SECTION( ".rtemsstack.idle" ); + #if CONFIGURE_MAXIMUM_BARRIERS > 0 BARRIER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_BARRIERS ); #endif diff --git a/cpukit/include/rtems/score/mpci.h b/cpukit/include/rtems/score/mpci.h index a72b1f0d5b..0de29739e8 100644 --- a/cpukit/include/rtems/score/mpci.h +++ b/cpukit/include/rtems/score/mpci.h @@ -162,6 +162,13 @@ typedef struct { */ extern const MPCI_Configuration _MPCI_Configuration; +/** + * @brief The MPCI receive server stack. + * + * Provided by the application via <rtems/confdefs.h> + */ +extern char _MPCI_Receive_server_stack[]; + /** @} */ #ifdef __cplusplus diff --git a/cpukit/include/rtems/score/thread.h b/cpukit/include/rtems/score/thread.h index c70624f64a..e438549ff8 100644 --- a/cpukit/include/rtems/score/thread.h +++ b/cpukit/include/rtems/score/thread.h @@ -1062,6 +1062,13 @@ Thread_Information name##_Information = { \ } \ } +/** + * @brief The idle thread stacks. + * + * Provided by the application via <rtems/confdefs.h>. + */ +extern char _Thread_Idle_stacks[]; + #if defined(RTEMS_MULTIPROCESSING) /** * @brief The configured thread control block. |