1 |
786 |
skrzyp |
# ====================================================================
|
2 |
|
|
#
|
3 |
|
|
# thread.cdl
|
4 |
|
|
#
|
5 |
|
|
# configuration data related to the kernel threads
|
6 |
|
|
#
|
7 |
|
|
# ====================================================================
|
8 |
|
|
## ####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
## -------------------------------------------
|
10 |
|
|
## This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
12 |
|
|
##
|
13 |
|
|
## eCos is free software; you can redistribute it and/or modify it under
|
14 |
|
|
## the terms of the GNU General Public License as published by the Free
|
15 |
|
|
## Software Foundation; either version 2 or (at your option) any later
|
16 |
|
|
## version.
|
17 |
|
|
##
|
18 |
|
|
## eCos is distributed in the hope that it will be useful, but WITHOUT
|
19 |
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
20 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
21 |
|
|
## for more details.
|
22 |
|
|
##
|
23 |
|
|
## You should have received a copy of the GNU General Public License
|
24 |
|
|
## along with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
|
|
##
|
27 |
|
|
## As a special exception, if other files instantiate templates or use
|
28 |
|
|
## macros or inline functions from this file, or you compile this file
|
29 |
|
|
## and link it with other works to produce a work based on this file,
|
30 |
|
|
## this file does not by itself cause the resulting work to be covered by
|
31 |
|
|
## the GNU General Public License. However the source code for this file
|
32 |
|
|
## must still be made available in accordance with section (3) of the GNU
|
33 |
|
|
## General Public License v2.
|
34 |
|
|
##
|
35 |
|
|
## This exception does not invalidate any other reasons why a work based
|
36 |
|
|
## on this file might be covered by the GNU General Public License.
|
37 |
|
|
## -------------------------------------------
|
38 |
|
|
## ####ECOSGPLCOPYRIGHTEND####
|
39 |
|
|
# ====================================================================
|
40 |
|
|
######DESCRIPTIONBEGIN####
|
41 |
|
|
#
|
42 |
|
|
# Author(s): jskov
|
43 |
|
|
# Original data: nickg
|
44 |
|
|
# Contributors:
|
45 |
|
|
# Date: 1999-07-05
|
46 |
|
|
#
|
47 |
|
|
#####DESCRIPTIONEND####
|
48 |
|
|
#
|
49 |
|
|
# ====================================================================
|
50 |
|
|
|
51 |
|
|
cdl_option CYGFUN_KERNEL_THREADS_TIMER {
|
52 |
|
|
display "Allow per-thread timers"
|
53 |
|
|
requires CYGVAR_KERNEL_COUNTERS_CLOCK
|
54 |
|
|
default_value 1
|
55 |
|
|
description "
|
56 |
|
|
This option controls whether or not the kernel should support
|
57 |
|
|
per-thread clock and alarm related functions. Also some of
|
58 |
|
|
the synchronization primitives such as semaphore and
|
59 |
|
|
condition variable timed wait operations require per-thread
|
60 |
|
|
timer support. If none of these facilities are required then
|
61 |
|
|
the option can be disabled."
|
62 |
|
|
}
|
63 |
|
|
|
64 |
|
|
cdl_option CYGVAR_KERNEL_THREADS_NAME {
|
65 |
|
|
display "Support optional name for each thread"
|
66 |
|
|
default_value 1
|
67 |
|
|
description "
|
68 |
|
|
Threads may optionally be supplied with a name string that is
|
69 |
|
|
used to identify them during debugging. This name is only
|
70 |
|
|
present if `this option is defined. Disabling it reduces both
|
71 |
|
|
code and data size."
|
72 |
|
|
}
|
73 |
|
|
|
74 |
|
|
cdl_option CYGVAR_KERNEL_THREADS_LIST {
|
75 |
|
|
display "Keep track of all threads using a linked list"
|
76 |
|
|
default_value 1
|
77 |
|
|
description "
|
78 |
|
|
Threads may optionally be placed on a housekeeping list so
|
79 |
|
|
that all threads may be located easily. This is useful mainly
|
80 |
|
|
in conjunction with source-level debugging."
|
81 |
|
|
}
|
82 |
|
|
|
83 |
|
|
cdl_option CYGFUN_KERNEL_THREADS_STACK_LIMIT {
|
84 |
|
|
display "Keep track of the base of each thread's stack"
|
85 |
|
|
default_value 1
|
86 |
|
|
description "
|
87 |
|
|
This option makes the kernel keep track of the lower limit on
|
88 |
|
|
each thread's stack. It allows the kernel to adjust the lower
|
89 |
|
|
limit, thus making space for per-thread data. Note that it
|
90 |
|
|
does not imply any form of run-time stack overflow checking."
|
91 |
|
|
}
|
92 |
|
|
|
93 |
|
|
cdl_component CYGFUN_KERNEL_THREADS_STACK_CHECKING {
|
94 |
|
|
display "Check thread stacks for overflows"
|
95 |
|
|
active_if CYGPKG_INFRA_DEBUG
|
96 |
|
|
active_if CYGDBG_USE_ASSERTS
|
97 |
|
|
default_value 1
|
98 |
|
|
description "
|
99 |
|
|
This option enables a variety of checks for stack overflow
|
100 |
|
|
including signatures at the top and base of thread stacks,
|
101 |
|
|
which are asserted for correctness whenever a thread switches."
|
102 |
|
|
|
103 |
|
|
cdl_option CYGFUN_KERNEL_ALL_THREADS_STACK_CHECKING {
|
104 |
|
|
display "Check all threads whenever possible"
|
105 |
|
|
requires CYGVAR_KERNEL_THREADS_LIST
|
106 |
|
|
default_value 0
|
107 |
|
|
description "
|
108 |
|
|
This option enables more active checking of all threads for
|
109 |
|
|
wrongdoing. In theory, checking threads other than the old and new
|
110 |
|
|
executing threads in a thread-switch is pointless, because no other
|
111 |
|
|
thread has run, so no other stack can be exceeded. But errors such
|
112 |
|
|
as memory scribbling, dangling pointers, overlapping use of store
|
113 |
|
|
or errors accessing objects adjacent to a stack which can be very
|
114 |
|
|
hard to find can be detected this way, saving debug time."
|
115 |
|
|
}
|
116 |
|
|
|
117 |
|
|
cdl_option CYGNUM_KERNEL_THREADS_STACK_CHECK_DATA_SIZE {
|
118 |
|
|
display "Signature size in bytes, at stack top and bottom"
|
119 |
|
|
flavor data
|
120 |
|
|
default_value 32
|
121 |
|
|
legal_values 8 to 512
|
122 |
|
|
description "
|
123 |
|
|
This is the size of the area reserved for a signature at the top
|
124 |
|
|
and bottom of all stacks. It also provides a buffer zone for
|
125 |
|
|
detecting overflow before external objects are corrupted, hence the
|
126 |
|
|
ability to vary it here. But if you are short of stack, increasing
|
127 |
|
|
this value will make the overflow more, not less likely, of course."
|
128 |
|
|
}
|
129 |
|
|
}
|
130 |
|
|
|
131 |
|
|
cdl_component CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT {
|
132 |
|
|
display "Measure stack usage"
|
133 |
|
|
default_value { 0 != CYGPKG_INFRA_DEBUG }
|
134 |
|
|
description "
|
135 |
|
|
This option allows measurement of each thread's stack by initializing
|
136 |
|
|
it to a predefined value at thread creation time. Later use of the
|
137 |
|
|
cyg_thread_measure_stack_usage() function allows the maximum stack
|
138 |
|
|
usage of the thread so far to be obtained. Note that this is not
|
139 |
|
|
necessarily the true maximum stack usage that the thread will ever
|
140 |
|
|
use since all that has been measured is the stack usage corresponding
|
141 |
|
|
to the code path followed this time, and not the code path that may
|
142 |
|
|
be followed in future."
|
143 |
|
|
|
144 |
|
|
cdl_option CYGDBG_KERNEL_THREADS_STACK_MEASUREMENT_VERBOSE_EXIT {
|
145 |
|
|
display "Output stack usage on thread exit"
|
146 |
|
|
default_value 0
|
147 |
|
|
description "
|
148 |
|
|
This will output the measured stack usage on the diagnostic
|
149 |
|
|
output when a thread exits."
|
150 |
|
|
}
|
151 |
|
|
}
|
152 |
|
|
|
153 |
|
|
cdl_component CYGVAR_KERNEL_THREADS_DATA {
|
154 |
|
|
display "Support for per-thread data"
|
155 |
|
|
requires CYGFUN_KERNEL_THREADS_STACK_LIMIT
|
156 |
|
|
doc ref/kernel-thread-data.html
|
157 |
|
|
default_value 1
|
158 |
|
|
description "
|
159 |
|
|
It is possible for the kernel to support per-thread data, in
|
160 |
|
|
other words an area of memory specific to each thread which
|
161 |
|
|
can be used to store data for that thread. This per-thread
|
162 |
|
|
data can be used by applications or by other packages such as
|
163 |
|
|
the ISO C library."
|
164 |
|
|
|
165 |
|
|
cdl_option CYGNUM_KERNEL_THREADS_DATA_MAX {
|
166 |
|
|
display "Number of words of per-thread data"
|
167 |
|
|
flavor data
|
168 |
|
|
legal_values 4 to 32
|
169 |
|
|
default_value 6
|
170 |
|
|
description "
|
171 |
|
|
It is possible for the kernel to support per-thread data, in
|
172 |
|
|
other words an area of memory specific to each thread which
|
173 |
|
|
can be used to store data for that thread. This per-thread
|
174 |
|
|
data can be used by applications or by other packages such as
|
175 |
|
|
the ISO C library. This configuration option controls the
|
176 |
|
|
number of words of per-thread data that the kernel will
|
177 |
|
|
allow. In the current implementation a bitmask is used to identify
|
178 |
|
|
used per-thread data slots and so the maximum legal value must
|
179 |
|
|
remain 32."
|
180 |
|
|
}
|
181 |
|
|
|
182 |
|
|
cdl_component CYGNUM_KERNEL_THREADS_DATA_ALL {
|
183 |
|
|
display "Bitmap of preallocated slots of thread data"
|
184 |
|
|
flavor data
|
185 |
|
|
calculated 15
|
186 |
|
|
description "
|
187 |
|
|
Per thread data options. Per thread data support is based loosely
|
188 |
|
|
on that defined by POSIX. Each thread has an array of slots, up to
|
189 |
|
|
CYGNUM_KERNEL_THREADS_DATA_MAX, that may contain data. Some of the
|
190 |
|
|
slots have been preallocated to specific packages. Others may be
|
191 |
|
|
allocated dynamically."
|
192 |
|
|
|
193 |
|
|
cdl_option CYGNUM_KERNEL_THREADS_DATA_KERNEL {
|
194 |
|
|
display "Slot 0 preallocated for the kernel"
|
195 |
|
|
flavor data
|
196 |
|
|
calculated 0
|
197 |
|
|
description "
|
198 |
|
|
This option defines the index of a per-thread data
|
199 |
|
|
slot which is reserved by
|
200 |
|
|
the eCos kernel
|
201 |
|
|
for private use."
|
202 |
|
|
}
|
203 |
|
|
cdl_option CYGNUM_KERNEL_THREADS_DATA_ITRON {
|
204 |
|
|
display "Slot 1 preallocated for uITRON"
|
205 |
|
|
flavor data
|
206 |
|
|
calculated 1
|
207 |
|
|
description "
|
208 |
|
|
This option defines the index of a per-thread data
|
209 |
|
|
slot which is reserved by
|
210 |
|
|
the uITRON compatibility layer
|
211 |
|
|
for private use."
|
212 |
|
|
}
|
213 |
|
|
cdl_option CYGNUM_KERNEL_THREADS_DATA_ERRNO {
|
214 |
|
|
display "Slot 2 preallocated for errno"
|
215 |
|
|
flavor data
|
216 |
|
|
calculated 2
|
217 |
|
|
description "
|
218 |
|
|
This option defines the index of a per-thread data
|
219 |
|
|
slot which is reserved for use by an errno variable."
|
220 |
|
|
}
|
221 |
|
|
cdl_option CYGNUM_KERNEL_THREADS_DATA_POSIX {
|
222 |
|
|
display "Slot 3 preallocated for POSIX"
|
223 |
|
|
flavor data
|
224 |
|
|
calculated 3
|
225 |
|
|
description "
|
226 |
|
|
This option defines the index of a per-thread data
|
227 |
|
|
slot which is reserved by
|
228 |
|
|
POSIX
|
229 |
|
|
for private use."
|
230 |
|
|
}
|
231 |
|
|
}
|
232 |
|
|
}
|
233 |
|
|
|
234 |
|
|
cdl_component CYGPKG_KERNEL_THREADS_DESTRUCTORS {
|
235 |
|
|
display "Thread destructors"
|
236 |
|
|
doc ref/kernel-thread-destructors.html
|
237 |
|
|
default_value 0
|
238 |
|
|
description "
|
239 |
|
|
This option enables support for registered destructor functions to
|
240 |
|
|
be called on thread exit."
|
241 |
|
|
|
242 |
|
|
|
243 |
|
|
cdl_option CYGNUM_KERNEL_THREADS_DESTRUCTORS {
|
244 |
|
|
display "Number of possible destructors"
|
245 |
|
|
flavor data
|
246 |
|
|
legal_values 1 to 65535
|
247 |
|
|
default_value 8
|
248 |
|
|
description "
|
249 |
|
|
This option gives the number of possible destructors allowed.
|
250 |
|
|
Increasing this will increase the size of every
|
251 |
|
|
thread control structure if per-thread destructors are
|
252 |
|
|
enabled."
|
253 |
|
|
}
|
254 |
|
|
|
255 |
|
|
cdl_option CYGSEM_KERNEL_THREADS_DESTRUCTORS_PER_THREAD {
|
256 |
|
|
display "Per-thread destructors"
|
257 |
|
|
default_value 1
|
258 |
|
|
description "
|
259 |
|
|
Enabling this option makes the thread destructors a per-thread
|
260 |
|
|
property, with each thread having its own list of destructors.
|
261 |
|
|
Disabling this option makes the thread destructor list
|
262 |
|
|
global so all threads have the same destructors."
|
263 |
|
|
}
|
264 |
|
|
|
265 |
|
|
}
|
266 |
|
|
|
267 |
|
|
cdl_option CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE {
|
268 |
|
|
display "Stack size for the idle thread"
|
269 |
|
|
flavor data
|
270 |
|
|
legal_values 512 to 65536
|
271 |
|
|
default_value 2048
|
272 |
|
|
description "
|
273 |
|
|
This configuration option specifies the stack size in bytes
|
274 |
|
|
for the idle thread. Unless the HAL is configured to use a
|
275 |
|
|
separate interrupt stack this size must be sufficient to meet
|
276 |
|
|
the requirements of all interrupt handlers - these
|
277 |
|
|
requirements are cumulative if nested interrupted are
|
278 |
|
|
enabled. Depending on the target architecture, the stack size
|
279 |
|
|
typically has to be a multiple of eight or sixteen bytes.
|
280 |
|
|
This will be overridden where it is used if the
|
281 |
|
|
architectural HAL requires a minimum stack size
|
282 |
|
|
to handle interrupts correctly."
|
283 |
|
|
}
|
284 |
|
|
|
285 |
|
|
# ---------------------------------------------------------------------
|
286 |
|
|
# Thread-related miscellania.
|
287 |
|
|
|
288 |
|
|
cdl_option CYGNUM_KERNEL_MAX_SUSPEND_COUNT_ASSERT {
|
289 |
|
|
display "Maximal suspend count"
|
290 |
|
|
flavor data
|
291 |
|
|
default_value 500
|
292 |
|
|
description "
|
293 |
|
|
This option provides for an assertion that the count value for
|
294 |
|
|
counted thread suspends do not exceed set limits. This is to help
|
295 |
|
|
with debugging, to allow a runaway loop, for example, to be
|
296 |
|
|
detected more easily.
|
297 |
|
|
|
298 |
|
|
If the option is not defined, no assert is included. Whether asserts
|
299 |
|
|
are themselves included depends on infrastructure configury in
|
300 |
|
|
infra.h"
|
301 |
|
|
}
|
302 |
|
|
|
303 |
|
|
cdl_option CYGNUM_KERNEL_MAX_COUNTED_WAKE_COUNT_ASSERT {
|
304 |
|
|
display "Maximal wake count"
|
305 |
|
|
flavor data
|
306 |
|
|
default_value 500
|
307 |
|
|
description "
|
308 |
|
|
This option provides for an assertion that the count value for
|
309 |
|
|
counted thread wakeups do not exceed set limits. This is to
|
310 |
|
|
help with debugging, to allow a runaaway loop, for example, to
|
311 |
|
|
be detected more easily.
|
312 |
|
|
|
313 |
|
|
If the option is not defined, no assert is included. Whether asserts
|
314 |
|
|
are themselves included depends on infrastructure configury in
|
315 |
|
|
infra.h"
|
316 |
|
|
}
|
317 |
|
|
|
318 |
|
|
|
319 |
|
|
#if CYGNUM_KERNEL_SCHED_PRIORITIES == 1
|
320 |
|
|
# define CYGIMP_IDLE_THREAD_YIELD
|
321 |
|
|
#endif
|
322 |
|
|
cdl_option CYGIMP_IDLE_THREAD_YIELD {
|
323 |
|
|
display "Idle thread must always yield"
|
324 |
|
|
calculated 1
|
325 |
|
|
active_if (CYGNUM_KERNEL_SCHED_PRIORITIES == 1)
|
326 |
|
|
description "
|
327 |
|
|
If the scheduler configuration only has a single priority
|
328 |
|
|
level, then the idle thread must yield each time around its loop."
|
329 |
|
|
}
|
330 |
|
|
|
331 |
|
|
# EOF thread.cdl
|