summaryrefslogtreecommitdiff
path: root/nuttx/libc/Kconfig
blob: 2173d1bd476fa19e7d838d8683505273ca06bf74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
#
# For a description of the syntax of this configuration file,
# see misc/tools/kconfig-language.txt.
#

comment "Standard C Library Options"

config STDIO_BUFFER_SIZE
	int "C STDIO buffer size"
	default 64
	---help---
		Size of buffers using within the C buffered I/O interfaces.
		(printf, putchar, fwrite, etc.).

config STDIO_LINEBUFFER
	bool "STDIO line buffering"
	default y
	---help---
		Flush buffer I/O whenever a newline character is found in
		the output data stream.

config NUNGET_CHARS
	int "Number unget() characters"
	default 2
	---help---
		Number of characters that can be buffered by ungetc() (Only if NFILE_STREAMS > 0)

config LIB_HOMEDIR
	string "Home directory"
	default "/"
	depends on !DISABLE_ENVIRON
	---help---
		The home directory to use with operations like such as 'cd ~'

source libc/math/Kconfig

config NOPRINTF_FIELDWIDTH
	bool "Disable sprintf support fieldwidth"
	default n
	---help---
	sprintf-related logic is a
	little smaller if we do not support fieldwidthes

config LIBC_FLOATINGPOINT
	bool "Enable floating point in printf"
	default n
	---help---
		By default, floating point
		support in printf, sscanf, etc. is disabled.

config LIB_RAND_ORDER
	int "Order of the random number generate"
	default 1
	range 1 3
	---help---
		The order of the random number generator. 1=fast but very bad random
		numbers, 3=slow but very good random numbers.

choice
	prompt "Newline Options"
	default EOL_IS_EITHER_CRLF
	---help---
		This selection determines the line terminating character that is used.
		Some environments may return CR as end-of-line, others LF, and others
		both.  If not specified, the default is either CR or LF (but not both)
		as the line terminating charactor.

config EOL_IS_CR
	bool "EOL is CR"

config EOL_IS_LF
	bool "EOL is LF"

config EOL_IS_BOTH_CRLF
	bool "EOL is CR and LF"

config EOL_IS_EITHER_CRLF
	bool "EOL is CR or LF"

endchoice

config LIBC_EXECFUNCS
	bool "Enable exec[l|v] / posix_spawn() Support"
	default n
	depends on !BINFMT_DISABLE
	---help---
		Enable support for the exec[l|v] family of functions that can be
		used to start other programs, terminating the current program and
		the posix_spawn() familty of functions that can be used start other
		programs without terminating the current program.  The typical
		usage of the exec[l|v] functions is (1) first call vfork() to create
		a new thread, then (2) call exec[l|v] to replace the new thread with
		a program from the file system.

		NOTE 1: This two step process start is completely unnecessary in
		NuttX and is provided only for compatibily with Unix systems.  These
		functions are essentially just wrapper functions that (1) call the
		non-standard binfmt function 'exec', and then (2) exit(0).  Since
		the new thread will be terminated by the exec[l|v] call, it really
		served no purpose other than to suport Unix compatility.

		The posix_spawn() functions do not have this inefficiency.

		NOTE 2: Support for exec[l|v] and posix_spawn() is conditional
		because they require additional support for symbol tables that
		will not be available in the typical system.

if LIBC_EXECFUNCS

config EXECFUNCS_SYMTAB
	string "Symbol table used by exec[l|v]"
	default "g_symtab"
	---help---
		The exec[l|v] and posix_spawn() functions are wrapper functions that
		call the non-standard binfmt function 'exec').  The binfmt
		function 'exec' needs to have (1) a symbol table that provides the
		list of symbols exported by the base code, and (2) the number of
		symbols in that table.  This selection provides the name of that
		symbol table.

config EXECFUNCS_NSYMBOLS
	int "Number of Symbols in the Table"
	default 0
	---help---
		The exec[l|v] and posix_spawn() functions are wrapper functions that
		call the non-standard binfmt function 'exec').  The binfmt
		function 'exec' needs to have (1) a symbol table that provides the
		list of symbols exported by the base code, and (2) the number of
		symbols in that table.  This selection provides the number of
		symbols in the symbol table.

endif

config POSIX_SPAWN_PROXY_STACKSIZE
	int "Spawn Stack Size"
	default 1024
	---help---
		If posix_spawn[p]() and task_spawn() use I/O redirection options,
		they will require an intermediary/proxy task to muck with the file
		descriptors.  This configuration item specifies the stack size
		used for the proxy. Default: 1024 bytes.

config TASK_SPAWN_DEFAULT_STACKSIZE
	int "Default task_spawn Stack Size"
	default 2048
	---help---
		The actual size to use for the child task's stack can be set with
		task_spawnattr_setstacksize().  This value specifies the default
		stack size to use if task_spawnattr_setstacksize() is not used.
		Default: 2048.

