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
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Multi-threading"
|
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
|
|
|
Each priority requires an extra 8 bytes of RAM. Each set of 32 extra
|
|
|
|
total priorities require an extra 4 bytes and add one possible
|
|
|
|
iteration to loops that search for the next thread to run.
|
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
|
|
|
Each priority requires an extra 8 bytes of RAM. Each set of 32 extra
|
|
|
|
total priorities require an extra 4 bytes and add one possible
|
|
|
|
iteration to loops that search for the next thread to run.
|
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"
|
2016-12-17 23:36:20 +01:00
|
|
|
default 0
|
|
|
|
|
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
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Enable 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
|
|
|
|
bool "Enable CPU mask affinity/pinning API"
|
|
|
|
depends on SCHED_DUMB
|
|
|
|
help
|
|
|
|
When true, the app will have access to the
|
|
|
|
z_thread_*_cpu_mask() APIs which control per-CPU affinity
|
|
|
|
masks in SMP mode, allowing apps 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
|
|
|
|
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
|
2019-07-30 05:47:42 +02:00
|
|
|
default 512 if ZTEST && !(RISCV || X86)
|
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
|
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 320 if ARC || (ARM && CPU_HAS_FPU)
|
|
|
|
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
|
|
|
|
|
|
|
|
config THREAD_USERSPACE_LOCAL_DATA_ARCH_DEFER_SETUP
|
|
|
|
bool
|
|
|
|
depends on THREAD_USERSPACE_LOCAL_DATA
|
2019-03-08 11:08:16 +01:00
|
|
|
default y if ARC || ARM
|
2018-08-17 00:42:28 +02:00
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
config ERRNO
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Enable errno support"
|
2016-12-17 23:36:20 +01:00
|
|
|
default y
|
2018-08-17 00:42:28 +02:00
|
|
|
select THREAD_USERSPACE_LOCAL_DATA if USERSPACE
|
2016-12-17 23:36:20 +01:00
|
|
|
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
|
|
|
|
_get_errno() symbol.
|
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 KERNEL_DEBUG
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Kernel debugging"
|
2016-12-17 23:36:20 +01:00
|
|
|
select INIT_STACKS
|
|
|
|
help
|
|
|
|
Enable kernel debugging.
|
|
|
|
|
|
|
|
Note that debugging the kernel internals can be very verbose.
|
|
|
|
|
|
|
|
config BOOT_BANNER
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Boot banner"
|
2018-01-06 20:29:47 +01:00
|
|
|
default y
|
2017-01-11 15:05:20 +01:00
|
|
|
depends on CONSOLE_HAS_DRIVER
|
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
|
|
|
|
2017-06-21 02:01:09 +02:00
|
|
|
config BOOT_DELAY
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Boot delay in milliseconds"
|
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
|
|
|
|
2017-05-03 09:41:51 +02:00
|
|
|
config EXECUTION_BENCHMARKING
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Timing metrics"
|
2017-05-03 09:41:51 +02:00
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option enables the tracking of various times inside the kernel
|
|
|
|
the exact set of metrics being tracked is board-dependent.
|
|
|
|
All timing measurements are enabled for X86 and ARM based architectures.
|
2019-02-11 10:16:34 +01:00
|
|
|
In other architectures only a subset is enabled.
|
2017-05-03 09:41:51 +02:00
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
config THREAD_MONITOR
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Thread monitoring [EXPERIMENTAL]"
|
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
|
|
|
|
bool "Thread name [EXPERIMENTAL]"
|
|
|
|
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
|
|
|
|
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.
|
2016-12-17 23:36:20 +01:00
|
|
|
endmenu
|
|
|
|
|
|
|
|
menu "Work Queue Options"
|
|
|
|
config SYSTEM_WORKQUEUE_STACK_SIZE
|
|
|
|
int "System workqueue stack size"
|
2019-05-01 23:11:25 +02:00
|
|
|
default 4096 if COVERAGE
|
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
|
|
|
|
|
|
|
config OFFLOAD_WORKQUEUE_STACK_SIZE
|
|
|
|
int "Workqueue stack size for thread offload requests"
|
2019-05-01 23:11:25 +02:00
|
|
|
default 4096 if COVERAGE
|
2016-12-17 23:36:20 +01:00
|
|
|
default 1024
|
|
|
|
|
|
|
|
config OFFLOAD_WORKQUEUE_PRIORITY
|
|
|
|
int "Offload requests workqueue priority"
|
|
|
|
default -1
|
|
|
|
|
|
|
|
endmenu
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
config ATOMIC_OPERATIONS_CUSTOM
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
config NUM_PIPE_ASYNC_MSGS
|
|
|
|
int "Maximum number of in-flight asynchronous pipe messages"
|
|
|
|
default 10
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies the total number of asynchronous pipe
|
|
|
|
messages that can exist simultaneously, across all pipes 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
|
|
|
|
pipe messages.
|
2017-08-22 22:15:23 +02:00
|
|
|
|
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
|
|
|
|
dynamically allocating memory using k_malloc(). Supported values
|
|
|
|
are: 256, 1024, 4096, and 16384. A size of zero means that no
|
|
|
|
heap memory pool is defined.
|
2019-03-11 17:28:23 +01:00
|
|
|
|
|
|
|
config HEAP_MEM_POOL_MIN_SIZE
|
|
|
|
int "The smallest blocks in the heap memory pool (in bytes)"
|
|
|
|
depends on HEAP_MEM_POOL_SIZE != 0
|
|
|
|
default 64
|
|
|
|
help
|
|
|
|
This option specifies the size of the smallest block in the pool.
|
|
|
|
Option must be a power of 2 and lower than or equal to the size
|
|
|
|
of the entire pool.
|
2016-12-17 23:36:20 +01:00
|
|
|
endmenu
|
|
|
|
|
|
|
|
config ARCH_HAS_CUSTOM_SWAP_TO_MAIN
|
|
|
|
bool
|
|
|
|
# hidden
|
|
|
|
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
|
|
|
|
# hidden
|
|
|
|
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
|
|
|
|
default 10000 if TICKLESS_CAPABLE
|
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
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
Depending on the choice made, an amount of possibly expensive math must
|
|
|
|
occur when converting ticks to milliseconds and vice-versa. Some values
|
|
|
|
are optimized, and yield significantly less math.
|
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
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
The optimal values from a computational point-of-view are 1000, 500,
|
|
|
|
250 and 125, since in these cases there is either no computation
|
|
|
|
required, or it is all done via bit-shifting. These also give a
|
|
|
|
granularity from 1ms to 8ms.
|
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
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
Other good values are 100, 50, 25, 20 and 10. In this case, some math
|
|
|
|
is required but is minimized. These are also values that necessitate a
|
|
|
|
reduced number of clock interrupts per second, at the cost of
|
|
|
|
granularity (10ms to 100ms).
|
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
|
|
|
|
2017-12-13 16:08:21 +01:00
|
|
|
All other values require some extensive 64-bit math, and in some
|
|
|
|
configurations even require calls to compiler built-in functions, and
|
|
|
|
can require a non-trivial extra amount of stack space (e.g. around 80
|
|
|
|
bytes on x86).
|
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
|
2017-12-13 16:08:21 +01:00
|
|
|
This option specifies that the kernel lacks 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
|
|
|
|
work.
|
2015-05-05 17:12:02 +02:00
|
|
|
|
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
|
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
|
|
|
|
|
|
|
config EXECUTE_XOR_WRITE
|
|
|
|
bool "Enable W^X for memory partitions"
|
|
|
|
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
|
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
|
|
|
|
bool "Enable bounds check bypass mitigations for speculative execution"
|
|
|
|
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
|
|
|
|
2018-02-26 04:12:35 +01:00
|
|
|
menu "SMP Options"
|
2018-12-27 18:20:56 +01:00
|
|
|
|
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.
|
|
|
|
|
2018-01-25 23:03:02 +01:00
|
|
|
config SMP
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "Enable symmetric multithreading support"
|
2018-12-27 18:08:24 +01:00
|
|
|
depends on USE_SWITCH
|
2018-01-25 23:03:02 +01:00
|
|
|
help
|
2018-02-26 04:12:35 +01:00
|
|
|
When true, kernel will be built with SMP support, allowing
|
|
|
|
more than one CPU to schedule Zephyr tasks at a time.
|
2018-01-25 23:03:02 +01:00
|
|
|
|
|
|
|
config MP_NUM_CPUS
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Number of CPUs/cores"
|
2018-01-25 23:03:02 +01:00
|
|
|
default 1
|
2019-09-24 19:29:41 +02:00
|
|
|
range 1 4
|
2018-01-25 23:03:02 +01:00
|
|
|
help
|
2018-02-26 04:12:35 +01:00
|
|
|
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
|
|
|
|
bool "Architecture supports broadcast interprocessor interrupts"
|
|
|
|
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).
|
|
|
|
|
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_IDLE
|
2018-12-27 19:09:09 +01:00
|
|
|
# NB: This option is deprecated, see TICKLESS_KERNEL and
|
|
|
|
# https://github.com/zephyrproject-rtos/zephyr/pull/12234
|
2018-10-01 20:13:55 +02:00
|
|
|
bool "Tickless idle"
|
2018-10-12 15:58:21 +02:00
|
|
|
default y if SYS_POWER_MANAGEMENT || TICKLESS_CAPABLE
|
2018-10-01 20:13:55 +02:00
|
|
|
help
|
|
|
|
This option suppresses periodic system clock interrupts whenever the
|
|
|
|
kernel becomes idle. This permits the system to remain in a power
|
|
|
|
saving state for extended periods without having to wake up to
|
|
|
|
service each tick as it occurs.
|
|
|
|
|
|
|
|
config TICKLESS_IDLE_THRESH
|
|
|
|
int "Tickless idle threshold"
|
|
|
|
default 3
|
|
|
|
depends on TICKLESS_IDLE
|
|
|
|
help
|
|
|
|
This option enables clock interrupt suppression when the kernel idles
|
|
|
|
for only a short period of time. It specifies the minimum number of
|
|
|
|
ticks that must occur before the next kernel timer expires in order
|
|
|
|
for suppression to happen.
|
|
|
|
|
|
|
|
config TICKLESS_KERNEL
|
|
|
|
bool "Tickless kernel"
|
2018-10-12 15:58:21 +02:00
|
|
|
default y if 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
|
|
|
|
2016-12-17 18:26:40 +01:00
|
|
|
source "kernel/Kconfig.power_mgmt"
|
|
|
|
|
2016-12-17 23:36:20 +01:00
|
|
|
endmenu
|