source: rtems/cpukit/include/rtems/score/stack.h @ 00c7ad4

5
Last change on this file since 00c7ad4 was 00c7ad4, checked in by Sebastian Huber <sebastian.huber@…>, on 12/16/19 at 13:32:47

score: Split stack allocator configuration

This allows the linker garbage collection to perform its work.

Update #3835.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup RTEMSScoreStack
5 *
6 * @brief Information About the Thread Stack Handler
7 *
8 * This include file contains all information about the thread
9 * Stack Handler.  This Handler provides mechanisms which can be used to
10 * initialize and utilize stacks.
11 */
12
13/*
14 *  COPYRIGHT (c) 1989-2006.
15 *  On-Line Applications Research Corporation (OAR).
16 *
17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
19 *  http://www.rtems.org/license/LICENSE.
20 */
21
22#ifndef _RTEMS_SCORE_STACK_H
23#define _RTEMS_SCORE_STACK_H
24
25#include <rtems/score/basedefs.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/**
32 * @defgroup RTEMSScoreStack Stack Handler
33 *
34 * @ingroup RTEMSScore
35 *
36 * @brief Stack Handler
37 *
38 * This handler encapsulates functionality which is used in the management
39 * of thread stacks.
40 *
41 * @{
42 */
43
44/**
45 *  The following constant defines the minimum stack size which every
46 *  thread must exceed.
47 */
48#define STACK_MINIMUM_SIZE  CPU_STACK_MINIMUM_SIZE
49
50/**
51 *  The following defines the control block used to manage each stack.
52 */
53typedef struct {
54  /** This is the stack size. */
55  size_t      size;
56  /** This is the low memory address of stack. */
57  void       *area;
58}   Stack_Control;
59
60/**
61 * @brief The stack allocator initialization handler.
62 *
63 * @param stack_space_size The size of the stack space in bytes.
64 */
65typedef void ( *Stack_Allocator_initialize )( size_t stack_space_size );
66
67/**
68 * @brief Stack allocator allocate handler.
69 *
70 * @param stack_size The size of the stack area to allocate in bytes.
71 *
72 * @retval NULL Not enough memory.
73 * @retval other Pointer to begin of stack area.
74 */
75typedef void *( *Stack_Allocator_allocate )( size_t stack_size );
76
77/**
78 * @brief Stack allocator free handler.
79 *
80 * @param] addr A pointer to previously allocated stack area or NULL.
81 */
82typedef void ( *Stack_Allocator_free )( void *addr );
83
84/**
85 * @brief The minimum stack size.
86 *
87 * Application provided via <rtems/confdefs.h>.
88 */
89extern uint32_t rtems_minimum_stack_size;
90
91/**
92 * @brief The configured stack space size.
93 *
94 * Application provided via <rtems/confdefs.h>.
95 */
96extern const uintptr_t _Stack_Space_size;
97
98/**
99 * @brief Indicates if the stack allocator avoids the workspace.
100 *
101 * Application provided via <rtems/confdefs.h>.
102 */
103extern const bool _Stack_Allocator_avoids_workspace;
104
105/**
106 * @brief The stack allocator initialization handler.
107 *
108 * Application provided via <rtems/confdefs.h>.
109 */
110extern const Stack_Allocator_initialize _Stack_Allocator_initialize;
111
112/**
113 * @brief The stack allocator allocate handler.
114 *
115 * Application provided via <rtems/confdefs.h>.
116 */
117extern const Stack_Allocator_allocate _Stack_Allocator_allocate;
118
119/**
120 * @brief The stack allocator free handler.
121 *
122 * Application provided via <rtems/confdefs.h>.
123 */
124extern const Stack_Allocator_free _Stack_Allocator_free;
125
126/** @} */
127
128#ifdef __cplusplus
129}
130#endif
131
132#endif
133/* end of include file */
Note: See TracBrowser for help on using the repository browser.