config LIBC_STRERROR
	bool "Enable strerror"
	default n
	---help---
		strerror() is useful because it decodes 'errno' values into a human readable
		strings.  But it can also require a lot of memory.  If this option is selected,
		strerror() will still exist in the build but it will not decode error values.
		This option should be used by other logic to decide if it should use strerror()
		or not.  For example, the NSH application will not use strerror() if this
		option is not selected; perror() will not use strerror() is this option is not
		selected (see also NSH_STRERROR).

config LIBC_STRERROR_SHORT
	bool "Use short error descriptions in strerror()"
	default n
	depends on LIBC_STRERROR
	---help---
		If this option is selected, then strerror() will use a shortened string when
		it decodes the error.  Specifically, strerror() is simply use the string that
		is the common name for the error.  For example, the 'errno' value of 2 will
		produce the string "No such file or directory" is LIBC_STRERROR_SHORT
		is not defined but the string "ENOENT" is LIBC_STRERROR_SHORT is defined.

config LIBC_PERROR_STDOUT
	bool "perror() to stdout"
	default n
	---help---
		POSIX requires that perror() provide its output on stderr.  This option may
		be defined, however, to provide perror() output that is serialized with
		other stdout messages.

config ARCH_LOWPUTC
	bool "Low-level console output"
	default "y"
	---help---
		architecture supports low-level, boot time console output

config LIB_SENDFILE_BUFSIZE
	int "sendfile() buffer size"
	default 512
	---help---
		Size of the I/O buffer to allocate in sendfile().  Default: 512b

config ARCH_ROMGETC
	bool "Support for ROM string access"
	default n
	---help---
		In Harvard architectures, data accesses and instruction accesses
		occur on different busses, perhaps concurrently.  All data accesses
		are performed on the data bus unless special machine instructions
		are used to read data from the instruction address space.  Also, in
		the typical MCU, the available SRAM data memory is much smaller that
		the non-volatile FLASH instruction memory.  So if the application
		requires many constant strings, the only practical solution may be
		to store those constant strings in FLASH memory where they can only
		be accessed using architecture-specific machine instructions.

		If ARCH_ROMGETC is defined, then the architecture logic must export
		the function up_romgetc().  up_romgetc() will simply read one byte
		of data from the instruction space.

		If ARCH_ROMGETC, certain C stdio functions are effected: (1) All
		format strings in printf, fprintf, sprintf, etc. are assumed to lie
		in FLASH (string arguments for %s are still assumed to reside in SRAM).
		And (2), the string argument to puts and fputs is assumed to reside
		in FLASH.  Clearly, these assumptions may have to modified for the
		particular needs of your environment.  There is no "one-size-fits-all"
		solution for this problem.

config ARCH_OPTIMIZED_FUNCTIONS
	bool "Enable arch optimized functions"
	default n
	---help---
		Allow for architecture optimized implementations of certain library
		functions.  Architecture-specific implementations can improve overall
		system performance.

if ARCH_OPTIMIZED_FUNCTIONS
config ARCH_MEMCPY
	bool "memcpy()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of memcpy().

config MEMCPY_VIK
	bool "Vik memcpy()"
	default n
	depends on !ARCH_MEMCPY
	---help---
		Select this option to use the optimized memcpy() function by Daniel Vik.
		Select this option for improved performance at the expense of increased
		size. See licensing information in the top-level COPYING file.

if MEMCPY_VIK
config MEMCPY_PRE_INC_PTRS
	bool "Pre-increment pointers"
	default n
	---help---
		Use pre-increment of pointers. Default is post increment of pointers.

config MEMCPY_INDEXED_COPY
	bool "Array indexing"
	default y
	---help---
		Copying data using array indexing. Using this option, disables the
		MEMCPY_PRE_INC_PTRS option.

config MEMCPY_64BIT
	bool "64-bit memcpy()"
	default n
	---help---
		Compiles memcpy() for architectures that suppport 64-bit operations
		efficiently.

endif

config ARCH_MEMCMP
	bool "memcmp()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of memcmp().

config ARCH_MEMMOVE
	bool "memmove()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of memmove().

config ARCH_MEMSET
	bool "memset()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of memset().

config MEMSET_OPTSPEED
	bool "Optimize memset() for speed"
	default n
	depends on !ARCH_MEMSET
	---help---
		Select this option to use a version of memcpy() optimized for speed.
		Default: memcpy() is optimized for size.

config MEMSET_64BIT
	bool "64-bit memset()"
	default n
	depends on MEMSET_OPTSPEED
	---help---
		Compiles memset() for architectures that suppport 64-bit operations
		efficiently.

config ARCH_STRCHR
	bool "strchr()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of strchr().

config ARCH_STRCMP
	bool "strcmp()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of strcmp().

config ARCH_STRCPY
	bool "strcpy()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of strcpy().

config ARCH_STRNCPY
	bool "strncpy()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of strncpy().

config ARCH_STRLEN
	bool "strlen"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of strlen().

config ARCH_STRNLEN
	bool "strlen()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of strnlen().

config ARCH_BZERO
	bool "bzero()"
	default n
	---help---
		Select this option if the architecture provides an optimized version
		of bzero().

endif

comment "Non-standard Library Support"

