forked from apache/nuttx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKconfig
1386 lines (1144 loc) · 46.4 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.
There are certain dependency relationships in these
features.
1) mq_notify logic depends on signals to awaken tasks
waiting for queues to become full or empty.
2) pthread_condtimedwait() depends on signals to wake
up waiting tasks.
if DISABLE_OS_API
config DISABLE_POSIX_TIMERS
bool "Disable POSIX timers"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
config DISABLE_PTHREAD
bool "Disable pthread support"
default n
config DISABLE_SIGNALS
bool "Disable signal support"
default n
config DISABLE_MQUEUE
bool "Disable POSIX message queue support"
default n
config DISABLE_ENVIRON
bool "Disable environment variable support"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
endif # DISABLE_OS_API
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 and 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 include/nuttx/arch.h
if SCHED_TICKLESS
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_systimer() 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
sched_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.
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 CLOCK_MONOTONIC
bool "Support CLOCK_MONOTONIC"
default n
---help---
CLOCK_MONOTONIC is an optional standard POSIX clock. Unlike
CLOCK_REALTIME which can move forward and backward when the
time-of-day changes, CLOCK_MONOTONIC is the elapsed time since some
arbitrary point in the post (the system start-up time for NuttX)
and, hence, is always monotonically increasing. CLOCK_MONOTONIC
is, hence, the more appropriate clock for determining time
differences.
The value of the CLOCK_MONOTONIC clock cannot be set via clock_settime().
config ARCH_HAVE_TIMEKEEPING
bool
default n
config CLOCK_TIMEKEEPING
bool "Support timekeeping algorithms"
default n
depends on EXPERIMENTAL && 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 2017
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 MAX_WDOGPARMS
int "Maximum number of watchdog parameters"
default 4
---help---
Maximum number of parameters that can be passed to a watchdog handler
config PREALLOC_WDOGS
int "Number of pre-allocated watchdog timers"
default 32
---help---
The number of pre-allocated watchdog structures. The system manages
a pool of preallocated watchdog structures to minimize dynamic
allocations. Dynamic allocations will still be made if this pool is
exhausted. You will, however, get better performance and memory
usage if this value is tuned to minimize such allocations.
config WDOG_INTRESERVE
int "Watchdog structures reserved for interrupt handlers"
default 4
---help---
Watchdog structures may be allocated from normal task and also from
interrupt handlers. Interrupt handlers, however, can only use pre-
allocated watchdog timer. So, in order to keep normal task
allocations from exhausting all watchdog structures, a small number
of pre-allocated watchdog timers must be reserved for exclusive use
by interrupt handler. This setting determines that number of
reserved watchdogs.
config PREALLOC_TIMERS
int "Number of pre-allocated POSIX timers"
default 8
---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.
endmenu # Clocks and Timers
menu "Tasks and Scheduling"
config SPINLOCK
bool "Support Spinlocks"
default n
---help---
Enables suppport for spinlocks. Spinlocks are current used only for
SMP suppport.
config SMP
bool "Symmetric Multi-Processing (SMP)"
default n
depends on ARCH_HAVE_MULTICPU
select SPINLOCK
---help---
Enables support for Symmetric Multi-Processing (SMP) on a multi-CPU
platform.
if SMP
config SMP_NCPUS
int "Number of CPUs"
default 4
range 1 32 if DEBUG_FEATURES
range 2 32 if !DEBUG_FEATURES
---help---
This value identifies the number of CPUs supported by the processor
that will be used for SMP.
If CONFIG_DEBUG_FEATURES is enbled, 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_IDLETHREAD_STACKSIZE
int "CPU IDLE stack size"
default 2048
---help---
Each CPU will have its own IDLE task. System initialization occurs
on CPU0 and uses CONFIG_IDLETHREAD_STACKSIZE which will probably be
larger than is generally needed. This setting provides the stack
size for the IDLE task on CPUS 1 through (CONFIG_SMP_NCPUS-1).
endif # SMP
choice
prompt "Initialization Task"
default INIT_ENTRYPOINT if !BUILD_KERNEL
default INIT_FILEPATH if BUILD_KERNEL && !BINFMT_DISABLE
default INIT_NONE if BUILD_KERNEL && BINFMT_DISABLE
config INIT_NONE
bool "None"
config INIT_ENTRYPOINT
bool "Via application entry point"
depends on !BUILD_KERNEL
config INIT_FILEPATH
bool "Via executable file"
depends on !BINFMT_DISABLE
endchoice # Initialization task
if INIT_ENTRYPOINT
config USER_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, USER_ENTRYPOINT defaults to "main".
endif # INIT_ENTRYPOINT
if INIT_FILEPATH
config USER_INITPATH
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, USER_ENTRYPOINT defaults to "main".
config INIT_SYMTAB
string "Symbol table"
default "NULL"
depends on !BUILD_PROTECTED && !BUILD_KERNEL
---help---
The name of othe 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"
depends on !BUILD_PROTECTED && !BUILD_KERNEL
---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.
endif # INIT_FILEPATH
config RR_INTERVAL
int "Round robin timeslice (MSEC)"
default 0
---help---
The round robin timeslice will be set this number of milliseconds;
Round roben scheduling (SCHED_RR) is enabled by setting this
interval to a positive, non-zero value.
config SCHED_SPORADIC
bool "Support sporadic scheduling"
default n
---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---
Spcifies that 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
willl be TASK_NAME_SIZE + 1. The default of 31 then results in
a align-able 32-byte allocation.::
config MAX_TASKS
int "Max number of tasks"
default 32
---help---
The maximum number of simultaneously active tasks. This value must be
a power of two.
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' 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. If this
setting is not defined or if it is defined to be zero then a value
of 2*MAX_TASKS is used.
Note that there cannot be more than MAX_TASKS tasks in total.
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
---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.
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_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
config NPTHREAD_KEYS
int "Maximum number of pthread keys"
default 4
---help---
The number of items of thread-
specific data that can be retained
config PTHREAD_CLEANUP
bool "pthread cleanup stack"
default n
---help---
Select to enable support for pthread exit cleanup stacks. This
enables the interfaces pthread_cleanup_push() and
pthread_cleanup_pop().
config PTHREAD_CLEANUP_STACKSIZE
int "pthread cleanup stack size"
default 1
range 1 32
depends on PTHREAD_CLEANUP
---help---
The maximum number of cleanup actions that may be pushed by
pthread_clean_push(). This setting will increase the size of EVERY
pthread task control block by about n * CONFIG_PTHREAD_CLEANUP_STACKSIZE
where n is the size of a pointer, 2* sizeof(uintptr_t), this would be
8 for a CPU with 32-bit addressing and 4 for a CPU with 16-bit
addressing.
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_CPULOAD
bool "Enable CPU load monitoring"
default n
select SCHED_CPULOAD_EXTCLK if SCHED_TICKLESS
---help---
If this option is selected, the timer interrupt handler will monitor
if the system is IDLE or busy at the time of that the timer interrupt
occurs. This is a very coarse measurement, but over a period of time,
it can very accurately determined the percentage of the time that the
CPU is IDLE.
The statistics collected in this could be used, for example in the
PROCFS file system to provide CPU load measurements when read.
Note that in tickless mode of operation (SCHED_TICKLESS) there is
no system timer interrupt and CPU load measurements will not be
possible unless you provide an alternative clock to driver the
sampling and select SCHED_CPULOAD_EXTCLK.
if SCHED_CPULOAD
config SCHED_CPULOAD_EXTCLK
bool "Use external clock"
default n
---help---
The CPU load measurements are determined by sampling the active
tasks periodically at the occurrence to a timer expiration. By
default, the system clock is used to do that sampling.
There is a serious issue for the accuracy of measurements if the
system clock is used, however. NuttX threads are often started at
the time of the system timer expiration. Others may be stopped at
the time of the system timer expiration (if round-robin time-slicing
is enabled). Such thread behavior occurs synchronously with the
system timer and, hence, is not randomly sampled. As a consequence,
the CPU load attributed to these threads that run synchronously with
they system timer may be grossly in error.
The solution is to use some other clock that runs at a different
rate and has timer expirations that are asynchronous with the
system timer. Then truly accurate load measurements can be
achieved. This option enables use of such an "external" clock. The
implementation of the clock must be provided by platform-specific
logic; that platform-specific logic must call the system function
sched_process_cpuload() at each timer expiration with interrupts
disabled.
if SCHED_CPULOAD_EXTCLK
config SCHED_CPULOAD_TICKSPERSEC
int "External clock rate"
default 100
---help---
If an external clock is used to drive the sampling for the CPU load
calculations, then this value must be provided. This value provides
the rate of the external clock interrupts in units of ticks per
second. The default value of 100 corresponds to a 100Hz clock. NOTE:
that 100Hz is the default frequency of the system time and, hence,
the worst possible choice in most cases.
config CPULOAD_ONESHOT
bool "Use Oneshot timer"
default n
---help---
Use an MCU-specific oneshot timer as the external clock. The
oneshot timer must be configured by board specific logic which must
then call:
void sched_oneshot_extclk(FAR struct oneshot_lowerhalf_s *lower);
To start the CPU load measurement. See include/nuttx/clock.h
NOTE that in this configuration, CONFIG_SCHED_CPULOAD_TICKSPERSEC is
the sample rate that will be accomplished by programming the oneshot
time repeatedly. If CPULOAD_ONESHOT_ENTROPY is also selected, then
the underly frequency driving the oneshote timer must be
significantly faster than CONFIG_SCHED_CPULOAD_TICKSPERSE to permit
precise modulation the sample periods.
config CPULOAD_ONESHOT_ENTROPY
int "Bits of entropy"
default 6
range 0 30
---help---
This is the number of bits of entropy that will be applied. The
oneshot will be set to this interval:
CPULOAD_ONESHOT_NOMINAL - (CPULOAD_ONESHOT_ENTROPY / 2) +
error + nrand(CPULOAD_ONESHOT_ENTROPY)
Where
CPULOAD_ONESHOT_NOMINAL is the nominal sample internval implied
by CONFIG_SCHED_CPULOAD_TICKSPERSEC in units of microseconds.
CPULOAD_ONESHOT_ENTROPY is (1 << CONFIG_CPULOAD_ONESHOT_ENTROPY),
and
'error' is an error value that is retained from interval to
interval so that although individual intervals are randomized,
the average will still be CONFIG_SCHED_CPULOAD_TICKSPERSEC.
This special value of zero disables entropy.
endif # SCHED_CPULOAD_EXTCLK
config SCHED_CPULOAD_TIMECONSTANT
int "CPU load time constant"
default 2
---help---
The accumulated CPU count is divided by two when the accumulated
tick count exceeds this time constant. This time constant is in
units of seconds.
endif # SCHED_CPULOAD
config SCHED_INSTRUMENTATION
bool "System performance monitor hooks"
default n
---help---
Enables instrumentation in scheduler to monitor system performance.
If enabled, then the board-specific logic must provide the following
functions (see include/sched.h):
void sched_note_start(FAR struct tcb_s *tcb);
void sched_note_stop(FAR struct tcb_s *tcb);
void sched_note_suspend(FAR struct tcb_s *tcb);
void sched_note_resume(FAR struct tcb_s *tcb);
If CONFIG_SMP is enabled, then these additional interfaces are
expected:
void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu);
void sched_note_cpu_paused(FAR struct tcb_s *tcb);
void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu);
void sched_note_cpu_resumed(FAR struct tcb_s *tcb);
NOTE: These are internal OS interfaces and are called at at very
critical locations in the OS. There is very little that can be
done in these interfaces. For example, normal devices may not be
used; syslog output cannot be performed.
An option is to use SCHED_INSTRUMENTATION_BUFFER below.
if SCHED_INSTRUMENTATION
config SCHED_INSTRUMENTATION_CPUSET
hex "CPU bit set"
default 0xffff
depends on SMP
---help---
Monitor only CPUs in the bitset. Bit 0=CPU0, Bit1=CPU1, etc.
config SCHED_INSTRUMENTATION_PREEMPTION
bool "Preemption monitor hooks"
default n
---help---
Enables additional hooks for changes to pre-emption state. Board-
specific logic must provide this additional logic.
void sched_note_premption(FAR struct tcb_s *tcb, bool state);
config SCHED_INSTRUMENTATION_CSECTION
bool "Critical section monitor hooks"
default n
---help---
Enables additional hooks for entry and exit from critical sections.
Interrupts are disabled while within a critical section. Board-
specific logic must provide this additional logic.
void sched_note_csection(FAR struct tcb_s *tcb, bool state);
config SCHED_INSTRUMENTATION_SPINLOCKS
bool "Spinlock monitor hooks"
default n
---help---
Enables additional hooks for spinlock state. Board-specific logic
must provide this additional logic.
void sched_note_spinlock(FAR struct tcb_s *tcb, bool state);
void sched_note_spinlocked(FAR struct tcb_s *tcb, bool state);
void sched_note_spinunlock(FAR struct tcb_s *tcb, bool state);
void sched_note_spinabort(FAR struct tcb_s *tcb, bool state);
config SCHED_INSTRUMENTATION_BUFFER
bool "Buffer instrumentation data in memory"
default n
---help---
If this option is selected, then in-memory buffering logic is
enabled to capature scheduler instrumentation data. This has
the advantage that (1) the platform logic does not have to provide
the sched_note_* interaces described for the previous settings.
Instead, the buffering logic catches all of these. It encodes
timestamps the scheduler note and adds the note to an in-memory,
circular buffer. And (2) buffering the scheduler instrumentation
data (versus performing some output operation) minimizes the impact
of the instrumentation on the behavior of the system.
If the in-memory buffer becomes full, then older notes are
overwritten by newer notes. The following interface is provided:
ssize_t sched_note_get(FAR uint8_t *buffer, size_t buflen);
Platform specific information must call this function and dispose
of it quickly so that overwriting of the tail of the circular buffer
does not occur. See include/nuttx/sched_note.h for additional
information.
if SCHED_INSTRUMENTATION_BUFFER
config SCHED_NOTE_BUFSIZE
int "Instrumentation buffer size"
default 2048
---help---
The size of the in-memory, circular instrumentation buffer (in
bytes).
config SCHED_NOTE_GET
int "Callable interface to get instrumentatin data"
default 2048
depends on !SCHED_INSTRUMENTATION_CSECTION && (!SCHED_INSTRUMENTATION_SPINLOCK || !SMP)
---help---
Add support for interfaces to get the size of the next note and also
to extract the next note from the instrumentation buffer:
ssize_t sched_note_get(FAR uint8_t *buffer, size_t buflen);
ssize_t sched_note_size(void);
NOTE: This option is not available if critical sections are being
monitor (nor if spinlocks are being monitored in SMP configuration)
because there would be a logical error in the design in those cases.
That error is that these interfaces call enter_ and leave_critical_section
(and which us spinlocks in SMP mode). That means that each call to
sched_note_get() causes several additional entries to be added from
the note buffer in order to remove one entry.
endif # SCHED_INSTRUMENTATION_BUFFER
endif # SCHED_INSTRUMENTATION
endmenu # Performance Monitoring
menu "Files and I/O"
config DEV_CONSOLE
bool "Enable /dev/console"
default y
---help---
Set if architecture-specific logic provides /dev/console at boot-up
time. Enables stdout, stderr, stdin in the start-up application.
You need this setting if your console device is ready at boot time.
For example, if you are using a serial console, then /dev/console
(aka, /dev/ttyS0) will be available when the application first starts.
You must not select DEV_CONSOLE if you console device comes up later
and is not ready until after the application starts. At this time,
the only console device that behaves this way is a USB serial console.
When the application first starts, the USB is (probably) not yet
connected and /dev/console will not be created until later when the
host connects to the USB console.
config FDCLONE_DISABLE
bool "Disable cloning of file descriptors"
default n
---help---
Disable cloning of all file descriptors by task_create() when a new
ask is started. If set, all files/drivers will appear to be closed
in the new task.
config FDCLONE_STDIO
bool "Disable clone file descriptors without stdio"
default n
---help---
Disable cloning of all but the first three file descriptors (stdin,
stdout, stderr) by task_create() when a new task is started. If set,
all files/drivers will appear to be closed in the new task except
for stdin, stdout, and stderr.
config SDCLONE_DISABLE
bool "Disable cloning of socket descriptors"
default n
---help---
Disable cloning of all socket
descriptors by task_create() when a new task is started. If
set, all sockets will appear to be closed in the new task.
config NFILE_DESCRIPTORS
int "Maximum number of file descriptors per task"
default 16
---help---
The maximum number of file descriptors per task (one for each open)
config NFILE_STREAMS
int "Maximum number of FILE streams"
default 16
---help---
The maximum number of streams that can be fopen'ed
config NAME_MAX
int "Maximum size of a file name"
default 32
---help---
The maximum size of a file name.
endmenu # Files and I/O
menuconfig PRIORITY_INHERITANCE
bool "Enable priority inheritance "
default n
---help---
Set to enable support for priority inheritance on mutexes and semaphores.
When this option is enabled, the initial configuration of all seamphores
and mutexes will be with priority inheritance enabled. That configuration
may not be appropriate in all cases (such as when the semaphore or mutex
is used for signaling). In such cases, priority inheritance be be
disabled for individual semaphores by calling:
int ret = sem_setprotocol(&sem, SEM_PRIO_NONE);
From applications, the functionally equivalent OS internal interface,
nxsem_setrotocol() should be used within the OS
And for individual pthread mutexes by setting the protocol attribute
before initializing the mutex:
int ret = pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_NONE);
if PRIORITY_INHERITANCE
config SEM_PREALLOCHOLDERS
int "Number of pre-allocated holders"
default 16
---help---
This setting is only used if priority inheritance is enabled.
It defines the maximum number of different threads (minus one) that
can take counts on a semaphore with priority inheritance support.
This may be set to zero if priority inheritance is disabled OR if you
are only using semaphores as mutexes (only one holder) OR if no more
than two threads participate using a counting semaphore.
config SEM_NNESTPRIO
int "Maximum number of higher priority threads"
default 16
---help---
If priority inheritance is enabled, then this setting is the
maximum number of higher priority threads (minus 1) than can be
waiting for another thread to release a count on a semaphore.
This value may be set to zero if no more than one thread is
expected to wait for a semaphore.
endif # PRIORITY_INHERITANCE
menu "RTOS hooks"
config BOARD_INITIALIZE
bool "Custom board/driver initialization"
default n
---help---
By default, there are three points in time where you can insert
custom initialization logic:
1) <arch>_boardinitialize(): This function is used only for
initialization of very low-level things like configuration of
GPIO pins, power setting. The OS has not been initialized
at this point, so you cannot allocate memory or initialize
device drivers at this phase.
2) The next level of initialization is performed by a call to
up_initialize() (in arch/<arch>/src/common/up_initialize.c).
The OS has been initialized at this point and it is okay to
initialize drivers in this phase.
3) And, finally, when the user application code starts.
If BOARD_INITIALIZE is selected, then an additional initialization
call will be performed in the boot-up sequence to a function
called board_initialize(). board_initialize() will be
call between phases 2) and 3) above, immediately after
up_initialize() is called. This additional initialization
phase may be used, for example, to initialize board-specific
device drivers.
if BOARD_INITIALIZE
config BOARD_INITTHREAD
bool "Board initialization thread"
default n
---help---