comparison packages/language/c/libc/current/cdl/startup.cdl @ 76:435cced73e2f ecos-v1_3_1-release

eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
author jlarmour
date Tue, 28 Mar 2000 14:10:45 +0000
parents
children
comparison
equal deleted inserted replaced
75:41bf073c0c32 76:435cced73e2f
1 # ====================================================================
2 #
3 # startup.cdl
4 #
5 # C library startup related configuration data
6 #
7 # ====================================================================
8 #####COPYRIGHTBEGIN####
9 #
10 # -------------------------------------------
11 # The contents of this file are subject to the Red Hat eCos Public License
12 # Version 1.1 (the "License"); you may not use this file except in
13 # compliance with the License. You may obtain a copy of the License at
14 # http://www.redhat.com/
15 #
16 # Software distributed under the License is distributed on an "AS IS"
17 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
18 # License for the specific language governing rights and limitations under
19 # the License.
20 #
21 # The Original Code is eCos - Embedded Configurable Operating System,
22 # released September 30, 1998.
23 #
24 # The Initial Developer of the Original Code is Red Hat.
25 # Portions created by Red Hat are
26 # Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
27 # All Rights Reserved.
28 # -------------------------------------------
29 #
30 #####COPYRIGHTEND####
31 # ====================================================================
32 ######DESCRIPTIONBEGIN####
33 #
34 # Author(s): jskov
35 # Original data: jlarmour
36 # Contributors:
37 # Date: 1999-07-06
38 #
39 #####DESCRIPTIONEND####
40 #
41 # ====================================================================
42
43 cdl_option CYGDAT_LIBC_ARGUMENTS {
44 display "Arguments to main()"
45 flavor data
46 default_value {"{\"\", NULL}"}
47 description "
48 This option allows the setting of the arguments
49 to the main function. This only has any effect
50 when cyg_iso_c_start() is used to start the
51 ISO C compatibility. This will automatically
52 invoke main() in an ISO C compatible fashion.
53 This option is in fact used as argv, and so is
54 an n-tuple of string constants. The final
55 entry must be NULL. Conventionally if argv\[0\]
56 is supplied, it is used to inform the program
57 of its name."
58 }
59
60 cdl_component CYGSEM_LIBC_STARTUP_MAIN_THREAD {
61 display "main() invoked as thread"
62 requires CYGPKG_KERNEL
63 flavor bool
64 default_value 1
65 description "
66 It is normally expected (e.g. in a POSIX 1003.1
67 environment) that main() is run in the context
68 of a thread just like any other thread. If this
69 option is disabled then main() will instead be
70 called in the context of the initialization
71 routines, without the scheduler running and
72 using the interrupt stack. This means that
73 any functions that may require interactions
74 with a running kernel will not work (including
75 libc functions, if configured to be thread safe
76 for example), so you should restrict yourself
77 to only calling fully re-entrant functions from
78 within main() in this case."
79
80 cdl_component CYGSEM_LIBC_MAIN_STACK_FROM_SYSTEM {
81 display "System provides stack for main()'s thread"
82 description "
83 This option controls whether the stack of
84 main()'s thread is provided by the application or
85 provided by the system. When disabled, the
86 application must declare a pointer variable
87 cyg_libc_main_stack which is a pointer to an
88 appropriately aligned region of memory. The
89 application must also declare a variable of
90 type `int' called cyg_libc_main_stack_size
91 which contains the size of the stack in bytes.
92 This must be a multiple of 8."
93 flavor bool
94 default_value 1
95
96 cdl_option CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE {
97 display "main()'s default thread stack size"
98 flavor data
99 legal_values 16 to 0x7fffffff
100 default_value 8192
101 description "
102 With an eCos kernel, when the cyg_iso_c_start()
103 function is used to invoke the user-supplied
104 main() function in an ISO C compatible fashion,
105 a separate thread is created to call main().
106 This option controls the size of that thread's
107 stack, which is allocated in the BSS. It
108 must be a multiple of 8. Note, a low number
109 here may be overriden by the HAL if there is
110 a minimum requirement to process interrupts
111 etc."
112 }
113 }
114
115 cdl_option CYGNUM_LIBC_MAIN_THREAD_PRIORITY {
116 display "Priority of main()'s thread"
117 description "
118 This option is used to provide the thread
119 priority which main()'s thread runs at. Be
120 sure to check that this number is appropriate
121 for the kernel scheduler chosen. Different
122 kernel schedulers impose different restrictions
123 on the usable priorities."
124 flavor data
125 legal_values 0 to 0x7fffffff
126 default_value 10
127 }
128 }
129
130 cdl_component CYGFUN_LIBC_ATEXIT {
131 display "Include atexit() function"
132 flavor bool
133 default_value 1
134 description "
135 This option enables the use of the atexit()
136 function, and ensure that the atexit handlers
137 are invoked from within exit() as defined in
138 the ISO C standard."
139
140 cdl_option CYGNUM_LIBC_ATEXIT_HANDLERS {
141 display "Number of functions atexit() supports"
142 flavor data
143 legal_values 1 to 0x7fffffff
144 default_value 32
145 description "
146 This option sets the number of functions
147 that atexit() has room for. In other words,
148 the number of separate atexit() calls that
149 can be made before calling exit() or returning
150 from main() ( in an environment controlled by
151 cyg_iso_c_start() ). For strict compliance
152 with the ISO C standard this should be at
153 least 32."
154 }
155 }
156
157 cdl_option CYGSEM_LIBC_EXIT_CALLS_FFLUSH {
158 display "Make exit() call fflush()"
159 requires CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO
160 default_value 1
161 description "
162 This option will ensure that all output
163 streams are flushed when exitting using
164 exit() as prescribed by the ISO C standard."
165 }
166
167 cdl_option CYGSEM_LIBC_EXIT_STOPS_SYSTEM {
168 display "_exit() stops all threads"
169 requires CYGPKG_KERNEL
170 default_value 0
171 description "
172 If this option is enabled then _exit(),
173 which is called from exit() which itself is
174 called on return from main(), stops the eCos
175 scheduler. For strict POSIX 1003.1
176 compatibility this would be the normal
177 behaviour. To allow the thread to simply
178 exit, without affecting other threads, simply
179 disable this option. If there is no eCos
180 scheduler, then _exit() simply loops
181 irrespective of the setting of this option."
182 }
183
184 cdl_component CYGPKG_LIBC_ENVIRONMENT {
185 display "Provide a system environment"
186 flavor bool
187 default_value 1
188 description "
189 This option allows use of the getenv() function
190 and the global environment pointer
191 char **environ defined by POSIX 1003.1.
192 Disabling this saves a small amount of space."
193
194 cdl_option CYGDAT_LIBC_DEFAULT_ENVIRONMENT {
195 display "Default environment"
196 flavor data
197 default_value {"{ NULL }"}
198 description "
199 This option allows the setting of the default
200 contents of the environment. This is in fact
201 the contents of the global environment pointer
202 char **environ defined by POSIX 1003.1. Strings
203 must be of the form NAME=VALUE, and the final
204 entry must be NULL."
205 }
206 }
207
208 cdl_option CYGSEM_LIBC_INVOKE_DEFAULT_STATIC_CONSTRUCTORS {
209 display "Invoke default static constructors"
210 requires CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG
211 requires CYGSEM_LIBC_STARTUP_MAIN_THREAD
212 default_value 0
213 description "
214 This option causes the C library to call
215 static constructors with default priority
216 from within the context of the main() thread,
217 working with the co-operation of the HAL.
218 This may be needed for environments that
219 expect static constructors to be run in a
220 thread context. Note that this uses an object
221 with priority 65534. Therefore do not use
222 priority 65534 for any other static objects
223 with this option enabled."
224 }