2019-11-01 13:45:29 +01:00
|
|
|
# Kernel configuration options
|
2015-05-20 18:40:39 +02:00
|
|
|
|
|
|
|
# Copyright (c) 2014-2015 Wind River Systems, Inc.
|
2017-01-19 02:01:01 +01:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2015-03-11 19:44:14 +01:00
|
|
|
|
|
|
|
menu "General Kernel Options"
|
2017-01-30 06:53:17 +01:00
|
|
|
|
2018-09-17 13:58:09 +02:00
|
|
|
module = KERNEL
|
|
|
|
module-str = kernel
|
|
|
|
source "subsys/logging/Kconfig.template.log_config"
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
config MULTITHREADING
|
2021-05-19 17:45:25 +02:00
|
|
|
bool "Multi-threading" if ARCH_HAS_SINGLE_THREAD_SUPPORT
|
2016-12-17 23:36:20 +01:00
|
|
|
default y
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
If disabled, only the main thread is available, so a main() function
|
|
|
|
must be provided. Interrupts are available. Kernel objects will most
|
|
|
|
probably not behave as expected, especially with regards to pending,
|
|
|
|
since the main thread cannot pend, it being the only thread in the
|
|
|
|
system.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2019-03-15 23:01:51 +01:00
|
|
|
Many drivers and subsystems will not work with this option
|
|
|
|
set to 'n'; disable only when you REALLY know what you are
|
|
|
|
doing.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config NUM_COOP_PRIORITIES
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Number of coop priorities" if MULTITHREADING
|
2016-12-17 23:36:20 +01:00
|
|
|
default 1 if !MULTITHREADING
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 10:57:47 +02:00
|
|
|
default 16
|
2016-12-21 21:38:54 +01:00
|
|
|
range 0 128
|
2016-12-17 23:36:20 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Number of cooperative priorities configured in the system. Gives access
|
|
|
|
to priorities:
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
K_PRIO_COOP(0) to K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
|
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
or seen another way, priorities:
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
-CONFIG_NUM_COOP_PRIORITIES to -1
|
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
This can be set to zero to disable cooperative scheduling. Cooperative
|
|
|
|
threads always preempt preemptible threads.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
The total number of priorities is
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
NUM_COOP_PRIORITIES + NUM_PREEMPT_PRIORITIES + 1
|
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
The extra one is for the idle thread, which must run at the lowest
|
|
|
|
priority, and be the only thread at that priority.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config NUM_PREEMPT_PRIORITIES
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Number of preemptible priorities" if MULTITHREADING
|
2016-12-17 23:36:20 +01:00
|
|
|
default 0 if !MULTITHREADING
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 10:57:47 +02:00
|
|
|
default 15
|
2016-12-21 21:38:54 +01:00
|
|
|
range 0 128
|
2016-12-17 23:36:20 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Number of preemptible priorities available in the system. Gives access
|
|
|
|
to priorities 0 to CONFIG_NUM_PREEMPT_PRIORITIES - 1.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
This can be set to 0 to disable preemptible scheduling.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
The total number of priorities is
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
NUM_COOP_PRIORITIES + NUM_PREEMPT_PRIORITIES + 1
|
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
The extra one is for the idle thread, which must run at the lowest
|
|
|
|
priority, and be the only thread at that priority.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config MAIN_THREAD_PRIORITY
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Priority of initialization/main thread"
|
2017-01-15 00:50:22 +01:00
|
|
|
default -2 if !PREEMPT_ENABLED
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 10:57:47 +02:00
|
|
|
default 0
|
2016-12-17 23:36:20 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Priority at which the initialization thread runs, including the start
|
|
|
|
of the main() function. main() can then change its priority if desired.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config COOP_ENABLED
|
2018-06-22 02:25:43 +02:00
|
|
|
def_bool (NUM_COOP_PRIORITIES != 0)
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config PREEMPT_ENABLED
|
2018-06-22 02:25:43 +02:00
|
|
|
def_bool (NUM_PREEMPT_PRIORITIES != 0)
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config PRIORITY_CEILING
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Priority inheritance ceiling"
|
2021-05-14 00:46:43 +02:00
|
|
|
default -127
|
|
|
|
help
|
|
|
|
This defines the minimum priority value (i.e. the logically
|
|
|
|
highest priority) that a thread will acquire as part of
|
|
|
|
k_mutex priority inheritance.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2018-05-11 23:02:42 +02:00
|
|
|
config NUM_METAIRQ_PRIORITIES
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Number of very-high priority 'preemptor' threads"
|
2018-05-11 23:02:42 +02:00
|
|
|
default 0
|
|
|
|
help
|
2019-11-01 10:24:07 +01:00
|
|
|
This defines a set of priorities at the (numerically) lowest
|
|
|
|
end of the range which have "meta-irq" behavior. Runnable
|
|
|
|
threads at these priorities will always be scheduled before
|
|
|
|
threads at lower priorities, EVEN IF those threads are
|
|
|
|
otherwise cooperative and/or have taken a scheduler lock.
|
|
|
|
Making such a thread runnable in any way thus has the effect
|
|
|
|
of "interrupting" the current task and running the meta-irq
|
|
|
|
thread synchronously, like an exception or system call. The
|
|
|
|
intent is to use these priorities to implement "interrupt
|
|
|
|
bottom half" or "tasklet" behavior, allowing driver
|
|
|
|
subsystems to return from interrupt context but be guaranteed
|
|
|
|
that user code will not be executed (on the current CPU)
|
|
|
|
until the remaining work is finished. As this breaks the
|
|
|
|
"promise" of non-preemptibility granted by the current API
|
|
|
|
for cooperative threads, this tool probably shouldn't be used
|
|
|
|
from application code.
|
2018-05-11 23:02:42 +02:00
|
|
|
|
2018-05-15 20:06:25 +02:00
|
|
|
config SCHED_DEADLINE
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Earliest-deadline-first scheduling"
|
2018-05-15 20:06:25 +02:00
|
|
|
help
|
|
|
|
This enables a simple "earliest deadline first" scheduling
|
|
|
|
mode where threads can set "deadline" deltas measured in
|
|
|
|
k_cycle_get_32() units. Priority decisions within (!!) a
|
|
|
|
single priority will choose the next expiring deadline and
|
|
|
|
not simply the least recently added thread.
|
|
|
|
|
2019-01-31 00:00:42 +01:00
|
|
|
config SCHED_CPU_MASK
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "CPU mask affinity/pinning API"
|
2019-01-31 00:00:42 +01:00
|
|
|
depends on SCHED_DUMB
|
|
|
|
help
|
2019-12-19 00:10:09 +01:00
|
|
|
When true, the application will have access to the
|
|
|
|
k_thread_cpu_mask_*() APIs which control per-CPU affinity masks in
|
|
|
|
SMP mode, allowing applications to pin threads to specific CPUs or
|
|
|
|
disallow threads from running on given CPUs. Note that as currently
|
|
|
|
implemented, this involves an inherent O(N) scaling in the number of
|
|
|
|
idle-but-runnable threads, and thus works only with the DUMB
|
|
|
|
scheduler (as SCALABLE and MULTIQ would see no benefit).
|
|
|
|
|
|
|
|
Note that this setting does not technically depend on SMP and is
|
|
|
|
implemented without it for testing purposes, but for obvious reasons
|
|
|
|
makes sense as an application API only where there is more than one
|
|
|
|
CPU. With one CPU, it's just a higher overhead version of
|
|
|
|
k_thread_start/stop().
|
2018-05-15 20:06:25 +02:00
|
|
|
|
2021-09-24 19:57:39 +02:00
|
|
|
config SCHED_CPU_MASK_PIN_ONLY
|
|
|
|
bool "CPU mask variant with single-CPU pinning only"
|
|
|
|
depends on SMP && SCHED_CPU_MASK
|
|
|
|
help
|
|
|
|
When true, enables a variant of SCHED_CPU_MASK where only
|
|
|
|
one CPU may be specified for every thread. Effectively, all
|
|
|
|
threads have a single "assigned" CPU and they will never be
|
|
|
|
scheduled symmetrically. In general this is not helpful,
|
|
|
|
but some applications have a carefully designed threading
|
|
|
|
architecture and want to make their own decisions about how
|
|
|
|
to assign work to CPUs. In that circumstance, some moderate
|
|
|
|
optimizations can be made (e.g. having a separate run queue
|
2022-05-02 23:31:04 +02:00
|
|
|
per CPU, keeping the list length shorter). When selected,
|
|
|
|
the CPU mask becomes an immutable thread attribute. It can
|
|
|
|
only be modified before a thread is started. Most
|
2021-09-24 19:57:39 +02:00
|
|
|
applications don't want this.
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
config MAIN_STACK_SIZE
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Size of stack for initialization and main thread"
|
2018-08-31 11:43:36 +02:00
|
|
|
default 2048 if COVERAGE_GCOV
|
2022-12-09 07:37:46 +01:00
|
|
|
default 512 if ZTEST && !(RISCV || X86 || ARM)
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 10:57:47 +02:00
|
|
|
default 1024
|
2016-12-17 23:36:20 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
When the initialization is complete, the thread executing it then
|
|
|
|
executes the main() routine, so as to reuse the stack used by the
|
|
|
|
initialization, which would be wasted RAM otherwise.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
After initialization is complete, the thread runs main().
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config IDLE_STACK_SIZE
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Size of stack for idle thread"
|
2019-04-04 11:50:30 +02:00
|
|
|
default 2048 if COVERAGE_GCOV
|
2017-01-31 22:50:42 +01:00
|
|
|
default 1024 if XTENSA
|
2019-07-17 19:17:05 +02:00
|
|
|
default 512 if RISCV
|
2020-09-02 18:20:38 +02:00
|
|
|
default 384 if DYNAMIC_OBJECTS
|
2020-11-19 21:39:16 +01:00
|
|
|
default 320 if ARC || (ARM && CPU_HAS_FPU) || (X86 && MMU)
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 10:57:47 +02:00
|
|
|
default 256
|
2016-12-17 23:36:20 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Depending on the work that the idle task must do, most likely due to
|
|
|
|
power management but possibly to other features like system event
|
|
|
|
logging (e.g. logging when the system goes to sleep), the idle thread
|
|
|
|
may need more stack space than the default value.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config ISR_STACK_SIZE
|
2018-08-14 16:19:20 +02:00
|
|
|
int "ISR and initialization stack size (in bytes)"
|
2016-12-17 23:36:20 +01:00
|
|
|
default 2048
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the size of the stack used by interrupt
|
|
|
|
service routines (ISRs), and during kernel initialization.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2017-03-27 16:52:42 +02:00
|
|
|
config THREAD_STACK_INFO
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Thread stack info"
|
2017-03-27 16:52:42 +02:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option allows each thread to store the thread stack info into
|
|
|
|
the k_thread data structure.
|
2017-03-27 16:52:42 +02:00
|
|
|
|
2019-11-01 14:00:09 +01:00
|
|
|
config THREAD_CUSTOM_DATA
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Thread custom data"
|
2016-12-17 23:36:20 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option allows each thread to store 32 bits of custom data,
|
|
|
|
which can be accessed using the k_thread_custom_data_xxx() APIs.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2018-08-17 00:42:28 +02:00
|
|
|
config THREAD_USERSPACE_LOCAL_DATA
|
|
|
|
bool
|
|
|
|
depends on USERSPACE
|
2023-10-02 20:18:07 +02:00
|
|
|
default y if ERRNO && !ERRNO_IN_TLS && !LIBC_ERRNO
|
2018-08-17 00:42:28 +02:00
|
|
|
|
2022-06-28 05:43:32 +02:00
|
|
|
config DYNAMIC_THREAD
|
|
|
|
bool "Support for dynamic threads [EXPERIMENTAL]"
|
|
|
|
select EXPERIMENTAL
|
|
|
|
depends on THREAD_STACK_INFO
|
|
|
|
select DYNAMIC_OBJECTS if USERSPACE
|
|
|
|
help
|
|
|
|
Enable support for dynamic threads and stacks.
|
|
|
|
|
|
|
|
if DYNAMIC_THREAD
|
|
|
|
|
|
|
|
config DYNAMIC_THREAD_STACK_SIZE
|
|
|
|
int "Size of each pre-allocated thread stack"
|
|
|
|
default 1024 if !64BIT
|
|
|
|
default 2048 if 64BIT
|
|
|
|
help
|
|
|
|
Default stack size (in bytes) for dynamic threads.
|
|
|
|
|
|
|
|
config DYNAMIC_THREAD_ALLOC
|
|
|
|
bool "Support heap-allocated thread objects and stacks"
|
|
|
|
help
|
|
|
|
Select this option to enable allocating thread object and
|
|
|
|
thread stacks from the system heap.
|
|
|
|
|
|
|
|
Only use this type of allocation in situations
|
|
|
|
where malloc is permitted.
|
|
|
|
|
|
|
|
config DYNAMIC_THREAD_POOL_SIZE
|
|
|
|
int "Number of statically pre-allocated threads"
|
|
|
|
default 0
|
|
|
|
range 0 8192
|
|
|
|
help
|
|
|
|
Pre-allocate a fixed number of thread objects and
|
|
|
|
stacks at build time.
|
|
|
|
|
|
|
|
This type of "dynamic" stack is usually suitable in
|
|
|
|
situations where malloc is not permitted.
|
|
|
|
|
|
|
|
choice DYNAMIC_THREAD_PREFER
|
|
|
|
prompt "Preferred dynamic thread allocator"
|
|
|
|
default DYNAMIC_THREAD_PREFER_POOL
|
|
|
|
help
|
|
|
|
If both CONFIG_DYNAMIC_THREAD_ALLOC=y and
|
|
|
|
CONFIG_DYNAMIC_THREAD_POOL_SIZE > 0, then the user may
|
|
|
|
specify the order in which allocation is attmpted.
|
|
|
|
|
|
|
|
config DYNAMIC_THREAD_PREFER_ALLOC
|
|
|
|
bool "Prefer heap-based allocation"
|
|
|
|
depends on DYNAMIC_THREAD_ALLOC
|
|
|
|
help
|
|
|
|
Select this option to attempt a heap-based allocation
|
|
|
|
prior to any pool-based allocation.
|
|
|
|
|
|
|
|
config DYNAMIC_THREAD_PREFER_POOL
|
|
|
|
bool "Prefer pool-based allocation"
|
|
|
|
help
|
|
|
|
Select this option to attempt a pool-based allocation
|
|
|
|
prior to any heap-based allocation.
|
|
|
|
|
|
|
|
endchoice # DYNAMIC_THREAD_PREFER
|
|
|
|
|
|
|
|
endif # DYNAMIC_THREADS
|
|
|
|
|
2022-04-07 00:53:39 +02:00
|
|
|
config LIBC_ERRNO
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
Use external libc errno, not the internal one. This eliminates any
|
|
|
|
locally allocated errno storage and usage.
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
config ERRNO
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Errno support"
|
2016-12-17 23:36:20 +01:00
|
|
|
default y
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Enable per-thread errno in the kernel. Application and library code must
|
|
|
|
include errno.h provided by the C library (libc) to use the errno
|
|
|
|
symbol. The C library must access the per-thread errno via the
|
2020-10-05 23:54:45 +02:00
|
|
|
z_errno() symbol.
|
|
|
|
|
|
|
|
config ERRNO_IN_TLS
|
|
|
|
bool "Store errno in thread local storage (TLS)"
|
2022-04-07 00:53:39 +02:00
|
|
|
depends on ERRNO && THREAD_LOCAL_STORAGE && !LIBC_ERRNO
|
2020-10-05 23:54:45 +02:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
Use thread local storage to store errno instead of storing it in
|
|
|
|
the kernel thread struct. This avoids a syscall if userspace is enabled.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2018-06-27 20:20:50 +02:00
|
|
|
choice SCHED_ALGORITHM
|
|
|
|
prompt "Scheduler priority queue algorithm"
|
|
|
|
default SCHED_DUMB
|
2018-05-03 23:51:49 +02:00
|
|
|
help
|
2018-06-27 20:20:50 +02:00
|
|
|
The kernel can be built with with several choices for the
|
|
|
|
ready queue implementation, offering different choices between
|
|
|
|
code size, constant factor runtime overhead and performance
|
|
|
|
scaling when many threads are added.
|
2018-05-03 23:51:49 +02:00
|
|
|
|
|
|
|
config SCHED_DUMB
|
2018-06-27 20:20:50 +02:00
|
|
|
bool "Simple linked-list ready queue"
|
2018-05-03 23:51:49 +02:00
|
|
|
help
|
|
|
|
When selected, the scheduler ready queue will be implemented
|
|
|
|
as a simple unordered list, with very fast constant time
|
|
|
|
performance for single threads and very low code size.
|
|
|
|
Choose this on systems with constrained code size that will
|
|
|
|
never see more than a small number (3, maybe) of runnable
|
|
|
|
threads in the queue at any given time. On most platforms
|
|
|
|
(that are not otherwise using the red/black tree) this
|
|
|
|
results in a savings of ~2k of code size.
|
|
|
|
|
2018-06-27 20:20:50 +02:00
|
|
|
config SCHED_SCALABLE
|
2018-06-28 19:38:14 +02:00
|
|
|
bool "Red/black tree ready queue"
|
|
|
|
help
|
|
|
|
When selected, the scheduler ready queue will be implemented
|
|
|
|
as a red/black tree. This has rather slower constant-time
|
|
|
|
insertion and removal overhead, and on most platforms (that
|
2018-08-07 23:03:09 +02:00
|
|
|
are not otherwise using the rbtree somewhere) requires an
|
2018-06-28 19:38:14 +02:00
|
|
|
extra ~2kb of code. But the resulting behavior will scale
|
|
|
|
cleanly and quickly into the many thousands of threads. Use
|
|
|
|
this on platforms where you may have many threads (very
|
|
|
|
roughly: more than 20 or so) marked as runnable at a given
|
|
|
|
time. Most applications don't want this.
|
|
|
|
|
|
|
|
config SCHED_MULTIQ
|
|
|
|
bool "Traditional multi-queue ready queue"
|
|
|
|
depends on !SCHED_DEADLINE
|
|
|
|
help
|
|
|
|
When selected, the scheduler ready queue will be implemented
|
|
|
|
as the classic/textbook array of lists, one per priority
|
|
|
|
(max 32 priorities). This corresponds to the scheduler
|
|
|
|
algorithm used in Zephyr versions prior to 1.12. It incurs
|
|
|
|
only a tiny code size overhead vs. the "dumb" scheduler and
|
|
|
|
runs in O(1) time in almost all circumstances with very low
|
|
|
|
constant factor. But it requires a fairly large RAM budget
|
|
|
|
to store those list heads, and the limited features make it
|
|
|
|
incompatible with features like deadline scheduling that
|
|
|
|
need to sort threads more finely, and SMP affinity which
|
|
|
|
need to traverse the list of threads. Typical applications
|
|
|
|
with small numbers of runnable threads probably want the
|
|
|
|
DUMB scheduler.
|
2018-06-27 20:20:50 +02:00
|
|
|
|
|
|
|
endchoice # SCHED_ALGORITHM
|
|
|
|
|
|
|
|
choice WAITQ_ALGORITHM
|
2018-06-28 19:38:14 +02:00
|
|
|
prompt "Wait queue priority algorithm"
|
|
|
|
default WAITQ_DUMB
|
|
|
|
help
|
|
|
|
The wait_q abstraction used in IPC primitives to pend
|
|
|
|
threads for later wakeup shares the same backend data
|
|
|
|
structure choices as the scheduler, and can use the same
|
|
|
|
options.
|
2018-06-27 20:20:50 +02:00
|
|
|
|
|
|
|
config WAITQ_SCALABLE
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Use scalable wait_q implementation"
|
2018-06-27 20:20:50 +02:00
|
|
|
help
|
|
|
|
When selected, the wait_q will be implemented with a
|
|
|
|
balanced tree. Choose this if you expect to have many
|
|
|
|
threads waiting on individual primitives. There is a ~2kb
|
|
|
|
code size increase over WAITQ_DUMB (which may be shared with
|
|
|
|
SCHED_SCALABLE) if the rbtree is not used elsewhere in the
|
|
|
|
application, and pend/unpend operations on "small" queues
|
|
|
|
will be somewhat slower (though this is not generally a
|
|
|
|
performance path).
|
|
|
|
|
|
|
|
config WAITQ_DUMB
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Simple linked-list wait_q"
|
2018-06-27 20:20:50 +02:00
|
|
|
help
|
|
|
|
When selected, the wait_q will be implemented with a
|
|
|
|
doubly-linked list. Choose this if you expect to have only
|
|
|
|
a few threads blocked on any single IPC primitive.
|
|
|
|
|
|
|
|
endchoice # WAITQ_ALGORITHM
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
menu "Kernel Debugging and Metrics"
|
2018-02-26 04:18:17 +01:00
|
|
|
|
|
|
|
config INIT_STACKS
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Initialize stack areas"
|
2018-02-26 04:18:17 +01:00
|
|
|
help
|
|
|
|
This option instructs the kernel to initialize stack areas with a
|
|
|
|
known value (0xaa) before they are first used, so that the high
|
|
|
|
water mark can be easily determined. This applies to the stack areas
|
2018-09-25 09:48:15 +02:00
|
|
|
for threads, as well as to the interrupt stack.
|
2018-02-26 04:18:17 +01:00
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
config BOOT_BANNER
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Boot banner"
|
2018-01-06 20:29:47 +01:00
|
|
|
default y
|
2016-12-17 23:36:20 +01:00
|
|
|
select PRINTK
|
|
|
|
select EARLY_CONSOLE
|
|
|
|
help
|
2018-09-26 09:46:23 +02:00
|
|
|
This option outputs a banner to the console device during boot up.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2023-07-10 22:13:42 +02:00
|
|
|
config BOOT_BANNER_STRING
|
|
|
|
string "Boot banner string"
|
|
|
|
depends on BOOT_BANNER
|
|
|
|
default "Booting Zephyr OS build"
|
|
|
|
help
|
|
|
|
Use this option to set the boot banner.
|
|
|
|
|
2017-06-21 02:01:09 +02:00
|
|
|
config BOOT_DELAY
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Boot delay in milliseconds"
|
2022-10-22 10:17:00 +02:00
|
|
|
depends on MULTITHREADING
|
2017-06-21 02:01:09 +02:00
|
|
|
default 0
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option delays bootup for the specified amount of
|
|
|
|
milliseconds. This is used to allow serial ports to get ready
|
|
|
|
before starting to print information on them during boot, as
|
|
|
|
some systems might boot to fast for a receiving endpoint to
|
|
|
|
detect the new USB serial bus, enumerate it and get ready to
|
|
|
|
receive before it actually gets data. A similar effect can be
|
|
|
|
achieved by waiting for DCD on the serial port--however, not
|
|
|
|
all serial ports have DCD.
|
2017-06-21 02:01:09 +02:00
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
config THREAD_MONITOR
|
2021-03-22 22:31:33 +01:00
|
|
|
bool "Thread monitoring"
|
2016-12-17 23:36:20 +01:00
|
|
|
help
|
|
|
|
This option instructs the kernel to maintain a list of all threads
|
|
|
|
(excluding those that have not yet started or have already
|
|
|
|
terminated).
|
2018-03-03 09:31:05 +01:00
|
|
|
|
|
|
|
config THREAD_NAME
|
2021-03-22 22:31:33 +01:00
|
|
|
bool "Thread name"
|
2018-03-03 09:31:05 +01:00
|
|
|
help
|
|
|
|
This option allows to set a name for a thread.
|
2019-06-25 17:54:37 +02:00
|
|
|
|
|
|
|
config THREAD_MAX_NAME_LEN
|
|
|
|
int "Max length of a thread name"
|
|
|
|
default 32
|
2021-05-13 15:46:28 +02:00
|
|
|
default 64 if ZTEST
|
2019-06-25 17:54:37 +02:00
|
|
|
range 8 128
|
|
|
|
depends on THREAD_NAME
|
|
|
|
help
|
|
|
|
Thread names get stored in the k_thread struct. Indicate the max
|
|
|
|
name length, including the terminating NULL byte. Reduce this value
|
|
|
|
to conserve memory.
|
2020-08-27 22:54:14 +02:00
|
|
|
|
|
|
|
config INSTRUMENT_THREAD_SWITCHING
|
|
|
|
bool
|
|
|
|
|
2020-10-14 21:17:12 +02:00
|
|
|
menuconfig THREAD_RUNTIME_STATS
|
2020-08-27 22:54:14 +02:00
|
|
|
bool "Thread runtime statistics"
|
|
|
|
help
|
|
|
|
Gather thread runtime statistics.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
- Thread total execution cycles
|
2021-09-28 19:01:06 +02:00
|
|
|
- System total execution cycles
|
2020-08-27 22:54:14 +02:00
|
|
|
|
2020-10-14 21:17:12 +02:00
|
|
|
if THREAD_RUNTIME_STATS
|
|
|
|
|
|
|
|
config THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS
|
|
|
|
bool "Use timing functions to gather statistics"
|
2021-03-31 22:40:01 +02:00
|
|
|
select TIMING_FUNCTIONS_NEED_AT_BOOT
|
2020-10-14 21:17:12 +02:00
|
|
|
help
|
|
|
|
Use timing functions to gather thread runtime statistics.
|
|
|
|
|
|
|
|
Note that timing functions may use a different timer than
|
|
|
|
the default timer for OS timekeeping.
|
|
|
|
|
2021-09-28 19:01:06 +02:00
|
|
|
config SCHED_THREAD_USAGE
|
|
|
|
bool "Collect thread runtime usage"
|
|
|
|
default y
|
|
|
|
select INSTRUMENT_THREAD_SWITCHING if !USE_SWITCH
|
|
|
|
help
|
|
|
|
Collect thread runtime info at context switch time
|
|
|
|
|
2021-12-15 03:31:10 +01:00
|
|
|
config SCHED_THREAD_USAGE_ANALYSIS
|
|
|
|
bool "Analyze the collected thread runtime usage statistics"
|
|
|
|
default n
|
|
|
|
depends on SCHED_THREAD_USAGE
|
|
|
|
select INSTRUMENT_THREAD_SWITCHING if !USE_SWITCH
|
|
|
|
help
|
|
|
|
Collect additional timing information related to thread scheduling
|
|
|
|
for analysis purposes. This includes the total time that a thread
|
|
|
|
has been scheduled, the longest time for which it was scheduled and
|
|
|
|
others.
|
|
|
|
|
2021-09-28 19:01:06 +02:00
|
|
|
config SCHED_THREAD_USAGE_ALL
|
|
|
|
bool "Collect total system runtime usage"
|
|
|
|
default y if SCHED_THREAD_USAGE
|
|
|
|
depends on SCHED_THREAD_USAGE
|
|
|
|
help
|
|
|
|
Maintain a sum of all non-idle thread cycle usage.
|
|
|
|
|
2021-12-15 15:46:52 +01:00
|
|
|
config SCHED_THREAD_USAGE_AUTO_ENABLE
|
|
|
|
bool "Automatically enable runtime usage statistics"
|
|
|
|
default y
|
|
|
|
depends on SCHED_THREAD_USAGE
|
|
|
|
help
|
|
|
|
When set, this option automatically enables the gathering of both
|
|
|
|
the thread and CPU usage statistics.
|
|
|
|
|
2020-10-14 21:17:12 +02:00
|
|
|
endif # THREAD_RUNTIME_STATS
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
endmenu
|
|
|
|
|
2023-05-09 17:01:33 +02:00
|
|
|
menuconfig OBJ_CORE
|
|
|
|
bool "Object core framework"
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
This option enables the object core framework. This will link
|
|
|
|
participating kernel objects and their respective types together
|
|
|
|
in a way that allows them to both have common information stored
|
|
|
|
together and for that information to be easily retrieved by
|
|
|
|
automated means.
|
|
|
|
|
|
|
|
if OBJ_CORE
|
kernel: Integrate object cores into kernel
Integrates object cores into the following kernel structures
sys_mem_blocks, k_mem_slab
_cpu, z_kernel
k_thread, k_timer
k_condvar, k_event, k_mutex, k_sem
k_mbox, k_msgq, k_pipe, k_fifo, k_lifo, k_stack
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-05-11 20:06:46 +02:00
|
|
|
config OBJ_CORE_CONDVAR
|
|
|
|
bool "Integrate condition variables into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates condition variables into the
|
|
|
|
object core framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_EVENT
|
|
|
|
bool "Integrate events into object core framework"
|
|
|
|
default y if EVENTS
|
|
|
|
help
|
|
|
|
When enabled, this option integrate kernel events into the object
|
|
|
|
core framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_FIFO
|
|
|
|
bool "Integrate FIFOs into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates FIFOs into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_LIFO
|
|
|
|
bool "Integrate LIFOs into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates LIFOs into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_MAILBOX
|
|
|
|
bool "Integrate mailboxes into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates mailboxes into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_MEM_SLAB
|
|
|
|
bool "Integrate memory slabs into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates memory slabs into the object
|
|
|
|
core framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_MUTEX
|
|
|
|
bool "Integrate mutexes into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates mutexes into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_MSGQ
|
|
|
|
bool "Integrate message queues into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates message queues into the object
|
|
|
|
core framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_SEM
|
|
|
|
bool "Integrate semaphores into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates semaphores into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_PIPE
|
|
|
|
bool "Integrate pipe into object core framework"
|
|
|
|
default y if PIPES
|
|
|
|
help
|
|
|
|
When enabled, this option integrates pipes into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_SEM
|
|
|
|
bool "Integrate semaphores into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates semaphores into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_STACK
|
|
|
|
bool "Integrate stacks into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates stacks into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_THREAD
|
|
|
|
bool "Integrate threads into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates threads into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_TIMER
|
|
|
|
bool "Integrate timers into object core framework"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates timers into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_SYSTEM
|
|
|
|
bool
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled, this option integrates the internal CPU and kernel
|
|
|
|
system objects into the object core framework. As these are internal
|
|
|
|
structures, this option is hidden by default and only available to
|
|
|
|
advanced users.
|
|
|
|
|
2023-06-09 20:23:25 +02:00
|
|
|
menuconfig OBJ_CORE_STATS
|
|
|
|
bool "Object core statistics"
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
This option integrates statistics gathering into the object core
|
|
|
|
framework.
|
|
|
|
|
|
|
|
if OBJ_CORE_STATS
|
2023-06-01 18:16:40 +02:00
|
|
|
config OBJ_CORE_STATS_MEM_SLAB
|
|
|
|
bool "Object core statistics for memory slabs"
|
|
|
|
default y if OBJ_CORE_MEM_SLAB
|
|
|
|
help
|
|
|
|
When enabled, this allows memory slab statistics to be integrated
|
|
|
|
into kernel objects.
|
|
|
|
|
|
|
|
config OBJ_CORE_STATS_THREAD
|
|
|
|
bool "Object core statistics for threads"
|
|
|
|
default y if OBJ_CORE_THREAD
|
|
|
|
select THREAD_RUNTIME_STATS
|
|
|
|
help
|
|
|
|
When enabled, this integrates thread runtime statistics into the
|
|
|
|
object core statistics framework.
|
|
|
|
|
|
|
|
config OBJ_CORE_STATS_SYSTEM
|
|
|
|
bool "Object core statistics for system level objects"
|
|
|
|
default y if OBJ_CORE_SYSTEM
|
|
|
|
select SCHED_THREAD_USAGE_ALL
|
|
|
|
help
|
|
|
|
When enabled, this integrates thread runtime statistics at the
|
|
|
|
CPU and system level into the object core statistics framework.
|
|
|
|
|
2023-06-09 20:23:25 +02:00
|
|
|
endif # OBJ_CORE_STATS
|
|
|
|
|
2023-05-09 17:01:33 +02:00
|
|
|
endif # OBJ_CORE
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
menu "Work Queue Options"
|
|
|
|
config SYSTEM_WORKQUEUE_STACK_SIZE
|
|
|
|
int "System workqueue stack size"
|
2023-08-09 17:29:19 +02:00
|
|
|
default 4096 if COVERAGE_GCOV
|
2016-12-17 23:36:20 +01:00
|
|
|
default 1024
|
|
|
|
|
|
|
|
config SYSTEM_WORKQUEUE_PRIORITY
|
|
|
|
int "System workqueue priority"
|
2017-01-15 00:50:22 +01:00
|
|
|
default -2 if COOP_ENABLED && !PREEMPT_ENABLED
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 10:57:47 +02:00
|
|
|
default 0 if !COOP_ENABLED
|
|
|
|
default -1
|
2018-06-07 15:58:11 +02:00
|
|
|
help
|
|
|
|
By default, system work queue priority is the lowest cooperative
|
|
|
|
priority. This means that any work handler, once started, won't
|
|
|
|
be preempted by any other thread until finished.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2020-10-28 17:24:05 +01:00
|
|
|
config SYSTEM_WORKQUEUE_NO_YIELD
|
|
|
|
bool "Select whether system work queue yields"
|
|
|
|
help
|
|
|
|
By default, the system work queue yields between each work item, to
|
|
|
|
prevent other threads from being starved. Selecting this removes
|
|
|
|
this yield, which may be useful if the work queue thread is
|
|
|
|
cooperative and a sequence of work items is expected to complete
|
|
|
|
without yielding.
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
endmenu
|
|
|
|
|
2023-05-01 14:33:31 +02:00
|
|
|
menu "Barrier Operations"
|
|
|
|
config BARRIER_OPERATIONS_BUILTIN
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
Use the compiler builtin functions for barrier operations. This is
|
|
|
|
the preferred method. However, support for all arches in GCC is
|
|
|
|
incomplete.
|
|
|
|
|
|
|
|
config BARRIER_OPERATIONS_ARCH
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
Use when there isn't support for compiler built-ins, but you have
|
|
|
|
written optimized assembly code under arch/ which implements these.
|
|
|
|
endmenu
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
menu "Atomic Operations"
|
|
|
|
config ATOMIC_OPERATIONS_BUILTIN
|
|
|
|
bool
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Use the compiler builtin functions for atomic operations. This is
|
|
|
|
the preferred method. However, support for all arches in GCC is
|
|
|
|
incomplete.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2021-02-14 20:51:46 +01:00
|
|
|
config ATOMIC_OPERATIONS_ARCH
|
2016-12-17 23:36:20 +01:00
|
|
|
bool
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Use when there isn't support for compiler built-ins, but you have
|
|
|
|
written optimized assembly code under arch/ which implements these.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config ATOMIC_OPERATIONS_C
|
|
|
|
bool
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Use atomic operations routines that are implemented entirely
|
|
|
|
in C by locking interrupts. Selected by architectures which either
|
|
|
|
do not have support for atomic operations in their instruction
|
|
|
|
set, or haven't been implemented yet during bring-up, and also
|
|
|
|
the compiler does not have support for the atomic __sync_* builtins.
|
2016-12-17 23:36:20 +01:00
|
|
|
endmenu
|
|
|
|
|
|
|
|
menu "Timer API Options"
|
|
|
|
|
|
|
|
config TIMESLICING
|
|
|
|
bool "Thread time slicing"
|
|
|
|
default y
|
|
|
|
depends on SYS_CLOCK_EXISTS && (NUM_PREEMPT_PRIORITIES != 0)
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option enables time slicing between preemptible threads of
|
|
|
|
equal priority.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config TIMESLICE_SIZE
|
|
|
|
int "Time slice size (in ms)"
|
|
|
|
default 0
|
|
|
|
range 0 2147483647
|
|
|
|
depends on TIMESLICING
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the maximum amount of time a thread can execute
|
|
|
|
before other threads of equal priority are given an opportunity to run.
|
|
|
|
A time slice size of zero means "no limit" (i.e. an infinitely large
|
|
|
|
time slice).
|
2016-12-17 23:36:20 +01:00
|
|
|
|
|
|
|
config TIMESLICE_PRIORITY
|
|
|
|
int "Time slicing thread priority ceiling"
|
|
|
|
default 0
|
|
|
|
range 0 NUM_PREEMPT_PRIORITIES
|
|
|
|
depends on TIMESLICING
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the thread priority level at which time slicing
|
|
|
|
takes effect; threads having a higher priority than this ceiling are
|
|
|
|
not subject to time slicing.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2021-12-01 03:26:26 +01:00
|
|
|
config TIMESLICE_PER_THREAD
|
|
|
|
bool "Support per-thread timeslice values"
|
|
|
|
depends on TIMESLICING
|
|
|
|
help
|
|
|
|
When set, this enables an API for setting timeslice values on
|
|
|
|
a per-thread basis, with an application callback invoked when
|
|
|
|
a thread reaches the end of its timeslice.
|
|
|
|
|
2017-01-30 00:57:45 +01:00
|
|
|
config POLL
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Async I/O Framework"
|
2017-01-30 00:57:45 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Asynchronous notification framework. Enable the k_poll() and
|
2018-11-02 20:35:30 +01:00
|
|
|
k_poll_signal_raise() APIs. The former can wait on multiple events
|
2017-12-13 16:08:21 +01:00
|
|
|
concurrently, which can be either directly triggered or triggered by
|
2020-07-08 20:14:25 +02:00
|
|
|
the availability of some kernel objects (semaphores and FIFOs).
|
2017-01-30 00:57:45 +01:00
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
endmenu
|
|
|
|
|
|
|
|
menu "Other Kernel Object Options"
|
2017-01-07 14:43:32 +01:00
|
|
|
|
2020-09-11 14:27:55 +02:00
|
|
|
config MEM_SLAB_TRACE_MAX_UTILIZATION
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Getting maximum slab utilization"
|
2020-09-11 14:27:55 +02:00
|
|
|
help
|
|
|
|
This adds variable to the k_mem_slab structure to hold
|
|
|
|
maximum utilization of the slab.
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
config NUM_MBOX_ASYNC_MSGS
|
|
|
|
int "Maximum number of in-flight asynchronous mailbox messages"
|
|
|
|
default 10
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the total number of asynchronous mailbox
|
|
|
|
messages that can exist simultaneously, across all mailboxes
|
|
|
|
in the system.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
Setting this option to 0 disables support for asynchronous
|
|
|
|
mailbox messages.
|
2016-12-17 23:36:20 +01:00
|
|
|
|
2021-09-20 20:14:32 +02:00
|
|
|
config EVENTS
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Event objects"
|
2021-09-20 20:14:32 +02:00
|
|
|
help
|
|
|
|
This option enables event objects. Threads may wait on event
|
|
|
|
objects for specific events, but both threads and ISRs may deliver
|
|
|
|
events to event objects.
|
|
|
|
|
|
|
|
Note that setting this option slightly increases the size of the
|
|
|
|
thread structure.
|
|
|
|
|
2022-07-08 17:27:09 +02:00
|
|
|
config PIPES
|
|
|
|
bool "Pipe objects"
|
|
|
|
help
|
|
|
|
This option enables kernel pipes. A pipe is a kernel object that
|
|
|
|
allows a thread to send a byte stream to another thread. Pipes can
|
|
|
|
be used to synchronously transfer chunks of data in whole or in part.
|
|
|
|
|
2020-09-18 23:12:51 +02:00
|
|
|
config KERNEL_MEM_POOL
|
|
|
|
bool "Use Kernel Memory Pool"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enable the use of kernel memory pool.
|
|
|
|
|
|
|
|
Say y if unsure.
|
|
|
|
|
|
|
|
if KERNEL_MEM_POOL
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
config HEAP_MEM_POOL_SIZE
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Heap memory pool size (in bytes)"
|
2018-03-19 16:15:27 +01:00
|
|
|
default 0 if !POSIX_MQUEUE
|
|
|
|
default 1024 if POSIX_MQUEUE
|
2016-12-17 23:36:20 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the size of the heap memory pool used when
|
2020-07-23 21:13:09 +02:00
|
|
|
dynamically allocating memory using k_malloc(). The maximum size of
|
|
|
|
the memory pool is only limited to available memory. A size of zero
|
|
|
|
means that no heap memory pool is defined.
|
2019-03-11 17:28:23 +01:00
|
|
|
|
2020-09-18 23:12:51 +02:00
|
|
|
endif # KERNEL_MEM_POOL
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
endmenu
|
|
|
|
|
|
|
|
config ARCH_HAS_CUSTOM_SWAP_TO_MAIN
|
|
|
|
bool
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
It's possible that an architecture port cannot use _Swap() to swap to
|
|
|
|
the _main() thread, but instead must do something custom. It must
|
|
|
|
enable this option in that case.
|
2015-03-11 19:44:14 +01:00
|
|
|
|
2019-01-04 21:47:21 +01:00
|
|
|
config SWAP_NONATOMIC
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
On some architectures, the _Swap() primitive cannot be made
|
|
|
|
atomic with respect to the irq_lock being released. That
|
|
|
|
is, interrupts may be received between the entry to _Swap
|
|
|
|
and the completion of the context switch. There are a
|
|
|
|
handful of workaround cases in the kernel that need to be
|
|
|
|
enabled when this is true. Currently, this only happens on
|
|
|
|
ARM when the PendSV exception priority sits below that of
|
|
|
|
Zephyr-handled interrupts.
|
|
|
|
|
2017-12-22 00:23:34 +01:00
|
|
|
config ARCH_HAS_CUSTOM_BUSY_WAIT
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
It's possible that an architecture port cannot or does not want to use
|
|
|
|
the provided k_busy_wait(), but instead must do something custom. It must
|
|
|
|
enable this option in that case.
|
|
|
|
|
2015-03-11 19:44:14 +01:00
|
|
|
config SYS_CLOCK_TICKS_PER_SEC
|
2018-08-14 16:19:20 +02:00
|
|
|
int "System tick frequency (in ticks/second)"
|
2019-06-11 20:18:20 +02:00
|
|
|
default 100 if QEMU_TARGET || SOC_POSIX
|
2021-02-03 18:24:15 +01:00
|
|
|
default 10000 if TICKLESS_KERNEL
|
2015-03-11 19:44:14 +01:00
|
|
|
default 100
|
|
|
|
help
|
2019-06-11 20:18:20 +02:00
|
|
|
This option specifies the nominal frequency of the system clock in Hz.
|
2015-03-11 19:44:14 +01:00
|
|
|
|
2020-09-18 09:45:48 +02:00
|
|
|
For asynchronous timekeeping, the kernel defines a "ticks" concept. A
|
|
|
|
"tick" is the internal count in which the kernel does all its internal
|
2021-04-30 15:58:20 +02:00
|
|
|
uptime and timeout bookkeeping. Interrupts are expected to be delivered
|
2020-09-18 09:45:48 +02:00
|
|
|
on tick boundaries to the extent practical, and no fractional ticks
|
|
|
|
are tracked.
|
|
|
|
|
|
|
|
The choice of tick rate is configurable by this option. Also the number
|
|
|
|
of cycles per tick should be chosen so that 1 millisecond is exactly
|
|
|
|
represented by an integral number of ticks. Defaults on most hardware
|
|
|
|
platforms (ones that support setting arbitrary interrupt timeouts) are
|
|
|
|
expected to be in the range of 10 kHz, with software emulation
|
|
|
|
platforms and legacy drivers using a more traditional 100 Hz value.
|
kernel: optimize ms-to-ticks for certain tick frequencies
Some tick frequencies lend themselves to optimized conversions from ms
to ticks and vice-versa.
- 1000Hz which does not need any conversion
- 500Hz, 250Hz, 125Hz where the division/multiplication are a straight
shift since they are power-of-two factors of 1000.
In addition, some more generally used values are made to use optimized
conversion equations rather than the generic one that uses 64-bit math,
and often results in calling compiler intrinsics.
These values are: 100Hz, 50Hz, 25Hz, 20Hz, 10Hz, 1Hz (the last one used
in some testing).
Avoiding the 64-bit math intrisics has the additional benefit, in
addition to increased performance, of using a significant lower amount
of stack space: 52 bytes on ARM Cortex-M and 80 bytes on x86.
Change-Id: I080eb338a2637d6b1c6838c119af1a9fa37fe869
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-20 20:39:08 +01:00
|
|
|
|
2018-09-19 20:08:19 +02:00
|
|
|
Note that when available and enabled, in "tickless" mode
|
|
|
|
this config variable specifies the minimum available timing
|
|
|
|
granularity, not necessarily the number or frequency of
|
|
|
|
interrupts delivered to the kernel.
|
|
|
|
|
2019-05-09 19:48:40 +02:00
|
|
|
A value of 0 completely disables timer support in the kernel.
|
|
|
|
|
2015-03-11 19:44:14 +01:00
|
|
|
config SYS_CLOCK_HW_CYCLES_PER_SEC
|
2015-07-22 22:22:25 +02:00
|
|
|
int "System clock's h/w timer frequency"
|
2015-03-11 19:44:14 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the frequency of the hardware timer used for the
|
2018-07-16 09:43:32 +02:00
|
|
|
system clock (in Hz). This option is set by the SOC's or board's Kconfig file
|
2017-12-13 16:08:21 +01:00
|
|
|
and the user should generally avoid modifying it via the menu configuration.
|
2015-03-11 19:44:14 +01:00
|
|
|
|
2016-05-25 01:17:13 +02:00
|
|
|
config SYS_CLOCK_EXISTS
|
2019-06-11 20:18:20 +02:00
|
|
|
bool "System clock exists and is enabled"
|
|
|
|
default y
|
2015-05-05 17:12:02 +02:00
|
|
|
help
|
2022-08-01 23:52:50 +02:00
|
|
|
This option specifies that the kernel has timer support.
|
|
|
|
|
2019-06-11 20:18:20 +02:00
|
|
|
Some device configurations can eliminate significant code if
|
|
|
|
this is disabled. Obviously timeout-related APIs will not
|
2022-08-01 23:52:50 +02:00
|
|
|
work when disabled.
|
2015-05-05 17:12:02 +02:00
|
|
|
|
2020-03-06 06:14:02 +01:00
|
|
|
config TIMEOUT_64BIT
|
2020-05-05 00:57:31 +02:00
|
|
|
bool "Store kernel timeouts in 64 bit precision"
|
2020-03-06 06:14:02 +01:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
When this option is true, the k_ticks_t values passed to
|
|
|
|
kernel APIs will be a 64 bit quantity, allowing the use of
|
|
|
|
larger values (and higher precision tick rates) without fear
|
2020-03-09 17:35:35 +01:00
|
|
|
of overflowing the 32 bit word. This feature also gates the
|
|
|
|
availability of absolute timeout values (which require the
|
|
|
|
extra precision).
|
2020-03-06 06:14:02 +01:00
|
|
|
|
2022-01-12 10:35:38 +01:00
|
|
|
config SYS_CLOCK_MAX_TIMEOUT_DAYS
|
|
|
|
int "Max timeout (in days) used in conversions"
|
|
|
|
default 365
|
|
|
|
help
|
|
|
|
Value is used in the time conversion static inline function to determine
|
|
|
|
at compile time which algorithm to use. One algorithm is faster, takes
|
|
|
|
less code but may overflow if multiplication of source and target
|
|
|
|
frequency exceeds 64 bits. Second algorithm prevents that. Faster
|
|
|
|
algorithm is selected for conversion if maximum timeout represented in
|
|
|
|
source frequency domain multiplied by target frequency fits in 64 bits.
|
|
|
|
|
2023-07-19 20:45:19 +02:00
|
|
|
config BUSYWAIT_CPU_LOOPS_PER_USEC
|
|
|
|
int "Number of CPU loops per microsecond for crude busy looping"
|
|
|
|
depends on !SYS_CLOCK_EXISTS && !ARCH_HAS_CUSTOM_BUSY_WAIT
|
|
|
|
default 500
|
|
|
|
help
|
|
|
|
Calibration for crude CPU based busy loop duration. The default
|
|
|
|
is assuming 1 GHz CPU and 2 cycles per loop. Reality is certainly
|
|
|
|
much worse but all we want here is a ball-park figure that ought
|
|
|
|
to be good enough for the purpose of being able to configure out
|
|
|
|
system timer support. If accuracy is very important then
|
|
|
|
implementing arch_busy_wait() should be considered.
|
|
|
|
|
2016-05-25 01:17:13 +02:00
|
|
|
config XIP
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Execute in place"
|
2015-03-11 19:44:14 +01:00
|
|
|
help
|
|
|
|
This option allows the kernel to operate with its text and read-only
|
2016-08-18 01:33:08 +02:00
|
|
|
sections residing in ROM (or similar read-only memory). Not all boards
|
2015-03-11 19:44:14 +01:00
|
|
|
support this option so it must be used with care; you must also
|
|
|
|
supply a linker command file when building your image. Enabling this
|
|
|
|
option increases both the code and data footprint of the image.
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
menu "Initialization Priorities"
|
2016-12-20 00:41:17 +01:00
|
|
|
|
2016-09-09 17:20:23 +02:00
|
|
|
config KERNEL_INIT_PRIORITY_OBJECTS
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Kernel objects initialization priority"
|
2016-09-09 17:20:23 +02:00
|
|
|
default 30
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Kernel objects use this priority for initialization. This
|
|
|
|
priority needs to be higher than minimal default initialization
|
|
|
|
priority.
|
2016-09-09 17:20:23 +02:00
|
|
|
|
2015-10-26 20:56:02 +01:00
|
|
|
config KERNEL_INIT_PRIORITY_DEFAULT
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Default init priority"
|
2016-03-28 23:05:33 +02:00
|
|
|
default 40
|
2015-10-26 20:56:02 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Default minimal init priority for each init level.
|
2015-10-26 20:56:02 +01:00
|
|
|
|
|
|
|
config KERNEL_INIT_PRIORITY_DEVICE
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Default init priority for device drivers"
|
2016-03-28 23:05:33 +02:00
|
|
|
default 50
|
2015-10-26 20:56:02 +01:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Device driver, that depends on common components, such as
|
|
|
|
interrupt controller, but does not depend on other devices,
|
|
|
|
uses this init priority.
|
2015-09-29 16:08:58 +02:00
|
|
|
|
2016-10-07 19:03:51 +02:00
|
|
|
config APPLICATION_INIT_PRIORITY
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Default init priority for application level drivers"
|
2016-10-07 19:03:51 +02:00
|
|
|
default 90
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This priority level is for end-user drivers such as sensors and display
|
|
|
|
which have no inward dependencies.
|
2017-07-24 23:59:55 +02:00
|
|
|
|
2018-02-26 04:18:17 +01:00
|
|
|
|
|
|
|
endmenu
|
|
|
|
|
2015-03-11 19:44:14 +01:00
|
|
|
menu "Security Options"
|
|
|
|
|
|
|
|
config STACK_CANARIES
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Compiler stack canaries"
|
2019-11-12 23:02:05 +01:00
|
|
|
depends on ENTROPY_GENERATOR || TEST_RANDOM_GENERATOR
|
2023-10-04 18:17:27 +02:00
|
|
|
select NEED_LIBC_MEM_PARTITION if !STACK_CANARIES_TLS
|
2015-03-11 19:44:14 +01:00
|
|
|
help
|
2019-01-21 14:02:55 +01:00
|
|
|
This option enables compiler stack canaries.
|
2015-03-11 19:44:14 +01:00
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
If stack canaries are supported by the compiler, it will emit
|
|
|
|
extra code that inserts a canary value into the stack frame when
|
|
|
|
a function is entered and validates this value upon exit.
|
|
|
|
Stack corruption (such as that caused by buffer overflow) results
|
|
|
|
in a fatal error condition for the running entity.
|
|
|
|
Enabling this option can result in a significant increase
|
|
|
|
in footprint and an associated decrease in performance.
|
2015-03-11 19:44:14 +01:00
|
|
|
|
2019-01-21 14:02:55 +01:00
|
|
|
If stack canaries are not supported by the compiler an error
|
|
|
|
will occur at build time.
|
2017-10-18 02:01:48 +02:00
|
|
|
|
2023-08-02 00:07:57 +02:00
|
|
|
if STACK_CANARIES
|
|
|
|
|
|
|
|
config STACK_CANARIES_TLS
|
|
|
|
bool "Stack canaries using thread local storage"
|
|
|
|
depends on THREAD_LOCAL_STORAGE
|
|
|
|
depends on ARCH_HAS_STACK_CANARIES_TLS
|
|
|
|
help
|
|
|
|
This option enables compiler stack canaries on TLS.
|
|
|
|
|
|
|
|
Stack canaries will leave in the thread local storage and
|
|
|
|
each thread will have its own canary. This makes harder
|
|
|
|
to predict the canary location and value.
|
|
|
|
|
|
|
|
When enabled this causes an additional performance penalty
|
|
|
|
during thread creations because it needs a new random value
|
|
|
|
per thread.
|
|
|
|
endif
|
|
|
|
|
2017-10-18 02:01:48 +02:00
|
|
|
config EXECUTE_XOR_WRITE
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "W^X for memory partitions"
|
2017-10-18 02:01:48 +02:00
|
|
|
depends on USERSPACE
|
|
|
|
depends on ARCH_HAS_EXECUTABLE_PAGE_BIT
|
|
|
|
default y
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
When enabled, will enforce that a writable page isn't executable
|
|
|
|
and vice versa. This might not be acceptable in all scenarios,
|
|
|
|
so this option is given for those unafraid of shooting themselves
|
|
|
|
in the foot.
|
2017-10-18 02:01:48 +02:00
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
If unsure, say Y.
|
2017-10-18 02:01:48 +02:00
|
|
|
|
2018-03-02 16:54:13 +01:00
|
|
|
config STACK_POINTER_RANDOM
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Initial stack pointer randomization bounds"
|
2018-03-02 16:54:13 +01:00
|
|
|
depends on !STACK_GROWS_UP
|
2020-02-26 00:32:39 +01:00
|
|
|
depends on MULTITHREADING
|
2019-04-30 19:45:48 +02:00
|
|
|
depends on TEST_RANDOM_GENERATOR || ENTROPY_HAS_DRIVER
|
2018-03-02 16:54:13 +01:00
|
|
|
default 0
|
|
|
|
help
|
|
|
|
This option performs a limited form of Address Space Layout
|
|
|
|
Randomization by offsetting some random value to a thread's
|
|
|
|
initial stack pointer upon creation. This hinders some types of
|
|
|
|
security attacks by making the location of any given stack frame
|
|
|
|
non-deterministic.
|
|
|
|
|
|
|
|
This feature can waste up to the specified size in bytes the stack
|
|
|
|
region, which is carved out of the total size of the stack region.
|
|
|
|
A reasonable minimum value would be around 100 bytes if this can
|
|
|
|
be spared.
|
|
|
|
|
|
|
|
This is currently only implemented for systems whose stack pointers
|
|
|
|
grow towards lower memory addresses.
|
|
|
|
|
2019-03-08 00:56:55 +01:00
|
|
|
config BOUNDS_CHECK_BYPASS_MITIGATION
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Bounds check bypass mitigations for speculative execution"
|
2019-03-08 00:56:55 +01:00
|
|
|
depends on USERSPACE
|
|
|
|
help
|
|
|
|
Untrusted parameters from user mode may be used in system calls to
|
|
|
|
index arrays during speculative execution, also known as the Spectre
|
|
|
|
V1 vulnerability. When enabled, various macros defined in
|
|
|
|
misc/speculation.h will insert fence instructions or other appropriate
|
|
|
|
mitigations after bounds checking any array index parameters passed
|
|
|
|
in from untrusted sources (user mode threads). When disabled, these
|
|
|
|
macros do nothing.
|
2015-03-11 19:44:14 +01:00
|
|
|
endmenu
|
|
|
|
|
2017-07-07 14:29:30 +02:00
|
|
|
config MAX_DOMAIN_PARTITIONS
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Maximum number of partitions per memory domain"
|
2017-07-07 14:29:30 +02:00
|
|
|
default 16
|
|
|
|
range 0 255
|
|
|
|
depends on USERSPACE
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
Configure the maximum number of partitions per memory domain.
|
2017-07-07 14:29:30 +02:00
|
|
|
|
2020-08-19 22:11:47 +02:00
|
|
|
config ARCH_MEM_DOMAIN_DATA
|
|
|
|
bool
|
|
|
|
depends on USERSPACE
|
|
|
|
help
|
|
|
|
This hidden option is selected by the target architecture if
|
|
|
|
architecture-specific data is needed on a per memory domain basis.
|
|
|
|
If so, the architecture defines a 'struct arch_mem_domain' which is
|
|
|
|
embedded within every struct k_mem_domain. The architecture
|
|
|
|
must also define the arch_mem_domain_init() function to set this up
|
|
|
|
when a memory domain is created.
|
|
|
|
|
|
|
|
Typical uses might be a set of page tables for that memory domain.
|
|
|
|
|
2020-08-26 02:02:38 +02:00
|
|
|
config ARCH_MEM_DOMAIN_SYNCHRONOUS_API
|
|
|
|
bool
|
|
|
|
depends on USERSPACE
|
|
|
|
help
|
|
|
|
This hidden option is selected by the target architecture if
|
|
|
|
modifying a memory domain's partitions at runtime, or changing
|
|
|
|
a memory domain's thread membership requires synchronous calls
|
|
|
|
into the architecture layer.
|
|
|
|
|
|
|
|
If enabled, the architecture layer must implement the following
|
|
|
|
APIs:
|
|
|
|
|
|
|
|
arch_mem_domain_thread_add
|
|
|
|
arch_mem_domain_thread_remove
|
|
|
|
arch_mem_domain_partition_remove
|
|
|
|
arch_mem_domain_partition_add
|
|
|
|
|
|
|
|
It's important to note that although supervisor threads can be
|
|
|
|
members of memory domains, they have no implications on supervisor
|
|
|
|
thread access to memory. Memory domain APIs may only be invoked from
|
|
|
|
supervisor mode.
|
|
|
|
|
|
|
|
For these reasons, on uniprocessor systems unless memory access
|
|
|
|
policy is managed in separate software constructions like page
|
|
|
|
tables, these APIs don't need to be implemented as the underlying
|
|
|
|
memory management hardware will be reprogrammed on context switch
|
|
|
|
anyway.
|
|
|
|
|
2018-02-26 04:12:35 +01:00
|
|
|
menu "SMP Options"
|
2018-12-27 18:20:56 +01:00
|
|
|
|
2022-03-15 15:00:18 +01:00
|
|
|
config SMP
|
|
|
|
bool "Symmetric multiprocessing support"
|
|
|
|
depends on USE_SWITCH
|
2023-02-22 03:26:12 +01:00
|
|
|
depends on !ATOMIC_OPERATIONS_C
|
2022-03-15 15:00:18 +01:00
|
|
|
help
|
|
|
|
When true, kernel will be built with SMP support, allowing
|
|
|
|
more than one CPU to schedule Zephyr tasks at a time.
|
|
|
|
|
2017-12-09 17:37:20 +01:00
|
|
|
config USE_SWITCH
|
2019-11-07 21:43:29 +01:00
|
|
|
bool "Use new-style _arch_switch instead of arch_swap"
|
2018-12-27 18:20:56 +01:00
|
|
|
depends on USE_SWITCH_SUPPORTED
|
2017-12-09 17:37:20 +01:00
|
|
|
help
|
2018-02-26 04:12:35 +01:00
|
|
|
The _arch_switch() API is a lower level context switching
|
2019-11-07 21:43:29 +01:00
|
|
|
primitive than the original arch_swap mechanism. It is required
|
2018-02-26 04:12:35 +01:00
|
|
|
for an SMP-aware scheduler, or if the architecture does not
|
2019-11-07 21:43:29 +01:00
|
|
|
provide arch_swap. In uniprocess situations where the
|
2018-02-26 04:12:35 +01:00
|
|
|
architecture provides both, _arch_switch incurs more somewhat
|
|
|
|
overhead and may be slower.
|
2017-12-09 17:37:20 +01:00
|
|
|
|
2018-12-27 18:20:56 +01:00
|
|
|
config USE_SWITCH_SUPPORTED
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
Indicates whether _arch_switch() API is supported by the
|
|
|
|
currently enabled platform. This option should be selected by
|
|
|
|
platforms that implement it.
|
|
|
|
|
2021-04-01 13:46:57 +02:00
|
|
|
config SMP_BOOT_DELAY
|
|
|
|
bool "Delay booting secondary cores"
|
|
|
|
depends on SMP
|
|
|
|
help
|
|
|
|
By default Zephyr will boot all available CPUs during start up.
|
|
|
|
Select this option to skip this and allow architecture code boot
|
|
|
|
secondary CPUs at a later time.
|
|
|
|
|
2018-01-25 23:03:02 +01:00
|
|
|
config MP_NUM_CPUS
|
2023-09-28 23:04:43 +02:00
|
|
|
int "Number of CPUs/cores [DEPRECATED]"
|
2022-10-20 00:51:30 +02:00
|
|
|
default MP_MAX_NUM_CPUS
|
2023-09-19 23:20:36 +02:00
|
|
|
range 1 12
|
2018-01-25 23:03:02 +01:00
|
|
|
help
|
2023-09-28 23:04:43 +02:00
|
|
|
This is deprecated, please use MP_MAX_NUM_CPUS instead.
|
2018-02-26 04:12:35 +01:00
|
|
|
|
2022-10-12 16:37:54 +02:00
|
|
|
config MP_MAX_NUM_CPUS
|
|
|
|
int "Maximum number of CPUs/cores"
|
2022-10-20 00:51:30 +02:00
|
|
|
default 1
|
2023-09-19 23:20:36 +02:00
|
|
|
range 1 12
|
2022-10-12 16:37:54 +02:00
|
|
|
help
|
|
|
|
Maximum number of multiprocessing-capable cores available to the
|
|
|
|
multicpu API and SMP features.
|
|
|
|
|
2019-02-20 01:03:39 +01:00
|
|
|
config SCHED_IPI_SUPPORTED
|
2020-01-17 23:14:54 +01:00
|
|
|
bool
|
2019-02-20 01:03:39 +01:00
|
|
|
help
|
|
|
|
True if the architecture supports a call to
|
2019-11-07 21:43:29 +01:00
|
|
|
arch_sched_ipi() to broadcast an interrupt that will call
|
2019-02-20 01:03:39 +01:00
|
|
|
z_sched_ipi() on other CPUs in the system. Required for
|
|
|
|
k_thread_abort() to operate with reasonable latency
|
|
|
|
(otherwise we might have to wait for the other thread to
|
|
|
|
take an interrupt, which can be arbitrarily far in the
|
|
|
|
future).
|
|
|
|
|
2020-05-28 05:29:50 +02:00
|
|
|
config TRACE_SCHED_IPI
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Test IPI"
|
2020-05-28 05:29:50 +02:00
|
|
|
help
|
|
|
|
When true, it will add a hook into z_sched_ipi(), in order
|
|
|
|
to check if schedule IPI has called or not, for testing
|
|
|
|
purpose.
|
|
|
|
depends on SCHED_IPI_SUPPORTED
|
2023-07-20 21:34:23 +02:00
|
|
|
depends on MP_MAX_NUM_CPUS>1
|
2020-05-28 05:29:50 +02:00
|
|
|
|
kernel: Add cache coherence management framework
Zephyr SMP kernels need to be able to run on architectures with
incoherent caches. Naive implementation of synchronization on such
architectures requires extensive cache flushing (e.g. flush+invalidate
everything on every spin lock operation, flush on every unlock!) and
is a performance problem.
Instead, many of these systems will have access to separate "coherent"
(usually uncached) and "incoherent" regions of memory. Where this is
available, place all writable data sections by default into the
coherent region. An "__incoherent" attribute flag is defined for data
regions that are known to be CPU-local and which should use the cache.
By default, this is used for stack memory.
Stack memory will be incoherent by default, as by definition it is
local to its current thread. This requires special cache management
on context switch, so an arch API has been added for that.
Also, when enabled, add assertions to strategic places to ensure that
shared kernel data is indeed coherent. We check thread objects, the
_kernel struct, waitq's, timeouts and spinlocks. In practice almost
all kernel synchronization is built on top of these structures, and
any shared data structs will contain at least one of them.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-13 17:34:04 +02:00
|
|
|
config KERNEL_COHERENCE
|
|
|
|
bool "Place all shared data into coherent memory"
|
2020-12-07 20:28:53 +01:00
|
|
|
depends on ARCH_HAS_COHERENCE
|
2023-07-20 21:34:23 +02:00
|
|
|
default y if SMP && MP_MAX_NUM_CPUS > 1
|
kernel: Add cache coherence management framework
Zephyr SMP kernels need to be able to run on architectures with
incoherent caches. Naive implementation of synchronization on such
architectures requires extensive cache flushing (e.g. flush+invalidate
everything on every spin lock operation, flush on every unlock!) and
is a performance problem.
Instead, many of these systems will have access to separate "coherent"
(usually uncached) and "incoherent" regions of memory. Where this is
available, place all writable data sections by default into the
coherent region. An "__incoherent" attribute flag is defined for data
regions that are known to be CPU-local and which should use the cache.
By default, this is used for stack memory.
Stack memory will be incoherent by default, as by definition it is
local to its current thread. This requires special cache management
on context switch, so an arch API has been added for that.
Also, when enabled, add assertions to strategic places to ensure that
shared kernel data is indeed coherent. We check thread objects, the
_kernel struct, waitq's, timeouts and spinlocks. In practice almost
all kernel synchronization is built on top of these structures, and
any shared data structs will contain at least one of them.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-13 17:34:04 +02:00
|
|
|
select THREAD_STACK_INFO
|
|
|
|
help
|
|
|
|
When available and selected, the kernel will build in a mode
|
|
|
|
where all shared data is placed in multiprocessor-coherent
|
|
|
|
(generally "uncached") memory. Thread stacks will remain
|
|
|
|
cached, as will application memory declared with
|
|
|
|
__incoherent. This is intended for Zephyr SMP kernels
|
|
|
|
running on cache-incoherent architectures only. Note that
|
|
|
|
when this is selected, there is an implicit API change that
|
|
|
|
assumes cache coherence to any memory passed to the kernel.
|
|
|
|
Code that creates kernel data structures in uncached regions
|
|
|
|
may fail strangely. Some assertions exist to catch these
|
|
|
|
mistakes, but not all circumstances can be tested.
|
|
|
|
|
2018-02-26 04:12:35 +01:00
|
|
|
endmenu
|
2018-01-25 23:03:02 +01:00
|
|
|
|
2018-10-01 20:13:55 +02:00
|
|
|
config TICKLESS_KERNEL
|
|
|
|
bool "Tickless kernel"
|
2018-10-12 15:58:21 +02:00
|
|
|
default y if TICKLESS_CAPABLE
|
2021-01-06 21:14:45 +01:00
|
|
|
depends on TICKLESS_CAPABLE
|
2018-10-01 20:13:55 +02:00
|
|
|
help
|
|
|
|
This option enables a fully event driven kernel. Periodic system
|
2018-12-27 19:09:09 +01:00
|
|
|
clock interrupt generation would be stopped at all times.
|
2018-10-01 20:13:55 +02:00
|
|
|
|
2020-10-27 18:50:10 +01:00
|
|
|
config TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
|
|
|
|
bool
|
2022-05-15 07:37:00 +02:00
|
|
|
default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" || "$(ZEPHYR_TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE)" = "y"
|
2020-10-27 18:50:10 +01:00
|
|
|
help
|
|
|
|
Hidden option to signal that toolchain supports generating code
|
|
|
|
with thread local storage.
|
|
|
|
|
2020-09-28 20:03:52 +02:00
|
|
|
config THREAD_LOCAL_STORAGE
|
|
|
|
bool "Thread Local Storage (TLS)"
|
2020-10-27 18:50:10 +01:00
|
|
|
depends on ARCH_HAS_THREAD_LOCAL_STORAGE && TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
|
2020-09-29 21:16:01 +02:00
|
|
|
select NEED_LIBC_MEM_PARTITION if (CPU_CORTEX_M && USERSPACE)
|
2020-09-28 20:03:52 +02:00
|
|
|
help
|
|
|
|
This option enables thread local storage (TLS) support in kernel.
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
endmenu
|
2021-12-06 23:41:18 +01:00
|
|
|
|
2022-01-06 02:19:53 +01:00
|
|
|
menu "Device Options"
|
|
|
|
|
2023-06-14 14:30:41 +02:00
|
|
|
config DEVICE_DEPS
|
|
|
|
bool "Store device dependencies"
|
|
|
|
help
|
|
|
|
When enabled, device dependencies will be stored so that they can be
|
|
|
|
queried at runtime. Device dependencies are typically inferred from
|
|
|
|
devicetree. Enabling this option will increase ROM usage (or RAM if
|
|
|
|
dynamic device dependencies are enabled).
|
|
|
|
|
2023-06-14 12:57:29 +02:00
|
|
|
config DEVICE_DEPS_DYNAMIC
|
2023-06-14 17:04:52 +02:00
|
|
|
bool "Dynamic device dependencies"
|
2023-06-14 14:30:41 +02:00
|
|
|
depends on DEVICE_DEPS
|
2022-01-06 02:19:53 +01:00
|
|
|
help
|
2023-06-14 17:04:52 +02:00
|
|
|
Option that makes it possible to manipulate device dependencies at
|
2022-01-06 02:19:53 +01:00
|
|
|
runtime.
|
|
|
|
|
|
|
|
endmenu
|
|
|
|
|
2021-12-06 23:41:18 +01:00
|
|
|
rsource "Kconfig.vm"
|