blob: d1042f867274bad5b5f992239ab218b65d4ecc23 [file] [log] [blame]
Ulf Magnussonbd6e0442019-11-01 13:45:29 +01001# Kernel configuration options
Juan Manuel Cruzd15251f2015-05-20 11:40:39 -05002
Juan Manuel Cruzd15251f2015-05-20 11:40:39 -05003# Copyright (c) 2014-2015 Wind River Systems, Inc.
David B. Kinderac74d8b2017-01-18 17:01:01 -08004# SPDX-License-Identifier: Apache-2.0
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -06005
6menu "General Kernel Options"
Andy Grossbb063162017-01-29 23:53:17 -06007
Anas Nashif0a0c8c82018-09-17 06:58:09 -05008module = KERNEL
9module-str = kernel
10source "subsys/logging/Kconfig.template.log_config"
11
Anas Nashif9463dc02016-12-17 17:36:20 -050012config MULTITHREADING
Carles Cufi28cb9da2020-09-02 18:51:10 +020013 bool "Multi-threading (DEPRECATED)"
Anas Nashif9463dc02016-12-17 17:36:20 -050014 default y
15 help
Carles Cufi28cb9da2020-09-02 18:51:10 +020016 Disabling this option is DEPRECATED.
17
Anas Nashif429c2a42017-12-13 10:08:21 -050018 If disabled, only the main thread is available, so a main() function
19 must be provided. Interrupts are available. Kernel objects will most
20 probably not behave as expected, especially with regards to pending,
21 since the main thread cannot pend, it being the only thread in the
22 system.
Anas Nashif9463dc02016-12-17 17:36:20 -050023
David Brown22029272019-03-15 16:01:51 -060024 Many drivers and subsystems will not work with this option
25 set to 'n'; disable only when you REALLY know what you are
26 doing.
Anas Nashif9463dc02016-12-17 17:36:20 -050027
Carles Cufi28cb9da2020-09-02 18:51:10 +020028if !MULTITHREADING
29comment "*** WARNING ***"
30comment "Single threaded mode (MULTITHREADING option disabled) is deprecated"
31endif
32
Anas Nashif9463dc02016-12-17 17:36:20 -050033config NUM_COOP_PRIORITIES
Ulf Magnusson8cf8db32018-08-14 16:19:20 +020034 int "Number of coop priorities" if MULTITHREADING
Anas Nashif9463dc02016-12-17 17:36:20 -050035 default 1 if !MULTITHREADING
Ulf Magnussonec3eff52018-07-30 10:57:47 +020036 default 16
Benjamin Walshf9554762016-12-21 15:38:54 -050037 range 0 128
Anas Nashif9463dc02016-12-17 17:36:20 -050038 help
Anas Nashif429c2a42017-12-13 10:08:21 -050039 Number of cooperative priorities configured in the system. Gives access
40 to priorities:
Anas Nashif9463dc02016-12-17 17:36:20 -050041
42 K_PRIO_COOP(0) to K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
43
Anas Nashif429c2a42017-12-13 10:08:21 -050044 or seen another way, priorities:
Anas Nashif9463dc02016-12-17 17:36:20 -050045
46 -CONFIG_NUM_COOP_PRIORITIES to -1
47
Anas Nashif429c2a42017-12-13 10:08:21 -050048 This can be set to zero to disable cooperative scheduling. Cooperative
49 threads always preempt preemptible threads.
Anas Nashif9463dc02016-12-17 17:36:20 -050050
Anas Nashif429c2a42017-12-13 10:08:21 -050051 Each priority requires an extra 8 bytes of RAM. Each set of 32 extra
52 total priorities require an extra 4 bytes and add one possible
53 iteration to loops that search for the next thread to run.
Anas Nashif9463dc02016-12-17 17:36:20 -050054
Anas Nashif429c2a42017-12-13 10:08:21 -050055 The total number of priorities is
Anas Nashif9463dc02016-12-17 17:36:20 -050056
57 NUM_COOP_PRIORITIES + NUM_PREEMPT_PRIORITIES + 1
58
Anas Nashif429c2a42017-12-13 10:08:21 -050059 The extra one is for the idle thread, which must run at the lowest
60 priority, and be the only thread at that priority.
Anas Nashif9463dc02016-12-17 17:36:20 -050061
62config NUM_PREEMPT_PRIORITIES
Ulf Magnusson8cf8db32018-08-14 16:19:20 +020063 int "Number of preemptible priorities" if MULTITHREADING
Anas Nashif9463dc02016-12-17 17:36:20 -050064 default 0 if !MULTITHREADING
Ulf Magnussonec3eff52018-07-30 10:57:47 +020065 default 15
Benjamin Walshf9554762016-12-21 15:38:54 -050066 range 0 128
Anas Nashif9463dc02016-12-17 17:36:20 -050067 help
Anas Nashif429c2a42017-12-13 10:08:21 -050068 Number of preemptible priorities available in the system. Gives access
69 to priorities 0 to CONFIG_NUM_PREEMPT_PRIORITIES - 1.
Anas Nashif9463dc02016-12-17 17:36:20 -050070
Anas Nashif429c2a42017-12-13 10:08:21 -050071 This can be set to 0 to disable preemptible scheduling.
Anas Nashif9463dc02016-12-17 17:36:20 -050072
Anas Nashif429c2a42017-12-13 10:08:21 -050073 Each priority requires an extra 8 bytes of RAM. Each set of 32 extra
74 total priorities require an extra 4 bytes and add one possible
75 iteration to loops that search for the next thread to run.
Anas Nashif9463dc02016-12-17 17:36:20 -050076
Anas Nashif429c2a42017-12-13 10:08:21 -050077 The total number of priorities is
Anas Nashif9463dc02016-12-17 17:36:20 -050078
79 NUM_COOP_PRIORITIES + NUM_PREEMPT_PRIORITIES + 1
80
Anas Nashif429c2a42017-12-13 10:08:21 -050081 The extra one is for the idle thread, which must run at the lowest
82 priority, and be the only thread at that priority.
Anas Nashif9463dc02016-12-17 17:36:20 -050083
84config MAIN_THREAD_PRIORITY
Ulf Magnusson8cf8db32018-08-14 16:19:20 +020085 int "Priority of initialization/main thread"
Benjamin Walshe6695592017-01-14 18:50:22 -050086 default -2 if !PREEMPT_ENABLED
Ulf Magnussonec3eff52018-07-30 10:57:47 +020087 default 0
Anas Nashif9463dc02016-12-17 17:36:20 -050088 help
Anas Nashif429c2a42017-12-13 10:08:21 -050089 Priority at which the initialization thread runs, including the start
90 of the main() function. main() can then change its priority if desired.
Anas Nashif9463dc02016-12-17 17:36:20 -050091
92config COOP_ENABLED
Ulf Magnusson7727d1a2018-06-22 02:25:43 +020093 def_bool (NUM_COOP_PRIORITIES != 0)
Anas Nashif9463dc02016-12-17 17:36:20 -050094
95config PREEMPT_ENABLED
Ulf Magnusson7727d1a2018-06-22 02:25:43 +020096 def_bool (NUM_PREEMPT_PRIORITIES != 0)
Anas Nashif9463dc02016-12-17 17:36:20 -050097
98config PRIORITY_CEILING
Ulf Magnusson8cf8db32018-08-14 16:19:20 +020099 int "Priority inheritance ceiling"
Anas Nashif9463dc02016-12-17 17:36:20 -0500100 default 0
101
Andy Ross7aa25fa2018-05-11 14:02:42 -0700102config NUM_METAIRQ_PRIORITIES
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200103 int "Number of very-high priority 'preemptor' threads"
Andy Ross7aa25fa2018-05-11 14:02:42 -0700104 default 0
105 help
Ulf Magnusson975de212019-11-01 10:24:07 +0100106 This defines a set of priorities at the (numerically) lowest
107 end of the range which have "meta-irq" behavior. Runnable
108 threads at these priorities will always be scheduled before
109 threads at lower priorities, EVEN IF those threads are
110 otherwise cooperative and/or have taken a scheduler lock.
111 Making such a thread runnable in any way thus has the effect
112 of "interrupting" the current task and running the meta-irq
113 thread synchronously, like an exception or system call. The
114 intent is to use these priorities to implement "interrupt
115 bottom half" or "tasklet" behavior, allowing driver
116 subsystems to return from interrupt context but be guaranteed
117 that user code will not be executed (on the current CPU)
118 until the remaining work is finished. As this breaks the
119 "promise" of non-preemptibility granted by the current API
120 for cooperative threads, this tool probably shouldn't be used
121 from application code.
Andy Ross7aa25fa2018-05-11 14:02:42 -0700122
Andy Ross4a2e50f2018-05-15 11:06:25 -0700123config SCHED_DEADLINE
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200124 bool "Enable earliest-deadline-first scheduling"
Andy Ross4a2e50f2018-05-15 11:06:25 -0700125 help
126 This enables a simple "earliest deadline first" scheduling
127 mode where threads can set "deadline" deltas measured in
128 k_cycle_get_32() units. Priority decisions within (!!) a
129 single priority will choose the next expiring deadline and
130 not simply the least recently added thread.
131
Andy Rossab46b1b2019-01-30 15:00:42 -0800132config SCHED_CPU_MASK
133 bool "Enable CPU mask affinity/pinning API"
134 depends on SCHED_DUMB
135 help
Anas Nashif8d267502019-12-18 18:10:09 -0500136 When true, the application will have access to the
137 k_thread_cpu_mask_*() APIs which control per-CPU affinity masks in
138 SMP mode, allowing applications to pin threads to specific CPUs or
139 disallow threads from running on given CPUs. Note that as currently
140 implemented, this involves an inherent O(N) scaling in the number of
141 idle-but-runnable threads, and thus works only with the DUMB
142 scheduler (as SCALABLE and MULTIQ would see no benefit).
Andy Rossab46b1b2019-01-30 15:00:42 -0800143
Anas Nashif8d267502019-12-18 18:10:09 -0500144 Note that this setting does not technically depend on SMP and is
145 implemented without it for testing purposes, but for obvious reasons
146 makes sense as an application API only where there is more than one
147 CPU. With one CPU, it's just a higher overhead version of
148 k_thread_start/stop().
Andy Ross4a2e50f2018-05-15 11:06:25 -0700149
Anas Nashif9463dc02016-12-17 17:36:20 -0500150config MAIN_STACK_SIZE
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200151 int "Size of stack for initialization and main thread"
Adithya Baglody76ee02b2018-08-31 15:13:36 +0530152 default 2048 if COVERAGE_GCOV
Andrew Boie7fae2bb2019-07-29 20:47:42 -0700153 default 512 if ZTEST && !(RISCV || X86)
Ulf Magnussonec3eff52018-07-30 10:57:47 +0200154 default 1024
Anas Nashif9463dc02016-12-17 17:36:20 -0500155 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500156 When the initialization is complete, the thread executing it then
157 executes the main() routine, so as to reuse the stack used by the
158 initialization, which would be wasted RAM otherwise.
Anas Nashif9463dc02016-12-17 17:36:20 -0500159
Anas Nashif429c2a42017-12-13 10:08:21 -0500160 After initialization is complete, the thread runs main().
Anas Nashif9463dc02016-12-17 17:36:20 -0500161
162config IDLE_STACK_SIZE
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200163 int "Size of stack for idle thread"
Wentong Wub9919622019-04-04 17:50:30 +0800164 default 2048 if COVERAGE_GCOV
Mazen NEIFER57186762017-01-31 22:50:42 +0100165 default 1024 if XTENSA
Nicolas Pitre1f4b5dd2019-07-17 13:17:05 -0400166 default 512 if RISCV
Andrew Boief5a7e1a2020-09-02 09:20:38 -0700167 default 384 if DYNAMIC_OBJECTS
Andrew Boie3f7ae0d2020-11-19 12:39:16 -0800168 default 320 if ARC || (ARM && CPU_HAS_FPU) || (X86 && MMU)
Ulf Magnussonec3eff52018-07-30 10:57:47 +0200169 default 256
Anas Nashif9463dc02016-12-17 17:36:20 -0500170 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500171 Depending on the work that the idle task must do, most likely due to
172 power management but possibly to other features like system event
173 logging (e.g. logging when the system goes to sleep), the idle thread
174 may need more stack space than the default value.
Anas Nashif9463dc02016-12-17 17:36:20 -0500175
176config ISR_STACK_SIZE
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200177 int "ISR and initialization stack size (in bytes)"
Anas Nashif9463dc02016-12-17 17:36:20 -0500178 default 2048
179 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500180 This option specifies the size of the stack used by interrupt
181 service routines (ISRs), and during kernel initialization.
Anas Nashif9463dc02016-12-17 17:36:20 -0500182
Vincenzo Frascinodfed8c42017-03-27 15:52:42 +0100183config THREAD_STACK_INFO
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200184 bool "Thread stack info"
Vincenzo Frascinodfed8c42017-03-27 15:52:42 +0100185 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500186 This option allows each thread to store the thread stack info into
187 the k_thread data structure.
Vincenzo Frascinodfed8c42017-03-27 15:52:42 +0100188
Ulf Magnusson1f38ea72019-11-01 14:00:09 +0100189config THREAD_CUSTOM_DATA
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200190 bool "Thread custom data"
Anas Nashif9463dc02016-12-17 17:36:20 -0500191 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500192 This option allows each thread to store 32 bits of custom data,
193 which can be accessed using the k_thread_custom_data_xxx() APIs.
Anas Nashif9463dc02016-12-17 17:36:20 -0500194
Daniel Leungfc182432018-08-16 15:42:28 -0700195config THREAD_USERSPACE_LOCAL_DATA
196 bool
197 depends on USERSPACE
Daniel Leung62cf1962020-10-05 14:54:45 -0700198 default y if ERRNO && !ERRNO_IN_TLS
Daniel Leungfc182432018-08-16 15:42:28 -0700199
Anas Nashif9463dc02016-12-17 17:36:20 -0500200config ERRNO
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200201 bool "Enable errno support"
Anas Nashif9463dc02016-12-17 17:36:20 -0500202 default y
203 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500204 Enable per-thread errno in the kernel. Application and library code must
205 include errno.h provided by the C library (libc) to use the errno
206 symbol. The C library must access the per-thread errno via the
Daniel Leung62cf1962020-10-05 14:54:45 -0700207 z_errno() symbol.
208
209config ERRNO_IN_TLS
210 bool "Store errno in thread local storage (TLS)"
211 depends on ERRNO && THREAD_LOCAL_STORAGE
212 default y
213 help
214 Use thread local storage to store errno instead of storing it in
215 the kernel thread struct. This avoids a syscall if userspace is enabled.
Anas Nashif9463dc02016-12-17 17:36:20 -0500216
Andy Ross225c74b2018-06-27 11:20:50 -0700217choice SCHED_ALGORITHM
218 prompt "Scheduler priority queue algorithm"
219 default SCHED_DUMB
Andy Ross1acd8c22018-05-03 14:51:49 -0700220 help
Andy Ross225c74b2018-06-27 11:20:50 -0700221 The kernel can be built with with several choices for the
222 ready queue implementation, offering different choices between
223 code size, constant factor runtime overhead and performance
224 scaling when many threads are added.
Andy Ross1acd8c22018-05-03 14:51:49 -0700225
226config SCHED_DUMB
Andy Ross225c74b2018-06-27 11:20:50 -0700227 bool "Simple linked-list ready queue"
Andy Ross1acd8c22018-05-03 14:51:49 -0700228 help
229 When selected, the scheduler ready queue will be implemented
230 as a simple unordered list, with very fast constant time
231 performance for single threads and very low code size.
232 Choose this on systems with constrained code size that will
233 never see more than a small number (3, maybe) of runnable
234 threads in the queue at any given time. On most platforms
235 (that are not otherwise using the red/black tree) this
236 results in a savings of ~2k of code size.
237
Andy Ross225c74b2018-06-27 11:20:50 -0700238config SCHED_SCALABLE
Andy Ross9f06a352018-06-28 10:38:14 -0700239 bool "Red/black tree ready queue"
240 help
241 When selected, the scheduler ready queue will be implemented
242 as a red/black tree. This has rather slower constant-time
243 insertion and removal overhead, and on most platforms (that
David B. Kinder7c89b632018-08-07 14:03:09 -0700244 are not otherwise using the rbtree somewhere) requires an
Andy Ross9f06a352018-06-28 10:38:14 -0700245 extra ~2kb of code. But the resulting behavior will scale
246 cleanly and quickly into the many thousands of threads. Use
247 this on platforms where you may have many threads (very
248 roughly: more than 20 or so) marked as runnable at a given
249 time. Most applications don't want this.
250
251config SCHED_MULTIQ
252 bool "Traditional multi-queue ready queue"
253 depends on !SCHED_DEADLINE
254 help
255 When selected, the scheduler ready queue will be implemented
256 as the classic/textbook array of lists, one per priority
257 (max 32 priorities). This corresponds to the scheduler
258 algorithm used in Zephyr versions prior to 1.12. It incurs
259 only a tiny code size overhead vs. the "dumb" scheduler and
260 runs in O(1) time in almost all circumstances with very low
261 constant factor. But it requires a fairly large RAM budget
262 to store those list heads, and the limited features make it
263 incompatible with features like deadline scheduling that
264 need to sort threads more finely, and SMP affinity which
265 need to traverse the list of threads. Typical applications
266 with small numbers of runnable threads probably want the
267 DUMB scheduler.
Andy Ross225c74b2018-06-27 11:20:50 -0700268
269endchoice # SCHED_ALGORITHM
270
271choice WAITQ_ALGORITHM
Andy Ross9f06a352018-06-28 10:38:14 -0700272 prompt "Wait queue priority algorithm"
273 default WAITQ_DUMB
274 help
275 The wait_q abstraction used in IPC primitives to pend
276 threads for later wakeup shares the same backend data
277 structure choices as the scheduler, and can use the same
278 options.
Andy Ross225c74b2018-06-27 11:20:50 -0700279
280config WAITQ_SCALABLE
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200281 bool "Use scalable wait_q implementation"
Andy Ross225c74b2018-06-27 11:20:50 -0700282 help
283 When selected, the wait_q will be implemented with a
284 balanced tree. Choose this if you expect to have many
285 threads waiting on individual primitives. There is a ~2kb
286 code size increase over WAITQ_DUMB (which may be shared with
287 SCHED_SCALABLE) if the rbtree is not used elsewhere in the
288 application, and pend/unpend operations on "small" queues
289 will be somewhat slower (though this is not generally a
290 performance path).
291
292config WAITQ_DUMB
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200293 bool "Simple linked-list wait_q"
Andy Ross225c74b2018-06-27 11:20:50 -0700294 help
295 When selected, the wait_q will be implemented with a
296 doubly-linked list. Choose this if you expect to have only
297 a few threads blocked on any single IPC primitive.
298
299endchoice # WAITQ_ALGORITHM
300
Anas Nashif9463dc02016-12-17 17:36:20 -0500301menu "Kernel Debugging and Metrics"
Anas Nashif8470b4d2018-02-25 22:18:17 -0500302
303config INIT_STACKS
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200304 bool "Initialize stack areas"
Anas Nashif8470b4d2018-02-25 22:18:17 -0500305 help
306 This option instructs the kernel to initialize stack areas with a
307 known value (0xaa) before they are first used, so that the high
308 water mark can be easily determined. This applies to the stack areas
Ioannis Glaropoulos57b7c3d2018-09-25 09:48:15 +0200309 for threads, as well as to the interrupt stack.
Anas Nashif8470b4d2018-02-25 22:18:17 -0500310
Anas Nashif9463dc02016-12-17 17:36:20 -0500311config BOOT_BANNER
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200312 bool "Boot banner"
Anas Nashifa805c972018-01-06 14:29:47 -0500313 default y
Kumar Galaa3629e82017-01-11 08:05:20 -0600314 depends on CONSOLE_HAS_DRIVER
Anas Nashif9463dc02016-12-17 17:36:20 -0500315 select PRINTK
316 select EARLY_CONSOLE
317 help
Sebastian Bøec0287692018-09-26 09:46:23 +0200318 This option outputs a banner to the console device during boot up.
Anas Nashif9463dc02016-12-17 17:36:20 -0500319
Inaky Perez-Gonzalezc51f73f2017-06-20 17:01:09 -0700320config BOOT_DELAY
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200321 int "Boot delay in milliseconds"
Inaky Perez-Gonzalezc51f73f2017-06-20 17:01:09 -0700322 default 0
323 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500324 This option delays bootup for the specified amount of
325 milliseconds. This is used to allow serial ports to get ready
326 before starting to print information on them during boot, as
327 some systems might boot to fast for a receiving endpoint to
328 detect the new USB serial bus, enumerate it and get ready to
329 receive before it actually gets data. A similar effect can be
330 achieved by waiting for DCD on the serial port--however, not
331 all serial ports have DCD.
Inaky Perez-Gonzalezc51f73f2017-06-20 17:01:09 -0700332
Anas Nashif9463dc02016-12-17 17:36:20 -0500333config THREAD_MONITOR
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200334 bool "Thread monitoring [EXPERIMENTAL]"
Anas Nashif9463dc02016-12-17 17:36:20 -0500335 help
336 This option instructs the kernel to maintain a list of all threads
337 (excluding those that have not yet started or have already
338 terminated).
Anas Nashif57554052018-03-03 02:31:05 -0600339
340config THREAD_NAME
341 bool "Thread name [EXPERIMENTAL]"
342 help
343 This option allows to set a name for a thread.
Andrew Boie38129ce2019-06-25 08:54:37 -0700344
345config THREAD_MAX_NAME_LEN
346 int "Max length of a thread name"
347 default 32
348 range 8 128
349 depends on THREAD_NAME
350 help
351 Thread names get stored in the k_thread struct. Indicate the max
352 name length, including the terminating NULL byte. Reduce this value
353 to conserve memory.
Daniel Leungfc577c42020-08-27 13:54:14 -0700354
355config INSTRUMENT_THREAD_SWITCHING
356 bool
357
Daniel Leungfd7a68d2020-10-14 12:17:12 -0700358menuconfig THREAD_RUNTIME_STATS
Daniel Leungfc577c42020-08-27 13:54:14 -0700359 bool "Thread runtime statistics"
360 select INSTRUMENT_THREAD_SWITCHING
361 help
362 Gather thread runtime statistics.
363
364 For example:
365 - Thread total execution cycles
366
Daniel Leungfd7a68d2020-10-14 12:17:12 -0700367if THREAD_RUNTIME_STATS
368
369config THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS
370 bool "Use timing functions to gather statistics"
371 select TIMING_FUNCTIONS
372 help
373 Use timing functions to gather thread runtime statistics.
374
375 Note that timing functions may use a different timer than
376 the default timer for OS timekeeping.
377
378endif # THREAD_RUNTIME_STATS
379
Anas Nashif9463dc02016-12-17 17:36:20 -0500380endmenu
381
382menu "Work Queue Options"
383config SYSTEM_WORKQUEUE_STACK_SIZE
384 int "System workqueue stack size"
Andrew Boieafda7642019-05-01 14:11:25 -0700385 default 4096 if COVERAGE
Anas Nashif9463dc02016-12-17 17:36:20 -0500386 default 1024
387
388config SYSTEM_WORKQUEUE_PRIORITY
389 int "System workqueue priority"
Benjamin Walshe6695592017-01-14 18:50:22 -0500390 default -2 if COOP_ENABLED && !PREEMPT_ENABLED
Ulf Magnussonec3eff52018-07-30 10:57:47 +0200391 default 0 if !COOP_ENABLED
392 default -1
Paul Sokolovskyfd559352018-06-07 16:58:11 +0300393 help
394 By default, system work queue priority is the lowest cooperative
395 priority. This means that any work handler, once started, won't
396 be preempted by any other thread until finished.
Anas Nashif9463dc02016-12-17 17:36:20 -0500397
Anas Nashif9463dc02016-12-17 17:36:20 -0500398endmenu
399
400menu "Atomic Operations"
401config ATOMIC_OPERATIONS_BUILTIN
402 bool
403 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500404 Use the compiler builtin functions for atomic operations. This is
405 the preferred method. However, support for all arches in GCC is
406 incomplete.
Anas Nashif9463dc02016-12-17 17:36:20 -0500407
408config ATOMIC_OPERATIONS_CUSTOM
409 bool
410 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500411 Use when there isn't support for compiler built-ins, but you have
412 written optimized assembly code under arch/ which implements these.
Anas Nashif9463dc02016-12-17 17:36:20 -0500413
414config ATOMIC_OPERATIONS_C
415 bool
416 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500417 Use atomic operations routines that are implemented entirely
418 in C by locking interrupts. Selected by architectures which either
419 do not have support for atomic operations in their instruction
420 set, or haven't been implemented yet during bring-up, and also
421 the compiler does not have support for the atomic __sync_* builtins.
Anas Nashif9463dc02016-12-17 17:36:20 -0500422endmenu
423
424menu "Timer API Options"
425
426config TIMESLICING
427 bool "Thread time slicing"
428 default y
429 depends on SYS_CLOCK_EXISTS && (NUM_PREEMPT_PRIORITIES != 0)
430 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500431 This option enables time slicing between preemptible threads of
432 equal priority.
Anas Nashif9463dc02016-12-17 17:36:20 -0500433
434config TIMESLICE_SIZE
435 int "Time slice size (in ms)"
436 default 0
437 range 0 2147483647
438 depends on TIMESLICING
439 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500440 This option specifies the maximum amount of time a thread can execute
441 before other threads of equal priority are given an opportunity to run.
442 A time slice size of zero means "no limit" (i.e. an infinitely large
443 time slice).
Anas Nashif9463dc02016-12-17 17:36:20 -0500444
445config TIMESLICE_PRIORITY
446 int "Time slicing thread priority ceiling"
447 default 0
448 range 0 NUM_PREEMPT_PRIORITIES
449 depends on TIMESLICING
450 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500451 This option specifies the thread priority level at which time slicing
452 takes effect; threads having a higher priority than this ceiling are
453 not subject to time slicing.
Anas Nashif9463dc02016-12-17 17:36:20 -0500454
Benjamin Walshacc68c12017-01-29 18:57:45 -0500455config POLL
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200456 bool "Async I/O Framework"
Benjamin Walshacc68c12017-01-29 18:57:45 -0500457 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500458 Asynchronous notification framework. Enable the k_poll() and
Flavio Ceolinaecd4ec2018-11-02 12:35:30 -0700459 k_poll_signal_raise() APIs. The former can wait on multiple events
Anas Nashif429c2a42017-12-13 10:08:21 -0500460 concurrently, which can be either directly triggered or triggered by
Anas Nashif56821172020-07-08 14:14:25 -0400461 the availability of some kernel objects (semaphores and FIFOs).
Benjamin Walshacc68c12017-01-29 18:57:45 -0500462
Anas Nashif9463dc02016-12-17 17:36:20 -0500463endmenu
464
465menu "Other Kernel Object Options"
Anas Nashif70a2e132017-01-07 08:43:32 -0500466
Kamil Lazowski104f1002020-09-11 14:27:55 +0200467config MEM_SLAB_TRACE_MAX_UTILIZATION
468 bool "Enable getting maximum slab utilization"
469 help
470 This adds variable to the k_mem_slab structure to hold
471 maximum utilization of the slab.
472
Anas Nashif9463dc02016-12-17 17:36:20 -0500473config NUM_MBOX_ASYNC_MSGS
474 int "Maximum number of in-flight asynchronous mailbox messages"
475 default 10
476 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500477 This option specifies the total number of asynchronous mailbox
478 messages that can exist simultaneously, across all mailboxes
479 in the system.
Anas Nashif9463dc02016-12-17 17:36:20 -0500480
Anas Nashif429c2a42017-12-13 10:08:21 -0500481 Setting this option to 0 disables support for asynchronous
482 mailbox messages.
Anas Nashif9463dc02016-12-17 17:36:20 -0500483
484config NUM_PIPE_ASYNC_MSGS
485 int "Maximum number of in-flight asynchronous pipe messages"
486 default 10
487 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500488 This option specifies the total number of asynchronous pipe
489 messages that can exist simultaneously, across all pipes in
490 the system.
Anas Nashif9463dc02016-12-17 17:36:20 -0500491
Anas Nashif429c2a42017-12-13 10:08:21 -0500492 Setting this option to 0 disables support for asynchronous
493 pipe messages.
Andrew Boie945af952017-08-22 13:15:23 -0700494
Daniel Leungb5c2ff92020-09-18 14:12:51 -0700495config KERNEL_MEM_POOL
496 bool "Use Kernel Memory Pool"
497 default y
498 help
499 Enable the use of kernel memory pool.
500
501 Say y if unsure.
502
503if KERNEL_MEM_POOL
504
Anas Nashif9463dc02016-12-17 17:36:20 -0500505config HEAP_MEM_POOL_SIZE
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200506 int "Heap memory pool size (in bytes)"
Youvedeep Singh4a8b2d22018-03-19 20:45:27 +0530507 default 0 if !POSIX_MQUEUE
508 default 1024 if POSIX_MQUEUE
Anas Nashif9463dc02016-12-17 17:36:20 -0500509 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500510 This option specifies the size of the heap memory pool used when
David Leachdb36b142020-07-23 14:13:09 -0500511 dynamically allocating memory using k_malloc(). The maximum size of
512 the memory pool is only limited to available memory. A size of zero
513 means that no heap memory pool is defined.
Pawel Dunajb87920b2019-03-11 17:28:23 +0100514
Daniel Leungb5c2ff92020-09-18 14:12:51 -0700515endif # KERNEL_MEM_POOL
516
Anas Nashif9463dc02016-12-17 17:36:20 -0500517endmenu
518
Anas Nashif9463dc02016-12-17 17:36:20 -0500519config ARCH_HAS_CUSTOM_SWAP_TO_MAIN
520 bool
Anas Nashif9463dc02016-12-17 17:36:20 -0500521 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500522 It's possible that an architecture port cannot use _Swap() to swap to
523 the _main() thread, but instead must do something custom. It must
524 enable this option in that case.
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600525
Andy Ross7f42dba2019-01-04 12:47:21 -0800526config SWAP_NONATOMIC
527 bool
528 help
529 On some architectures, the _Swap() primitive cannot be made
530 atomic with respect to the irq_lock being released. That
531 is, interrupts may be received between the entry to _Swap
532 and the completion of the context switch. There are a
533 handful of workaround cases in the kernel that need to be
534 enabled when this is true. Currently, this only happens on
535 ARM when the PendSV exception priority sits below that of
536 Zephyr-handled interrupts.
537
Anas Nashif94d034d2017-12-21 18:23:34 -0500538config ARCH_HAS_CUSTOM_BUSY_WAIT
539 bool
Anas Nashif94d034d2017-12-21 18:23:34 -0500540 help
541 It's possible that an architecture port cannot or does not want to use
542 the provided k_busy_wait(), but instead must do something custom. It must
543 enable this option in that case.
544
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600545config SYS_CLOCK_TICKS_PER_SEC
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200546 int "System tick frequency (in ticks/second)"
Andy Ross669730f2019-06-11 11:18:20 -0700547 default 100 if QEMU_TARGET || SOC_POSIX
548 default 10000 if TICKLESS_CAPABLE
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600549 default 100
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600550 help
Andy Ross669730f2019-06-11 11:18:20 -0700551 This option specifies the nominal frequency of the system clock in Hz.
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600552
Spoorthy Priya Yerabolue9ef0782020-09-18 00:45:48 -0700553 For asynchronous timekeeping, the kernel defines a "ticks" concept. A
554 "tick" is the internal count in which the kernel does all its internal
555 uptime and timeout bookeeping. Interrupts are expected to be delivered
556 on tick boundaries to the extent practical, and no fractional ticks
557 are tracked.
Benjamin Walsh62092182016-12-20 14:39:08 -0500558
Spoorthy Priya Yerabolue9ef0782020-09-18 00:45:48 -0700559 The choice of tick rate is configurable by this option. Also the number
560 of cycles per tick should be chosen so that 1 millisecond is exactly
561 represented by an integral number of ticks. Defaults on most hardware
562 platforms (ones that support setting arbitrary interrupt timeouts) are
563 expected to be in the range of 10 kHz, with software emulation
564 platforms and legacy drivers using a more traditional 100 Hz value.
Benjamin Walsh62092182016-12-20 14:39:08 -0500565
Andy Ross393ec712018-09-19 11:08:19 -0700566 Note that when available and enabled, in "tickless" mode
567 this config variable specifies the minimum available timing
568 granularity, not necessarily the number or frequency of
569 interrupts delivered to the kernel.
570
Carles Cufi201fdf02019-05-09 19:48:40 +0200571 A value of 0 completely disables timer support in the kernel.
572
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600573config SYS_CLOCK_HW_CYCLES_PER_SEC
Peter Mitsisd2857402015-07-22 16:22:25 -0400574 int "System clock's h/w timer frequency"
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600575 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500576 This option specifies the frequency of the hardware timer used for the
Ioannis Glaropoulos1d9bb5d2018-07-16 09:43:32 +0200577 system clock (in Hz). This option is set by the SOC's or board's Kconfig file
Anas Nashif429c2a42017-12-13 10:08:21 -0500578 and the user should generally avoid modifying it via the menu configuration.
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600579
Kumar Gala9ec2f3b2016-05-24 18:17:13 -0500580config SYS_CLOCK_EXISTS
Andy Ross669730f2019-06-11 11:18:20 -0700581 bool "System clock exists and is enabled"
582 default y
Juan Manuel Cruzc818cd22015-05-05 10:12:02 -0500583 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500584 This option specifies that the kernel lacks timer support.
Andy Ross669730f2019-06-11 11:18:20 -0700585 Some device configurations can eliminate significant code if
586 this is disabled. Obviously timeout-related APIs will not
587 work.
Juan Manuel Cruzc818cd22015-05-05 10:12:02 -0500588
Andy Rosscfeb07e2020-03-05 21:14:02 -0800589config TIMEOUT_64BIT
Andy Ross4d417032020-05-04 15:57:31 -0700590 bool "Store kernel timeouts in 64 bit precision"
Andy Rosscfeb07e2020-03-05 21:14:02 -0800591 default y
592 help
593 When this option is true, the k_ticks_t values passed to
594 kernel APIs will be a 64 bit quantity, allowing the use of
595 larger values (and higher precision tick rates) without fear
Andy Ross4c7b77a2020-03-09 09:35:35 -0700596 of overflowing the 32 bit word. This feature also gates the
597 availability of absolute timeout values (which require the
598 extra precision).
Andy Rosscfeb07e2020-03-05 21:14:02 -0800599
Kumar Gala9ec2f3b2016-05-24 18:17:13 -0500600config XIP
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200601 bool "Execute in place"
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600602 help
603 This option allows the kernel to operate with its text and read-only
David B. Kinderd7485772016-08-17 16:33:08 -0700604 sections residing in ROM (or similar read-only memory). Not all boards
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600605 support this option so it must be used with care; you must also
606 supply a linker command file when building your image. Enabling this
607 option increases both the code and data footprint of the image.
608
Anas Nashif9463dc02016-12-17 17:36:20 -0500609menu "Initialization Priorities"
Anas Nashif3d8e86c2016-12-19 18:41:17 -0500610
Dmitriy Korovkin4223ba72016-09-09 11:20:23 -0400611config KERNEL_INIT_PRIORITY_OBJECTS
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200612 int "Kernel objects initialization priority"
Dmitriy Korovkin4223ba72016-09-09 11:20:23 -0400613 default 30
614 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500615 Kernel objects use this priority for initialization. This
616 priority needs to be higher than minimal default initialization
617 priority.
Dmitriy Korovkin4223ba72016-09-09 11:20:23 -0400618
Dmitriy Korovkin57f27412015-10-26 15:56:02 -0400619config KERNEL_INIT_PRIORITY_DEFAULT
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200620 int "Default init priority"
Daniel Leung546b8ad2016-03-28 14:05:33 -0700621 default 40
Dmitriy Korovkin57f27412015-10-26 15:56:02 -0400622 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500623 Default minimal init priority for each init level.
Dmitriy Korovkin57f27412015-10-26 15:56:02 -0400624
625config KERNEL_INIT_PRIORITY_DEVICE
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200626 int "Default init priority for device drivers"
Daniel Leung546b8ad2016-03-28 14:05:33 -0700627 default 50
Dmitriy Korovkin57f27412015-10-26 15:56:02 -0400628 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500629 Device driver, that depends on common components, such as
630 interrupt controller, but does not depend on other devices,
631 uses this init priority.
Dirk Brandewiefeee30c2015-09-29 07:08:58 -0700632
Anas Nashif33118f92016-10-07 13:03:51 -0400633config APPLICATION_INIT_PRIORITY
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200634 int "Default init priority for application level drivers"
Anas Nashif33118f92016-10-07 13:03:51 -0400635 default 90
636 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500637 This priority level is for end-user drivers such as sensors and display
638 which have no inward dependencies.
Andy Ross53c85992017-07-24 14:59:55 -0700639
Anas Nashif8470b4d2018-02-25 22:18:17 -0500640
641endmenu
642
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600643menu "Security Options"
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600644
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600645config STACK_CANARIES
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200646 bool "Compiler stack canaries"
David Leachaa911132019-11-12 16:02:05 -0600647 depends on ENTROPY_GENERATOR || TEST_RANDOM_GENERATOR
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600648 help
Sebastian Bøe5a58da52019-01-21 14:02:55 +0100649 This option enables compiler stack canaries.
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600650
Anas Nashif429c2a42017-12-13 10:08:21 -0500651 If stack canaries are supported by the compiler, it will emit
652 extra code that inserts a canary value into the stack frame when
653 a function is entered and validates this value upon exit.
654 Stack corruption (such as that caused by buffer overflow) results
655 in a fatal error condition for the running entity.
656 Enabling this option can result in a significant increase
657 in footprint and an associated decrease in performance.
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600658
Sebastian Bøe5a58da52019-01-21 14:02:55 +0100659 If stack canaries are not supported by the compiler an error
660 will occur at build time.
Leandro Pereirab007b642017-10-17 17:01:48 -0700661
662config EXECUTE_XOR_WRITE
663 bool "Enable W^X for memory partitions"
664 depends on USERSPACE
665 depends on ARCH_HAS_EXECUTABLE_PAGE_BIT
666 default y
667 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500668 When enabled, will enforce that a writable page isn't executable
669 and vice versa. This might not be acceptable in all scenarios,
670 so this option is given for those unafraid of shooting themselves
671 in the foot.
Leandro Pereirab007b642017-10-17 17:01:48 -0700672
Anas Nashif429c2a42017-12-13 10:08:21 -0500673 If unsure, say Y.
Leandro Pereirab007b642017-10-17 17:01:48 -0700674
Andrew Boie83752c12018-03-02 07:54:13 -0800675config STACK_POINTER_RANDOM
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200676 int "Initial stack pointer randomization bounds"
Andrew Boie83752c12018-03-02 07:54:13 -0800677 depends on !STACK_GROWS_UP
Flavio Ceolinfbeaa0a2020-02-25 15:32:39 -0800678 depends on MULTITHREADING
Flavio Ceolin2e0095a2019-04-30 10:45:48 -0700679 depends on TEST_RANDOM_GENERATOR || ENTROPY_HAS_DRIVER
Andrew Boie83752c12018-03-02 07:54:13 -0800680 default 0
681 help
682 This option performs a limited form of Address Space Layout
683 Randomization by offsetting some random value to a thread's
684 initial stack pointer upon creation. This hinders some types of
685 security attacks by making the location of any given stack frame
686 non-deterministic.
687
688 This feature can waste up to the specified size in bytes the stack
689 region, which is carved out of the total size of the stack region.
690 A reasonable minimum value would be around 100 bytes if this can
691 be spared.
692
693 This is currently only implemented for systems whose stack pointers
694 grow towards lower memory addresses.
695
Andrew Boie576ebf42019-03-07 15:56:55 -0800696config BOUNDS_CHECK_BYPASS_MITIGATION
697 bool "Enable bounds check bypass mitigations for speculative execution"
698 depends on USERSPACE
699 help
700 Untrusted parameters from user mode may be used in system calls to
701 index arrays during speculative execution, also known as the Spectre
702 V1 vulnerability. When enabled, various macros defined in
703 misc/speculation.h will insert fence instructions or other appropriate
704 mitigations after bounds checking any array index parameters passed
705 in from untrusted sources (user mode threads). When disabled, these
706 macros do nothing.
Juan Manuel Cruz0e301cc2015-03-11 12:44:14 -0600707endmenu
708
Chunlin Hane9c97022017-07-07 20:29:30 +0800709config MAX_DOMAIN_PARTITIONS
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200710 int "Maximum number of partitions per memory domain"
Chunlin Hane9c97022017-07-07 20:29:30 +0800711 default 16
712 range 0 255
713 depends on USERSPACE
714 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500715 Configure the maximum number of partitions per memory domain.
Chunlin Hane9c97022017-07-07 20:29:30 +0800716
Andrew Boiebc35b0b2020-08-19 13:11:47 -0700717config ARCH_MEM_DOMAIN_DATA
718 bool
719 depends on USERSPACE
720 help
721 This hidden option is selected by the target architecture if
722 architecture-specific data is needed on a per memory domain basis.
723 If so, the architecture defines a 'struct arch_mem_domain' which is
724 embedded within every struct k_mem_domain. The architecture
725 must also define the arch_mem_domain_init() function to set this up
726 when a memory domain is created.
727
728 Typical uses might be a set of page tables for that memory domain.
729
Andrew Boie00f71b02020-08-25 17:02:38 -0700730config ARCH_MEM_DOMAIN_SYNCHRONOUS_API
731 bool
732 depends on USERSPACE
733 help
734 This hidden option is selected by the target architecture if
735 modifying a memory domain's partitions at runtime, or changing
736 a memory domain's thread membership requires synchronous calls
737 into the architecture layer.
738
739 If enabled, the architecture layer must implement the following
740 APIs:
741
742 arch_mem_domain_thread_add
743 arch_mem_domain_thread_remove
744 arch_mem_domain_partition_remove
745 arch_mem_domain_partition_add
746 arch_mem_domain_destroy
747
748 It's important to note that although supervisor threads can be
749 members of memory domains, they have no implications on supervisor
750 thread access to memory. Memory domain APIs may only be invoked from
751 supervisor mode.
752
753 For these reasons, on uniprocessor systems unless memory access
754 policy is managed in separate software constructions like page
755 tables, these APIs don't need to be implemented as the underlying
756 memory management hardware will be reprogrammed on context switch
757 anyway.
758
Anas Nashifee9bebf2018-02-25 22:12:35 -0500759menu "SMP Options"
Sebastian Bøef42ed322018-12-27 18:20:56 +0100760
Andy Ross042d8ec2017-12-09 08:37:20 -0800761config USE_SWITCH
Andrew Boie4f77c2a2019-11-07 12:43:29 -0800762 bool "Use new-style _arch_switch instead of arch_swap"
Sebastian Bøef42ed322018-12-27 18:20:56 +0100763 depends on USE_SWITCH_SUPPORTED
Andy Ross042d8ec2017-12-09 08:37:20 -0800764 help
Anas Nashifee9bebf2018-02-25 22:12:35 -0500765 The _arch_switch() API is a lower level context switching
Andrew Boie4f77c2a2019-11-07 12:43:29 -0800766 primitive than the original arch_swap mechanism. It is required
Anas Nashifee9bebf2018-02-25 22:12:35 -0500767 for an SMP-aware scheduler, or if the architecture does not
Andrew Boie4f77c2a2019-11-07 12:43:29 -0800768 provide arch_swap. In uniprocess situations where the
Anas Nashifee9bebf2018-02-25 22:12:35 -0500769 architecture provides both, _arch_switch incurs more somewhat
770 overhead and may be slower.
Andy Ross042d8ec2017-12-09 08:37:20 -0800771
Sebastian Bøef42ed322018-12-27 18:20:56 +0100772config USE_SWITCH_SUPPORTED
773 bool
774 help
775 Indicates whether _arch_switch() API is supported by the
776 currently enabled platform. This option should be selected by
777 platforms that implement it.
778
Andy Rossd3376f22018-01-25 14:03:02 -0800779config SMP
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200780 bool "Enable symmetric multithreading support"
Sebastian Bøe21d69572018-12-27 18:08:24 +0100781 depends on USE_SWITCH
Andy Rossd3376f22018-01-25 14:03:02 -0800782 help
Anas Nashifee9bebf2018-02-25 22:12:35 -0500783 When true, kernel will be built with SMP support, allowing
784 more than one CPU to schedule Zephyr tasks at a time.
Andy Rossd3376f22018-01-25 14:03:02 -0800785
786config MP_NUM_CPUS
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200787 int "Number of CPUs/cores"
Andy Rossd3376f22018-01-25 14:03:02 -0800788 default 1
Charles E. Youse64300a72019-09-24 13:29:41 -0400789 range 1 4
Andy Rossd3376f22018-01-25 14:03:02 -0800790 help
Anas Nashifee9bebf2018-02-25 22:12:35 -0500791 Number of multiprocessing-capable cores available to the
792 multicpu API and SMP features.
793
Andy Ross42ed12a2019-02-19 16:03:39 -0800794config SCHED_IPI_SUPPORTED
Ulf Magnusson40b49e22020-01-17 23:14:54 +0100795 bool
Andy Ross42ed12a2019-02-19 16:03:39 -0800796 help
797 True if the architecture supports a call to
Andrew Boie4f77c2a2019-11-07 12:43:29 -0800798 arch_sched_ipi() to broadcast an interrupt that will call
Andy Ross42ed12a2019-02-19 16:03:39 -0800799 z_sched_ipi() on other CPUs in the system. Required for
800 k_thread_abort() to operate with reasonable latency
801 (otherwise we might have to wait for the other thread to
802 take an interrupt, which can be arbitrarily far in the
803 future).
804
Enjia Mai7ac40aa2020-05-28 11:29:50 +0800805config TRACE_SCHED_IPI
806 bool "Enable Test IPI"
807 help
808 When true, it will add a hook into z_sched_ipi(), in order
809 to check if schedule IPI has called or not, for testing
810 purpose.
811 depends on SCHED_IPI_SUPPORTED
812 depends on MP_NUM_CPUS>1
813
Andy Rossf6d32ab2020-05-13 15:34:04 +0000814config KERNEL_COHERENCE
815 bool "Place all shared data into coherent memory"
Anas Nashife1d42722020-12-07 14:28:53 -0500816 depends on ARCH_HAS_COHERENCE
817 default y if SMP && MP_NUM_CPUS > 1
Andy Rossf6d32ab2020-05-13 15:34:04 +0000818 select THREAD_STACK_INFO
819 help
820 When available and selected, the kernel will build in a mode
821 where all shared data is placed in multiprocessor-coherent
822 (generally "uncached") memory. Thread stacks will remain
823 cached, as will application memory declared with
824 __incoherent. This is intended for Zephyr SMP kernels
825 running on cache-incoherent architectures only. Note that
826 when this is selected, there is an implicit API change that
827 assumes cache coherence to any memory passed to the kernel.
828 Code that creates kernel data structures in uncached regions
829 may fail strangely. Some assertions exist to catch these
830 mistakes, but not all circumstances can be tested.
831
Anas Nashifee9bebf2018-02-25 22:12:35 -0500832endmenu
Andy Rossd3376f22018-01-25 14:03:02 -0800833
Andy Ross08397272018-10-01 11:13:55 -0700834config TICKLESS_IDLE
Sebastian Bøe204f05b2018-12-27 19:09:09 +0100835 # NB: This option is deprecated, see TICKLESS_KERNEL and
836 # https://github.com/zephyrproject-rtos/zephyr/pull/12234
Andy Ross08397272018-10-01 11:13:55 -0700837 bool "Tickless idle"
Anas Nashifdd931f92020-09-01 18:31:40 -0400838 default y if PM || TICKLESS_CAPABLE
Andy Ross08397272018-10-01 11:13:55 -0700839 help
840 This option suppresses periodic system clock interrupts whenever the
841 kernel becomes idle. This permits the system to remain in a power
842 saving state for extended periods without having to wake up to
843 service each tick as it occurs.
844
845config TICKLESS_IDLE_THRESH
846 int "Tickless idle threshold"
847 default 3
848 depends on TICKLESS_IDLE
849 help
850 This option enables clock interrupt suppression when the kernel idles
851 for only a short period of time. It specifies the minimum number of
852 ticks that must occur before the next kernel timer expires in order
853 for suppression to happen.
854
855config TICKLESS_KERNEL
856 bool "Tickless kernel"
Andy Rossc0a184c2018-10-12 06:58:21 -0700857 default y if TICKLESS_CAPABLE
Flavio Ceolind6d4a832021-01-06 12:14:45 -0800858 depends on TICKLESS_CAPABLE
Andy Ross08397272018-10-01 11:13:55 -0700859 help
860 This option enables a fully event driven kernel. Periodic system
Sebastian Bøe204f05b2018-12-27 19:09:09 +0100861 clock interrupt generation would be stopped at all times.
Andy Ross08397272018-10-01 11:13:55 -0700862
Daniel Leung2d152ab2020-10-27 10:50:10 -0700863config TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
864 bool
865 default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr"
866 help
867 Hidden option to signal that toolchain supports generating code
868 with thread local storage.
869
Daniel Leung240beb42020-09-28 11:03:52 -0700870config THREAD_LOCAL_STORAGE
871 bool "Thread Local Storage (TLS)"
Daniel Leung2d152ab2020-10-27 10:50:10 -0700872 depends on ARCH_HAS_THREAD_LOCAL_STORAGE && TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
Daniel Leung38872582020-09-29 12:16:01 -0700873 select NEED_LIBC_MEM_PARTITION if (CPU_CORTEX_M && USERSPACE)
Daniel Leung240beb42020-09-28 11:03:52 -0700874 help
875 This option enables thread local storage (TLS) support in kernel.
876
Anas Nashif9463dc02016-12-17 17:36:20 -0500877endmenu