Skip to content

Commit f1521ed

Browse files
committed
kernel: move USE_SWITCH out of the SMP options menu
USE_SWITCH and USE_SWITCH_SUPPORTED describe a general context-switch primitive (_arch_switch) that is usable on uniprocessor systems, not just SMP configurations. Having them under the "SMP Options" menu in kernel/smp/Kconfig was misleading. Move both symbols to kernel/Kconfig proper, just before the SMP menu is sourced. SMP still depends on USE_SWITCH; the guarding and arch selects are unchanged. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1 parent 90b37ad commit f1521ed

2 files changed

Lines changed: 19 additions & 18 deletions

File tree

kernel/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,25 @@ config HW_SHADOW_STACK_ALLOW_REUSE
10191019
endmenu
10201020

10211021
rsource "userspace/Kconfig"
1022+
1023+
config USE_SWITCH
1024+
bool "Use new-style _arch_switch instead of arch_swap"
1025+
depends on USE_SWITCH_SUPPORTED
1026+
help
1027+
The _arch_switch() API is a lower level context switching
1028+
primitive than the original arch_swap mechanism. It is required
1029+
for an SMP-aware scheduler, or if the architecture does not
1030+
provide arch_swap. In uniprocess situations where the
1031+
architecture provides both, _arch_switch incurs more somewhat
1032+
overhead and may be slower.
1033+
1034+
config USE_SWITCH_SUPPORTED
1035+
bool
1036+
help
1037+
Indicates whether _arch_switch() API is supported by the
1038+
currently enabled platform. This option should be selected by
1039+
platforms that implement it.
1040+
10221041
rsource "smp/Kconfig"
10231042

10241043
config TICKLESS_KERNEL

kernel/smp/Kconfig

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@ config SMP
1010
When true, kernel will be built with SMP support, allowing
1111
more than one CPU to schedule Zephyr tasks at a time.
1212

13-
config USE_SWITCH
14-
bool "Use new-style _arch_switch instead of arch_swap"
15-
depends on USE_SWITCH_SUPPORTED
16-
help
17-
The _arch_switch() API is a lower level context switching
18-
primitive than the original arch_swap mechanism. It is required
19-
for an SMP-aware scheduler, or if the architecture does not
20-
provide arch_swap. In uniprocess situations where the
21-
architecture provides both, _arch_switch incurs more somewhat
22-
overhead and may be slower.
23-
24-
config USE_SWITCH_SUPPORTED
25-
bool
26-
help
27-
Indicates whether _arch_switch() API is supported by the
28-
currently enabled platform. This option should be selected by
29-
platforms that implement it.
30-
3113
config MP_MAX_NUM_CPUS
3214
int "Maximum number of CPUs/cores"
3315
default 1

0 commit comments

Comments
 (0)