-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathKconfig
2011 lines (1659 loc) · 66.6 KB
/
Kconfig
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
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menuconfig DISABLE_OS_API
bool "Disable NuttX interfaces"
default y
---help---
The following can be used to disable categories of
APIs supported by the OS. If the compiler supports
weak functions, then it should not be necessary to
disable functions unless you want to restrict usage
of those APIs.
if DISABLE_OS_API
config DISABLE_POSIX_TIMERS
bool "Disable POSIX timers"
default DEFAULT_SMALL
---help---
Disable support for the the entire POSIX timer family
including timer_create(), timer_gettime(), timer_settime(),
etc.
NOTE: This option will also disable getitimer() and
setitimer() which are not, strictly speaking, POSIX timers.
config DISABLE_PTHREAD
bool "Disable pthread support"
default DEFAULT_SMALL
config DISABLE_MQUEUE
bool "Disable POSIX message queue support"
default DEFAULT_SMALL
config DISABLE_MQUEUE_SYSV
bool "Disable System V message queue support"
default DISABLE_MQUEUE
---help---
Disable System V message queue support
config DISABLE_ENVIRON
bool "Disable environment variable support"
default DEFAULT_SMALL
endif # DISABLE_OS_API
config DISABLE_IDLE_LOOP
bool "Disable idle loop support"
default n
---help---
This option allows nx_start to return instead of
entering the idle loop.
menu "Clocks and Timers"
config ARCH_HAVE_TICKLESS
bool
config SCHED_TICKLESS
bool "Support tick-less OS"
default n
depends on ARCH_HAVE_TICKLESS
---help---
By default, system time is driven by a periodic timer interrupt. An
alternative configurations is a tick-less configuration in which
there is no periodic timer interrupt. Instead an interval timer is
used to schedule the next OS time event. This option selects that
tick-less OS option. If the tick-less OS is selected, then there are
additional platform specific interfaces that must be provided as
defined in include/nuttx/arch.h
if SCHED_TICKLESS
config SCHED_TICKLESS_TICK_ARGUMENT
bool "Scheduler use tick argument"
default n
---help---
Enables use of tick argument in scheduler. If enabled, then the
board-specific logic must provide the following functions:
int up_timer_gettick(FAR clock_t *ticks);
If SCHED_TICKLESS_ALARM is enabled, then these additional interfaces are
expected:
int up_alarm_tick_cancel(FAR clock_t *ticks);
int up_alarm_tick_start(clock_t ticks);
Otherwise, these additional interfaces are expected:
int up_timer_tick_cancel(FAR clock_t *ticks);
int up_timer_tick_start(FAR clock_t ticks);
config SCHED_TICKLESS_ALARM
bool "Tickless alarm"
default n
---help---
The tickless option can be supported either via a simple interval
timer (plus elapsed time) or via an alarm. The interval timer allows
programming events to occur after an interval. With the alarm,
you can set a time in the future and get an event when that alarm
goes off. This option selects the use of an alarm.
The advantage of an alarm is that it avoids some small timing
errors; the advantage of the use of the interval timer is that
the hardware requirement may be less.
config SCHED_TICKLESS_LIMIT_MAX_SLEEP
bool "Max sleep period (in microseconds)"
default n
---help---
Enables use of the g_oneshot_maxticks variable. This variable is
initialized by platform-specific logic at runtime to the maximum
delay that the timer can wait (in configured clock ticks). The
RTOS tickless logic will then limit all requested delays to this
value.
endif
config USEC_PER_TICK
int "System timer tick period (microseconds)"
default 10000 if !SCHED_TICKLESS
default 100 if SCHED_TICKLESS
---help---
In the "normal" configuration where system time is provided by a
periodic timer interrupt, the default system timer is expected to
run at 100Hz or USEC_PER_TICK=10000. This setting must be defined
to inform of NuttX the interval that the processor hardware is
providing system timer interrupts to the OS.
If SCHED_TICKLESS is selected, then there are no system timer
interrupts. In this case, USEC_PER_TICK does not control any timer
rates. Rather, it only determines the resolution of time reported
by clock_systime_ticks() and the resolution of times that can be set for
certain delays including watchdog timers and delayed work. In this
case there is a trade-off: It is better to have the USEC_PER_TICK as
low as possible for higher timing resolution. However, the time
is currently held in 'unsigned int' on some systems, this may be
16-bits but on most contemporary systems it will be 32-bits. In
either case, smaller values of USEC_PER_TICK will reduce the range
of values that delays that can be represented. So the trade-off is
between range and resolution (you could also modify the code to use
a 64-bit value if you really want both).
The default, 100 microseconds, will provide for a range of delays
up to 120 hours.
This value should never be less than the underlying resolution of
the timer. Error may ensue.
if !SCHED_TICKLESS
config SYSTEMTICK_EXTCLK
bool "Use external clock"
default n
depends on ARCH_HAVE_EXTCLK
---help---
Use external clock for system tick. When enabled, the platform-specific
logic must start its own timer interrupt to make periodic calls to the
nxsched_process_timer() or the functions called within. The purpose is
to move the scheduling off the processor clock to allow entering low
power states that would disable that clock.
config SYSTEMTICK_HOOK
bool "System timer hook"
default n
---help---
Enable a call to a user-provided, board-level function on each timer
tick. This permits custom actions that may be performed on each
timer tick. The form of the user-provided function is:
void board_timerhook(void);
(prototyped in include/nuttx/board.h).
endif # !SCHED_TICKLESS
config SYSTEM_TIME64
bool "64-bit system clock"
default n
---help---
The system timer is incremented at the rate determined by
USEC_PER_TICK, typically at 100Hz. The count at any given time is
then the "uptime" in units of system timer ticks. By default, the
system time is 32-bits wide. Those defaults provide a range of about
497 days which is probably a sufficient range for "uptime".
However, if the system timer rate is significantly higher than 100Hz
and/or if a very long "uptime" is required, then this option can be
selected to support a 64-bit wide timer.
config ARCH_HAVE_ADJTIME
bool
default n
config CLOCK_ADJTIME
bool "Support adjtime function"
default n
depends on ARCH_HAVE_ADJTIME || RTC_ADJTIME
---help---
Enables usage of adjtime() interface used to correct the system time
clock. This requires specific architecture support.
Adjustment can affect system timer period and/or high-resolution RTC.
These are implemented by interfaces up_adjtime() and up_rtc_adjtime().
This is not a POSIX interface but derives from 4.3BSD, System V.
It is also supported for Linux compatibility.
if CLOCK_ADJTIME
config CLOCK_ADJTIME_SLEWLIMIT_PPM
int "Adjtime slew limit"
default 20000
range 1 1000000
---help---
Set limit of adjtime() clock slewing as parts per million.
In real time systems we do not want the time to adjust too quickly.
For example CLOCK_ADJTIME_SLEWLIMIT=1000 will slow or speed the timer
tick period by at most 0.1 percent of the nominal value.
config CLOCK_ADJTIME_PERIOD_MS
int "Adjtime period"
default 970
range 1 3600000
---help---
Define system clock adjustment period in milliseconds.
The adjustment commanded by adjtime() call is applied over this time period.
endif
config ARCH_HAVE_TIMEKEEPING
bool
default n
config CLOCK_TIMEKEEPING
bool "Support timekeeping algorithms"
default n
depends on ARCH_HAVE_TIMEKEEPING
---help---
CLOCK_TIMEKEEPING enables experimental time management algorithms.
config JULIAN_TIME
bool "Enables Julian time conversions"
default n
---help---
Enables Julian time conversions
config START_YEAR
int "Start year"
default 2018
range 1970 2106
---help---
NuttX uses an unsigned 32-bit integer for time_t which provides a
range from 1970 to 2106.
config START_MONTH
int "Start month"
default 1
range 1 12
config START_DAY
int "Start day"
default 1
range 1 31
config PREALLOC_TIMERS
int "Number of pre-allocated POSIX timers"
default 4 if DEFAULT_SMALL
default 8 if !DEFAULT_SMALL
depends on !DISABLE_POSIX_TIMERS
---help---
The number of pre-allocated POSIX timer structures. The system manages a
pool of preallocated timer structures to minimize dynamic allocations. Set to
zero for all dynamic allocations.
config PERF_OVERFLOW_CORRECTION
bool "Compensate perf count overflow"
depends on SYSTEM_TIME64 && (ALARM_ARCH || TIMER_ARCH || ARCH_PERF_EVENTS)
default n
---help---
If this option is enabled, then the perf event will be enabled
by default.
When enabled, it will always return an increasing count value to
avoid overflow on 32-bit platforms.
endmenu # Clocks and Timers
menu "Tasks and Scheduling"
config SPINLOCK
bool "Support Spinlocks"
default n
---help---
Enables support for spinlocks. Spinlocks are used primarily for
synchronization in SMP configurations but are available for general
synchronization between CPUs. Use in a single CPU configuration would
most likely be fatal. Note, however, that this does not depend on
CONFIG_ARCH_HAVE_MULTICPU. This permits the use of spinlocks in
other novel architectures.
if SPINLOCK
config TICKET_SPINLOCK
bool "Use ticket Spinlocks"
default n
---help---
Use ticket spinlock algorithm.
config RW_SPINLOCK
bool "Support read-write Spinlocks"
default n
---help---
Spinlocks are spilit into read and write lock.
Reader can take read lock simultaneously and only one writer
can take write lock.
endif # SPINLOCK
config IRQCHAIN
bool "Enable multi handler sharing a IRQ"
default n
---help---
Enable support for IRQCHAIN.
if IRQCHAIN
config PREALLOC_IRQCHAIN
int "Number of pre-allocated irq chains"
default 4 if DEFAULT_SMALL
default 8 if !DEFAULT_SMALL
---help---
The number of pre-allocated irq chain structures. The system manages
a pool of preallocated irq chain structures to minimize dynamic
allocations. You will, however, get better performance and memory
usage if this value is tuned to minimize such allocations.
endif # IRQCHAIN
config IRQ_NWORKS
int "Max num of active irq wqueue"
default 8
---help---
The max num of active irq wqueue.
config IRQ_WORK_SECTION
string "The section where irq stack is located"
---help---
The section where irq stack is located.
config IRQ_WORK_STACKSIZE
int "The default stack size for isr wqueue"
default DEFAULT_TASK_STACKSIZE
---help---
The default stack size for isr wqueue.
config IRQCOUNT
bool
default n
config SMP
bool "Symmetric Multi-Processing (SMP)"
default n
depends on ARCH_HAVE_MULTICPU
depends on ARCH_HAVE_TESTSET
depends on ARCH_INTERRUPTSTACK != 0
select SPINLOCK
select IRQCOUNT
---help---
Enables support for Symmetric Multi-Processing (SMP) on a multi-CPU
platform.
N.B. SMP mode requires the use of ARCH_INTERRUPTSTACK:
CPU0 thread0 -> IRQ enter -> add thread0 to block_list -> IRQ leave(crash)
||
/\
/ \
CPU1 thread1 -> block_task -> take thread0 from block_list -> run thread0
CPU0 IRQ handler use thread0's stack, but thread0 may switch to CPU1, that
will caused IRQ handler stack corruption.
if SMP
config SMP_NCPUS
int "Number of CPUs"
default 4
range 1 32
---help---
This value identifies the number of CPUs supported by the processor
that will be used for SMP.
If CONFIG_DEBUG_FEATURES is enabled, then the value one is permitted
for CONFIG_SMP_NCPUS. This is not normally a valid setting for an
SMP configuration. However, running the SMP logic in a single CPU
configuration is useful during certain testing.
config SMP_DEFAULT_CPUSET
hex "Default CPU bit set"
default 0xffffffff
---help---
Set the Default CPU bits. The way to use the unset CPU is to call the
sched_setaffinity function to bind a task to the CPU. bit0 means CPU0.
endif # SMP
choice
prompt "Initialization Task"
default INIT_ENTRY if !BUILD_KERNEL
default INIT_FILE if !BINFMT_DISABLE
default INIT_NONE if BINFMT_DISABLE
config INIT_NONE
bool "None"
config INIT_ENTRY
bool "Via application entry"
depends on !BUILD_KERNEL
config INIT_FILE
bool "Via executable file"
depends on !BINFMT_DISABLE
endchoice # Initialization task
config INIT_ARGS
string "Application argument list"
depends on !INIT_NONE
---help---
The argument list for user applications. e.g.:
"\"arg1\",\"arg2\",\"arg3\""
config INIT_STACKSIZE
int "Main thread stack size"
default DEFAULT_TASK_STACKSIZE
---help---
The size of the stack to allocate for the user initialization thread
that is started as soon as the OS completes its initialization.
config INIT_PRIORITY
int "init thread priority"
default 100
---help---
The priority of the user initialization thread.
if INIT_ENTRY
config INIT_ENTRYPOINT
string "Application entry point"
default "main"
---help---
The name of the entry point for user applications. For the example
applications this is of the form 'app_main' where 'app' is the application
name. If not defined, INIT_ENTRYPOINT defaults to "main".
Note that main must take "argc" and "argv" arguments:
int main(int argc, FAR char *argv[])
Otherwise, if using a signature such as "int main(void)" a compilation
error will result:
> $ make
> CC: CustomHello.c <command-line>: error: conflicting types for
> 'custom_hello_main'
> CustomHello.c:3:5: note: in expansion of macro 'main'
> 3 | int main(void)
> | ^~~~
config INIT_ENTRYNAME
string "Application entry name"
default INIT_ENTRYPOINT
endif # INIT_ENTRY
if INIT_FILE
config INIT_FILEPATH
string "Application initialization path"
default "/bin/init"
---help---
The name of the entry point for user applications. For the example
applications this is of the form 'app_main' where 'app' is the application
name. If not defined, INIT_ENTRYPOINT defaults to "main".
config INIT_SYMTAB
string "Symbol table"
default "NULL" if !EXECFUNCS_HAVE_SYMTAB
default EXECFUNCS_SYMTAB_ARRAY if EXECFUNCS_HAVE_SYMTAB
depends on BUILD_FLAT
---help---
The name of other global array that holds the exported symbol table.
The special string "NULL" may be provided if there is no symbol
table. Quotation marks will be stripped when config.h is generated.
NOTE: This setting cannot be used in protected or kernel builds.
Any kernel mode symbols tables would not be usable for resolving
symbols in user mode executables.
config INIT_NEXPORTS
string "Symbol table size"
default "0" if !EXECFUNCS_HAVE_SYMTAB
default EXECFUNCS_NSYMBOLS_VAR if EXECFUNCS_HAVE_SYMTAB
depends on BUILD_FLAT
---help---
The size of the symbol table. NOTE that is is logically a numeric
value but is represent by a string. That allows you to put
sizeof(something) or a macro or a global variable name for the
symbol table size. Quotation marks will be stripped when config.h
is generated.
NOTE: This setting cannot be used in protected or kernel builds.
Any kernel mode symbols tables would not be usable for resolving
symbols in user mode executables.
menuconfig INIT_MOUNT
bool "Auto-mount init file system"
default n
depends on !DISABLE_MOUNTPOINT
---help---
In order to use the the initial startup program when CONFIG_INIT_FILEPATH
is provided, it is necessary to mount the initial file system that
provides init program. Normally this mount is done in the board-specific
initialization logic. However, if the mount is very simple, it can be
performed by the OS bring-up logic itself by selecting this option.
if INIT_MOUNT
config INIT_MOUNT_SOURCE
string "The block device to mount"
default "/dev/ram0"
config INIT_MOUNT_TARGET
string "Path to the mounted file system"
default "/bin"
config INIT_MOUNT_FSTYPE
string "The file system type to mount"
default "romfs"
config INIT_MOUNT_FLAGS
hex "Flags passed to mount"
default 0
config INIT_MOUNT_DATA
string "Additional data passed to mount"
default ""
endif # INIT_MOUNT
endif # INIT_FILE
menuconfig ETC_ROMFS
bool "Auto-mount etc baked-in ROMFS image"
default n
depends on !DISABLE_MOUNTPOINT && FS_ROMFS
---help---
Mount a ROMFS filesystem at /etc and provide a system init
script at /etc/init.d/rc.sysinit and a startup script
at /etc/init.d/rcS. The default system init script will mount
a FAT FS RAMDISK at /tmp but the logic is easily extensible.
if ETC_ROMFS
config ETC_CROMFS
bool "Support CROMFS (compressed) start-up script"
default n
depends on FS_CROMFS
---help---
Mount a CROMFS filesystem at /etc and provide a compressed system
init script at /etc/init.d/rc.sysinit and a startup script
at /etc/init.d/rcS.
config ETC_ROMFSMOUNTPT
string "Mountpoint of the etc romfs image"
default "/etc"
config ETC_ROMFSDEVNO
int "ROMFS block device minor number"
default 0
---help---
This is the minor number of the ROMFS block device. The default is
'0' corresponding to /dev/ram0.
config ETC_ROMFSSECTSIZE
int "ROMFS sector size"
default 64
---help---
This is the sector size to use with the ROMFS volume. Since the
default volume is very small, this defaults to 64 but should be
increased if the ROMFS volume were to be become large. Any value
selected must be a power of 2.
config ETC_FATDEVNO
int "FAT block device minor number"
default 1
depends on FS_FAT
---help---
When the default rcS file used when ETC_ROMFS is selected, it
will mount a FAT FS under /tmp. This is the minor number of the FAT
FS block device. The default is '1' corresponding to /dev/ram1.
config ETC_FATSECTSIZE
int "FAT sector size"
default 512
depends on FS_FAT
---help---
When the default rcS file used when ETC_ROMFS is selected, it
will mount a FAT FS under /tmp. This is the sector size use with the
FAT FS. Default is 512.
config ETC_FATNSECTORS
int "FAT number of sectors"
default 1024
depends on FS_FAT
---help---
When the default rcS file used when ETC_ROMFS is selected, it
will mount a FAT FS under /tmp. This is the number of sectors to use
with the FAT FS. Default is 1024. The amount of memory used by the
FAT FS will be ETC_FATSECTSIZE * ETC_FATNSECTORS bytes.
config ETC_FATMOUNTPT
string "FAT mount point"
default "/tmp"
depends on FS_FAT
---help---
When the default rcS file used when ETC_ROMFS is selected, it
will mount a FAT FS under /tmp. This is the location where the FAT
FS will be mounted. Default is "/tmp".
endif # ETC_ROMFS
config RR_INTERVAL
int "Round robin timeslice (MSEC)"
default 0
---help---
The round robin timeslice will be set this number of milliseconds;
Round robin scheduling (SCHED_RR) is enabled by setting this
interval to a positive, non-zero value.
config SCHED_SPORADIC
bool "Support sporadic scheduling"
default n
select SCHED_SUSPENDSCHEDULER
select SCHED_RESUMESCHEDULER
---help---
Build in additional logic to support sporadic scheduling
(SCHED_SPORADIC).
if SCHED_SPORADIC
config SCHED_SPORADIC_MAXREPL
int "Maximum number of replenishments"
default 3
range 1 255
---help---
Controls the size of allocated replenishment structures and, hence,
also limits the maximum number of replenishments.
config SPORADIC_INSTRUMENTATION
bool "Sporadic scheduler monitor hooks"
default n
---help---
Enables instrumentation in the sporadic scheduler to monitor
scheduler behavior. If enabled, then the board-specific logic must
provide the following functions:
void arch_sporadic_start(FAR struct tcb_s *tcb);
void arch_sporadic_lowpriority(FAR struct tcb_s *tcb);
void arch_sporadic_suspend(FAR struct tcb_s *tcb);
void arch_sporadic_resume(FAR struct tcb_s *tcb);
endif # SCHED_SPORADIC
config TASK_NAME_SIZE
int "Maximum task name size"
default 31
---help---
Specifies the maximum size of a task name to save in the TCB.
Useful if scheduler instrumentation is selected. Set to zero to
disable. Excludes the NUL terminator; the actual allocated size
will be TASK_NAME_SIZE + 1. The default of 31 then results in
a align-able 32-byte allocation.
config SCHED_HAVE_PARENT
bool "Support parent/child task relationships"
default n
---help---
Remember the ID of the parent task when a new child task is
created. This support enables some additional features (such as
SIGCHLD) and modifies the behavior of other interfaces. For
example, it makes waitpid() more standards complete by restricting
the waited-for tasks to the children of the caller. Default:
disabled.
config SCHED_CHILD_STATUS
bool "Retain child exit status"
default n
depends on SCHED_HAVE_PARENT
---help---
If this option is selected, then the exit status of the child task
will be retained after the child task exits. This option should be
selected if you require knowledge of a child process's exit status.
Without this setting, wait(), waitpid() or waitid() may fail. For
example, if you do:
1) Start child task
2) Wait for exit status (using wait(), waitpid(), or waitid()).
This can fail because the child task may run to completion before
the wait begins. There is a non-standard work-around in this case:
The above sequence will work if you disable pre-emption using
sched_lock() prior to starting the child task, then re-enable pre-
emption with sched_unlock() after the wait completes. This works
because the child task is not permitted to run until the wait is in
place.
The standard solution would be to enable SCHED_CHILD_STATUS. In
this case the exit status of the child task is retained after the
child exits and the wait will successful obtain the child task's
exit status whether it is called before the child task exits or not.
Warning: If you enable this feature, then your application must
either (1) take responsibility for reaping the child status with wait(),
waitpid(), or waitid(), or (2) suppress retention of child status.
If you do not reap the child status, then you have a memory leak and
your system will eventually fail.
Retention of child status can be suppressed on the parent using logic like:
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_NOCLDWAIT;
int ret = sigaction(SIGCHLD, &sa, NULL);
if SCHED_CHILD_STATUS
config PREALLOC_CHILDSTATUS
int "Number of pre-allocated child status"
default 0
---help---
To prevent runaway child status allocations and to improve
allocation performance, child task exit status structures are pre-
allocated when the system boots. This setting determines the number
of child status structures that will be pre-allocated.
However, the number of child status structures may need to be
significantly larger because this number includes the maximum number
of tasks that are running PLUS the number of tasks that have exit'ed
without having their exit status reaped (via wait(), waitid(), or
waitpid()).
Obviously, if tasks spawn children indefinitely and never have the
exit status reaped, then you may have a memory leak! If you enable
the SCHED_CHILD_STATUS feature, then your application must take
responsibility for either (1) reaping the child status with wait(),
waitpid(), or waitid() or it must (2) suppress retention of child
status. Otherwise, your system will eventually fail.
Retention of child status can be suppressed on the parent using logic like:
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_NOCLDWAIT;
int ret = sigaction(SIGCHLD, &sa, NULL);
config DEBUG_CHILDSTATUS
bool "Enable Child Status Debug Output"
default n
depends on SCHED_CHILD_STATUS && DEBUG_FEATURES
---help---
Very detailed... I am sure that you do not want this.
endif # SCHED_CHILD_STATUS
config SCHED_WAITPID
bool "Enable waitpid() API"
default n
depends on SCHED_HAVE_PARENT || !BUILD_KERNEL
---help---
Enables the waitpid() interface in a default, non-standard mode
(non-standard in the sense that the waited for PID need not be child
of the caller). If SCHED_HAVE_PARENT is also defined, then this
setting will modify the behavior or waitpid() (making more spec
compliant) and will enable the waitid() and wait() interfaces as
well. Note that SCHED_HAVE_PARENT must be defined in BUILD_KERNEL if
SCHED_WAITPID is needed.
config SCHED_DUMP_LEAK
bool "Enable catch task memory leak"
default n
---help---
When this option is enabled, the task's outstanding memory allocations
are printed using syslog. This helps catch any memory allocated by the
task that remains unreleased when the task exits.
config SCHED_DUMP_ON_EXIT
bool "Dump all tasks state on exit"
default n
---help---
Dump all tasks state on exit()
config SCHED_USER_IDENTITY
bool "Support per-task User Identity"
default n
---help---
This selection enables functionality of getuid(), setuid(), getgid(),
setgid(). If this option is not selected, then stub, root-only
versions of these interfaces are available. When selected, these
interfaces will associate a UID and/or GID with each task group.
Those can then be managed using the interfaces. Child tasks will
inherit the UID and GID of its parent.
config SCHED_THREAD_LOCAL
bool "Support __thread/thread_local keyword"
default n
depends on ARCH_HAVE_THREAD_LOCAL
---help---
This option enables architecture-specific TLS support (__thread/thread_local keyword)
Note: Toolchain must be compiled with '--enable-tls' enabled
endmenu # Tasks and Scheduling
menu "Pthread Options"
depends on !DISABLE_PTHREAD
config PTHREAD_MUTEX_TYPES
bool "Enable mutex types"
default n
---help---
Set to enable support for recursive and errorcheck mutexes. Enables
pthread_mutexattr_settype().
choice
prompt "pthread mutex robustness"
default PTHREAD_MUTEX_ROBUST if !DEFAULT_SMALL
default PTHREAD_MUTEX_UNSAFE if DEFAULT_SMALL
config PTHREAD_MUTEX_ROBUST
bool "Robust mutexes"
---help---
Support only the robust form of the NORMAL mutex.
config PTHREAD_MUTEX_UNSAFE
bool "Traditional unsafe mutexes"
---help---
Support only the traditional non-robust form of the NORMAL mutex.
You should select this option only for backward compatibility with
software you may be porting or, perhaps, if you are trying to minimize
footprint.
config PTHREAD_MUTEX_BOTH
bool "Both robust and unsafe mutexes"
---help---
Support both forms of NORMAL mutexes.
endchoice # pthread mutex robustness
choice
prompt "Default NORMAL mutex robustness"
default PTHREAD_MUTEX_DEFAULT_ROBUST
depends on PTHREAD_MUTEX_BOTH
config PTHREAD_MUTEX_DEFAULT_ROBUST
bool "Robust default"
---help---
The default is robust NORMAL mutexes (non-standard)
config PTHREAD_MUTEX_DEFAULT_UNSAFE
bool "Unsafe default"
---help---
The default is traditional unsafe NORMAL mutexes (standard)
endchoice # Default NORMAL mutex robustness
choice
prompt "Default pthread mutex protocol"
default PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT
config PTHREAD_MUTEX_DEFAULT_PRIO_NONE
bool "PTHREAD_PRIO_NONE default"
---help---
By default, pthread mutexes utilize PTHREAD_PRIO_NONE protocol (standard).
config PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT
bool "PTHREAD_PRIO_INHERIT default"
depends on PRIORITY_INHERITANCE
---help---
By default, pthread mutexes utilize PTHREAD_PRIO_INHERIT protocol
(POSIX non-standard but a reasonable choice for most real-time systems).
endchoice # Default pthread mutex protocol
config CANCELLATION_POINTS
bool "Cancellation points"
default n
---help---
Enable POSIX cancellation points for pthread_cancel(). If selected,
cancellation points will also used with the task_delete() API even if
pthreads are not enabled.
endmenu # Pthread Options
menu "Performance Monitoring"
config SCHED_SUSPENDSCHEDULER
bool
default n
config SCHED_RESUMESCHEDULER
bool
default n
config SCHED_IRQMONITOR
bool "Enable IRQ monitoring"
default n
depends on FS_PROCFS
---help---
Enabling counting of interrupts from all interrupt sources. These
counts will be available in the mounted procfs file systems at the
top-level file, "irqs".
config SCHED_CRITMONITOR
bool "Enable Critical Section monitoring"
default n
depends on FS_PROCFS
select SCHED_SUSPENDSCHEDULER
select SCHED_RESUMESCHEDULER
select IRQCOUNT
---help---
Enables logic that monitors the duration of time that a thread keeps
interrupts or pre-emption disabled. These global locks can have
negative consequences to real time performance: Disabling interrupts
adds jitter in the time when an interrupt request is asserted until
the hardware can respond with the interrupt. Disabling pre-emption
adds jitter in the time from when the event is posted in the
interrupt handler until the task that responds to the event can run.
if SCHED_CRITMONITOR
config SCHED_CRITMONITOR_MAXTIME_THREAD
int "THREAD max execution time"
default 0
---help---
Thread execution time should be smaller than
SCHED_CRITMONITOR_MAXTIME_THREAD, or system will give a warning.
For debugging system latency, 0 means disabled.
config SCHED_CRITMONITOR_MAXTIME_WQUEUE
int "WORK queue max execution time"
default -1
---help---
Worker execution time should be smaller than
SCHED_CRITMONITOR_MAXTIME_WQUEUE, or system will give a warning.
For debugging system latency, 0 means disabled.
config SCHED_CRITMONITOR_MAXTIME_PREEMPTION
int "Pre-emption (sched_lock) max holding time"
default SCHED_CRITMONITOR_MAXTIME_WQUEUE
---help---
Pre-emption holding time should be smaller than
SCHED_CRITMONITOR_MAXTIME_PREEMPTION, or system will give a warning.
For debugging system latency, 0 means disabled.
config SCHED_CRITMONITOR_MAXTIME_CSECTION
int "Csection (enter_critical_section) max holding time"
default SCHED_CRITMONITOR_MAXTIME_PREEMPTION
---help---
Csection holding time should be smaller than
SCHED_CRITMONITOR_MAXTIME_CSECTION, or system will give a warning.
For debugging system latency, 0 means disabled.
config SCHED_CRITMONITOR_MAXTIME_IRQ
int "IRQ max execution time"
default SCHED_CRITMONITOR_MAXTIME_CSECTION
---help---
IRQ handler execution time should be smaller than
SCHED_CRITMONITOR_MAXTIME_IRQ, or system will give a warning.
For debugging system latency, 0 means disabled.
config SCHED_CRITMONITOR_MAXTIME_WDOG
int "WDOG callback max execution time"
default SCHED_CRITMONITOR_MAXTIME_IRQ
---help---
Wdog callback execution time should be smaller than
SCHED_CRITMONITOR_MAXTIME_WDOG, or system will give a warning.
For debugging system latency, 0 means disabled.
endif # SCHED_CRITMONITOR
config SCHED_CRITMONITOR_MAXTIME_PANIC
bool "Monitor timeout panic"
depends on \
SCHED_CRITMONITOR_MAXTIME_THREAD > 0 || \
SCHED_CRITMONITOR_MAXTIME_WDOG > 0 || \
SCHED_CRITMONITOR_MAXTIME_WQUEUE > 0 || \