config SCHED_WORKQUEUE
	bool "Enable worker thread"
	default n
	depends on !DISABLE_SIGNALS
	---help---
		Create a dedicated "worker" thread to handle delayed processing from interrupt
		handlers.  This feature is required for some drivers but, if there are no
		complaints, can be safely disabled.  The worker thread also performs
		garbage collection -- completing any delayed memory deallocations from
		interrupt handlers.  If the worker thread is disabled, then that clean up will
		be performed by the IDLE thread instead (which runs at the lowest of priority
		and may not be appropriate if memory reclamation is of high priority).

if SCHED_WORKQUEUE

config SCHED_HPWORK
	bool "High priority (kernel) worker thread"
	default y
	---help---
		If SCHED_WORKQUEUE is defined, then a single, high priority work queue is
		created by default.  This high priority worker thread is intended to serve
		as the "bottom half" for driver interrupt handling.

if SCHED_HPWORK
config SCHED_WORKPRIORITY
	int "High priority worker thread priority"
	default 192
	---help---
		The execution priority of the worker thread.  Default: 192

config SCHED_WORKPERIOD
	int "High priority worker thread period"
	default 50000
	---help---
		How often the worker thread checks for work in units of microseconds.
		Default: 50*1000 (50 MS).

config SCHED_WORKSTACKSIZE
	int "High priority worker thread stack size"
	default 2048
	depends on SCHED_WORKQUEUE
	---help---
		The stack size allocated for the worker thread.  Default: 2K.

config SCHED_LPWORK
	bool "Low priority (kernel) worker thread"
	default n
	---help---
		If SCHED_WORKQUEUE is defined, then a single work queue is created by
		default.  If SCHED_LPWORK is also defined then an additional, lower-
		priority work queue will also be created.  This lower priority work
		queue is better suited for more extended processing (such as file system
		clean-up operations)

if SCHED_LPWORK

config SCHED_LPWORKPRIORITY
	int "Low priority worker thread priority"
	default 50
	---help---
		The execution priority of the lopwer priority worker thread.  Default: 192

config SCHED_LPWORKPERIOD
	int "Low priority worker thread period"
	default 50000
	---help---
		How often the lower priority worker thread checks for work in units
		of microseconds. Default: 50*1000 (50 MS).

config SCHED_LPWORKSTACKSIZE
	int "Low priority worker thread stack size"
	default 2048
	---help---
		The stack size allocated for the lower priority worker thread.  Default: 2K.

endif # SCHED_LPWORK
endif # SCHED_HPWORK

if NUTTX_KERNEL

config SCHED_USRWORK
	bool "User mode worker thread"
	default n
	---help---
		User space work queues can also be made available for deferred processing in the NuttX kernel build.

if SCHED_USRWORK

config SCHED_LPWORKPRIORITY
	int "User mode priority worker thread priority"
	default 50
	---help---
		The execution priority of the lopwer priority worker thread.  Default: 192

config SCHED_LPWORKPERIOD
	int "User mode worker thread period"
	default 50000
	---help---
		How often the lower priority worker thread checks for work in units
		of microseconds. Default: 50*1000 (50 MS).

config SCHED_LPWORKSTACKSIZE
	int "User mode worker thread stack size"
	default 2048
	---help---
		The stack size allocated for the lower priority worker thread.  Default: 2K.

endif # SCHED_USRWORK
endif # NUTTX_KERNEL
endif # SCHED_WORKQUEUE

config LIB_KBDCODEC
	bool "Keyboard CODEC"
	default n
	---help---
		In NuttX, a keyboard/keypad driver is simply a character driver that
		may have an (optional) encoding/decoding layer on the data returned
		by the character driver. A keyboard may return simple text data
		(alphabetic, numeric, and punctuaction) or control characters
		(enter, control-C, etc.).  However, in addition, most keyboards
		support actions that cannot be represented as text data. Such
		actions include things like cursor controls (home, up arrow,
		page down, etc.), editing functions (insert, delete, etc.), volume
		controls, (mute, volume up, etc.) and other special functions.
		Some special encoding may be required to multiplex these two classes
		of data.

		This option enables the functions that implement the encoding and
		decoding of keyboard data.  These are the interfaces prototyped in
		include/nuttx/input/kbd_codec.h.  While not correctly a part of
		the C library, it is included here because the decoding side of this
		interface must be accessible by end user programs.

config LIB_SLCDCODEC
	bool "Segment LCD CODEC"
	default n
	---help---
		In NuttX, a character-oriented, segment LCD (SLCD) driver is simply
		a character device that may have an (optional) encoding/decoding
		layer on the data provided to the SLCD driver.  The application may
		provide simple text data (alphabetic, numeric, and punctuaction) or
		control characters (enter, control-C, etc.).  However, in addition,
		most SLCDs support actions that cannot be represented as text data.
		Such actions include things like cursor controls (home, up arrow,
		page down, etc.) and other special functions (e.g., blinking).  Some
		special encoding may be required to multiplex these two classes of
		data.

		This option enables the functions that implement the encoding and
		decoding of SLCD data.  These are the interfaces prototyped in
		include/nuttx/lcd/slcd_codec.h.  While not correctly a part of the C
		library, it is included here because the encoding side of this
		interface must be accessible by end user programs.