Ulf Magnusson | bd6e044 | 2019-11-01 13:45:29 +0100 | [diff] [blame] | 1 | # Kernel configuration options |
Juan Manuel Cruz | d15251f | 2015-05-20 11:40:39 -0500 | [diff] [blame] | 2 | |
Juan Manuel Cruz | d15251f | 2015-05-20 11:40:39 -0500 | [diff] [blame] | 3 | # Copyright (c) 2014-2015 Wind River Systems, Inc. |
David B. Kinder | ac74d8b | 2017-01-18 17:01:01 -0800 | [diff] [blame] | 4 | # SPDX-License-Identifier: Apache-2.0 |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 5 | |
| 6 | menu "General Kernel Options" |
Andy Gross | bb06316 | 2017-01-29 23:53:17 -0600 | [diff] [blame] | 7 | |
Anas Nashif | 0a0c8c8 | 2018-09-17 06:58:09 -0500 | [diff] [blame] | 8 | module = KERNEL |
| 9 | module-str = kernel |
| 10 | source "subsys/logging/Kconfig.template.log_config" |
| 11 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 12 | config MULTITHREADING |
Krzysztof Chruscinski | 2165e8c | 2021-04-14 14:57:37 +0200 | [diff] [blame] | 13 | bool "Multi-threading" |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 14 | default y |
| 15 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 16 | If disabled, only the main thread is available, so a main() function |
| 17 | must be provided. Interrupts are available. Kernel objects will most |
| 18 | probably not behave as expected, especially with regards to pending, |
| 19 | since the main thread cannot pend, it being the only thread in the |
| 20 | system. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 21 | |
David Brown | 2202927 | 2019-03-15 16:01:51 -0600 | [diff] [blame] | 22 | Many drivers and subsystems will not work with this option |
| 23 | set to 'n'; disable only when you REALLY know what you are |
| 24 | doing. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 25 | |
| 26 | config NUM_COOP_PRIORITIES |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 27 | int "Number of coop priorities" if MULTITHREADING |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 28 | default 1 if !MULTITHREADING |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 29 | default 16 |
Benjamin Walsh | f955476 | 2016-12-21 15:38:54 -0500 | [diff] [blame] | 30 | range 0 128 |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 31 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 32 | Number of cooperative priorities configured in the system. Gives access |
| 33 | to priorities: |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 34 | |
| 35 | K_PRIO_COOP(0) to K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1) |
| 36 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 37 | or seen another way, priorities: |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 38 | |
| 39 | -CONFIG_NUM_COOP_PRIORITIES to -1 |
| 40 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 41 | This can be set to zero to disable cooperative scheduling. Cooperative |
| 42 | threads always preempt preemptible threads. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 43 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 44 | Each priority requires an extra 8 bytes of RAM. Each set of 32 extra |
| 45 | total priorities require an extra 4 bytes and add one possible |
| 46 | iteration to loops that search for the next thread to run. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 47 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 48 | The total number of priorities is |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 49 | |
| 50 | NUM_COOP_PRIORITIES + NUM_PREEMPT_PRIORITIES + 1 |
| 51 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 52 | The extra one is for the idle thread, which must run at the lowest |
| 53 | priority, and be the only thread at that priority. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 54 | |
| 55 | config NUM_PREEMPT_PRIORITIES |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 56 | int "Number of preemptible priorities" if MULTITHREADING |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 57 | default 0 if !MULTITHREADING |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 58 | default 15 |
Benjamin Walsh | f955476 | 2016-12-21 15:38:54 -0500 | [diff] [blame] | 59 | range 0 128 |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 60 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 61 | Number of preemptible priorities available in the system. Gives access |
| 62 | to priorities 0 to CONFIG_NUM_PREEMPT_PRIORITIES - 1. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 63 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 64 | This can be set to 0 to disable preemptible scheduling. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 65 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 66 | Each priority requires an extra 8 bytes of RAM. Each set of 32 extra |
| 67 | total priorities require an extra 4 bytes and add one possible |
| 68 | iteration to loops that search for the next thread to run. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 69 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 70 | The total number of priorities is |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 71 | |
| 72 | NUM_COOP_PRIORITIES + NUM_PREEMPT_PRIORITIES + 1 |
| 73 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 74 | The extra one is for the idle thread, which must run at the lowest |
| 75 | priority, and be the only thread at that priority. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 76 | |
| 77 | config MAIN_THREAD_PRIORITY |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 78 | int "Priority of initialization/main thread" |
Benjamin Walsh | e669559 | 2017-01-14 18:50:22 -0500 | [diff] [blame] | 79 | default -2 if !PREEMPT_ENABLED |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 80 | default 0 |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 81 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 82 | Priority at which the initialization thread runs, including the start |
| 83 | of the main() function. main() can then change its priority if desired. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 84 | |
| 85 | config COOP_ENABLED |
Ulf Magnusson | 7727d1a | 2018-06-22 02:25:43 +0200 | [diff] [blame] | 86 | def_bool (NUM_COOP_PRIORITIES != 0) |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 87 | |
| 88 | config PREEMPT_ENABLED |
Ulf Magnusson | 7727d1a | 2018-06-22 02:25:43 +0200 | [diff] [blame] | 89 | def_bool (NUM_PREEMPT_PRIORITIES != 0) |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 90 | |
| 91 | config PRIORITY_CEILING |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 92 | int "Priority inheritance ceiling" |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 93 | default 0 |
| 94 | |
Andy Ross | 7aa25fa | 2018-05-11 14:02:42 -0700 | [diff] [blame] | 95 | config NUM_METAIRQ_PRIORITIES |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 96 | int "Number of very-high priority 'preemptor' threads" |
Andy Ross | 7aa25fa | 2018-05-11 14:02:42 -0700 | [diff] [blame] | 97 | default 0 |
| 98 | help |
Ulf Magnusson | 975de21 | 2019-11-01 10:24:07 +0100 | [diff] [blame] | 99 | This defines a set of priorities at the (numerically) lowest |
| 100 | end of the range which have "meta-irq" behavior. Runnable |
| 101 | threads at these priorities will always be scheduled before |
| 102 | threads at lower priorities, EVEN IF those threads are |
| 103 | otherwise cooperative and/or have taken a scheduler lock. |
| 104 | Making such a thread runnable in any way thus has the effect |
| 105 | of "interrupting" the current task and running the meta-irq |
| 106 | thread synchronously, like an exception or system call. The |
| 107 | intent is to use these priorities to implement "interrupt |
| 108 | bottom half" or "tasklet" behavior, allowing driver |
| 109 | subsystems to return from interrupt context but be guaranteed |
| 110 | that user code will not be executed (on the current CPU) |
| 111 | until the remaining work is finished. As this breaks the |
| 112 | "promise" of non-preemptibility granted by the current API |
| 113 | for cooperative threads, this tool probably shouldn't be used |
| 114 | from application code. |
Andy Ross | 7aa25fa | 2018-05-11 14:02:42 -0700 | [diff] [blame] | 115 | |
Andy Ross | 4a2e50f | 2018-05-15 11:06:25 -0700 | [diff] [blame] | 116 | config SCHED_DEADLINE |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 117 | bool "Enable earliest-deadline-first scheduling" |
Andy Ross | 4a2e50f | 2018-05-15 11:06:25 -0700 | [diff] [blame] | 118 | help |
| 119 | This enables a simple "earliest deadline first" scheduling |
| 120 | mode where threads can set "deadline" deltas measured in |
| 121 | k_cycle_get_32() units. Priority decisions within (!!) a |
| 122 | single priority will choose the next expiring deadline and |
| 123 | not simply the least recently added thread. |
| 124 | |
Andy Ross | ab46b1b | 2019-01-30 15:00:42 -0800 | [diff] [blame] | 125 | config SCHED_CPU_MASK |
| 126 | bool "Enable CPU mask affinity/pinning API" |
| 127 | depends on SCHED_DUMB |
| 128 | help |
Anas Nashif | 8d26750 | 2019-12-18 18:10:09 -0500 | [diff] [blame] | 129 | When true, the application will have access to the |
| 130 | k_thread_cpu_mask_*() APIs which control per-CPU affinity masks in |
| 131 | SMP mode, allowing applications to pin threads to specific CPUs or |
| 132 | disallow threads from running on given CPUs. Note that as currently |
| 133 | implemented, this involves an inherent O(N) scaling in the number of |
| 134 | idle-but-runnable threads, and thus works only with the DUMB |
| 135 | scheduler (as SCALABLE and MULTIQ would see no benefit). |
Andy Ross | ab46b1b | 2019-01-30 15:00:42 -0800 | [diff] [blame] | 136 | |
Anas Nashif | 8d26750 | 2019-12-18 18:10:09 -0500 | [diff] [blame] | 137 | Note that this setting does not technically depend on SMP and is |
| 138 | implemented without it for testing purposes, but for obvious reasons |
| 139 | makes sense as an application API only where there is more than one |
| 140 | CPU. With one CPU, it's just a higher overhead version of |
| 141 | k_thread_start/stop(). |
Andy Ross | 4a2e50f | 2018-05-15 11:06:25 -0700 | [diff] [blame] | 142 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 143 | config MAIN_STACK_SIZE |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 144 | int "Size of stack for initialization and main thread" |
Adithya Baglody | 76ee02b | 2018-08-31 15:13:36 +0530 | [diff] [blame] | 145 | default 2048 if COVERAGE_GCOV |
Alexandre Bourdiol | 8925af9 | 2021-02-01 11:06:12 +0100 | [diff] [blame] | 146 | default 1024 if TEST_ARM_CORTEX_M |
Andrew Boie | 7fae2bb | 2019-07-29 20:47:42 -0700 | [diff] [blame] | 147 | default 512 if ZTEST && !(RISCV || X86) |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 148 | default 1024 |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 149 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 150 | When the initialization is complete, the thread executing it then |
| 151 | executes the main() routine, so as to reuse the stack used by the |
| 152 | initialization, which would be wasted RAM otherwise. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 153 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 154 | After initialization is complete, the thread runs main(). |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 155 | |
| 156 | config IDLE_STACK_SIZE |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 157 | int "Size of stack for idle thread" |
Wentong Wu | b991962 | 2019-04-04 17:50:30 +0800 | [diff] [blame] | 158 | default 2048 if COVERAGE_GCOV |
Mazen NEIFER | 5718676 | 2017-01-31 22:50:42 +0100 | [diff] [blame] | 159 | default 1024 if XTENSA |
Nicolas Pitre | 1f4b5dd | 2019-07-17 13:17:05 -0400 | [diff] [blame] | 160 | default 512 if RISCV |
Andrew Boie | f5a7e1a | 2020-09-02 09:20:38 -0700 | [diff] [blame] | 161 | default 384 if DYNAMIC_OBJECTS |
Andrew Boie | 3f7ae0d | 2020-11-19 12:39:16 -0800 | [diff] [blame] | 162 | default 320 if ARC || (ARM && CPU_HAS_FPU) || (X86 && MMU) |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 163 | default 256 |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 164 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 165 | Depending on the work that the idle task must do, most likely due to |
| 166 | power management but possibly to other features like system event |
| 167 | logging (e.g. logging when the system goes to sleep), the idle thread |
| 168 | may need more stack space than the default value. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 169 | |
| 170 | config ISR_STACK_SIZE |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 171 | int "ISR and initialization stack size (in bytes)" |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 172 | default 2048 |
| 173 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 174 | This option specifies the size of the stack used by interrupt |
| 175 | service routines (ISRs), and during kernel initialization. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 176 | |
Vincenzo Frascino | dfed8c4 | 2017-03-27 15:52:42 +0100 | [diff] [blame] | 177 | config THREAD_STACK_INFO |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 178 | bool "Thread stack info" |
Vincenzo Frascino | dfed8c4 | 2017-03-27 15:52:42 +0100 | [diff] [blame] | 179 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 180 | This option allows each thread to store the thread stack info into |
| 181 | the k_thread data structure. |
Vincenzo Frascino | dfed8c4 | 2017-03-27 15:52:42 +0100 | [diff] [blame] | 182 | |
Ulf Magnusson | 1f38ea7 | 2019-11-01 14:00:09 +0100 | [diff] [blame] | 183 | config THREAD_CUSTOM_DATA |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 184 | bool "Thread custom data" |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 185 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 186 | This option allows each thread to store 32 bits of custom data, |
| 187 | which can be accessed using the k_thread_custom_data_xxx() APIs. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 188 | |
Daniel Leung | fc18243 | 2018-08-16 15:42:28 -0700 | [diff] [blame] | 189 | config THREAD_USERSPACE_LOCAL_DATA |
| 190 | bool |
| 191 | depends on USERSPACE |
Daniel Leung | 62cf196 | 2020-10-05 14:54:45 -0700 | [diff] [blame] | 192 | default y if ERRNO && !ERRNO_IN_TLS |
Daniel Leung | fc18243 | 2018-08-16 15:42:28 -0700 | [diff] [blame] | 193 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 194 | config ERRNO |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 195 | bool "Enable errno support" |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 196 | default y |
| 197 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 198 | Enable per-thread errno in the kernel. Application and library code must |
| 199 | include errno.h provided by the C library (libc) to use the errno |
| 200 | symbol. The C library must access the per-thread errno via the |
Daniel Leung | 62cf196 | 2020-10-05 14:54:45 -0700 | [diff] [blame] | 201 | z_errno() symbol. |
| 202 | |
| 203 | config ERRNO_IN_TLS |
| 204 | bool "Store errno in thread local storage (TLS)" |
| 205 | depends on ERRNO && THREAD_LOCAL_STORAGE |
| 206 | default y |
| 207 | help |
| 208 | Use thread local storage to store errno instead of storing it in |
| 209 | the kernel thread struct. This avoids a syscall if userspace is enabled. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 210 | |
Andy Ross | 225c74b | 2018-06-27 11:20:50 -0700 | [diff] [blame] | 211 | choice SCHED_ALGORITHM |
| 212 | prompt "Scheduler priority queue algorithm" |
| 213 | default SCHED_DUMB |
Andy Ross | 1acd8c2 | 2018-05-03 14:51:49 -0700 | [diff] [blame] | 214 | help |
Andy Ross | 225c74b | 2018-06-27 11:20:50 -0700 | [diff] [blame] | 215 | The kernel can be built with with several choices for the |
| 216 | ready queue implementation, offering different choices between |
| 217 | code size, constant factor runtime overhead and performance |
| 218 | scaling when many threads are added. |
Andy Ross | 1acd8c2 | 2018-05-03 14:51:49 -0700 | [diff] [blame] | 219 | |
| 220 | config SCHED_DUMB |
Andy Ross | 225c74b | 2018-06-27 11:20:50 -0700 | [diff] [blame] | 221 | bool "Simple linked-list ready queue" |
Andy Ross | 1acd8c2 | 2018-05-03 14:51:49 -0700 | [diff] [blame] | 222 | help |
| 223 | When selected, the scheduler ready queue will be implemented |
| 224 | as a simple unordered list, with very fast constant time |
| 225 | performance for single threads and very low code size. |
| 226 | Choose this on systems with constrained code size that will |
| 227 | never see more than a small number (3, maybe) of runnable |
| 228 | threads in the queue at any given time. On most platforms |
| 229 | (that are not otherwise using the red/black tree) this |
| 230 | results in a savings of ~2k of code size. |
| 231 | |
Andy Ross | 225c74b | 2018-06-27 11:20:50 -0700 | [diff] [blame] | 232 | config SCHED_SCALABLE |
Andy Ross | 9f06a35 | 2018-06-28 10:38:14 -0700 | [diff] [blame] | 233 | bool "Red/black tree ready queue" |
| 234 | help |
| 235 | When selected, the scheduler ready queue will be implemented |
| 236 | as a red/black tree. This has rather slower constant-time |
| 237 | insertion and removal overhead, and on most platforms (that |
David B. Kinder | 7c89b63 | 2018-08-07 14:03:09 -0700 | [diff] [blame] | 238 | are not otherwise using the rbtree somewhere) requires an |
Andy Ross | 9f06a35 | 2018-06-28 10:38:14 -0700 | [diff] [blame] | 239 | extra ~2kb of code. But the resulting behavior will scale |
| 240 | cleanly and quickly into the many thousands of threads. Use |
| 241 | this on platforms where you may have many threads (very |
| 242 | roughly: more than 20 or so) marked as runnable at a given |
| 243 | time. Most applications don't want this. |
| 244 | |
| 245 | config SCHED_MULTIQ |
| 246 | bool "Traditional multi-queue ready queue" |
| 247 | depends on !SCHED_DEADLINE |
| 248 | help |
| 249 | When selected, the scheduler ready queue will be implemented |
| 250 | as the classic/textbook array of lists, one per priority |
| 251 | (max 32 priorities). This corresponds to the scheduler |
| 252 | algorithm used in Zephyr versions prior to 1.12. It incurs |
| 253 | only a tiny code size overhead vs. the "dumb" scheduler and |
| 254 | runs in O(1) time in almost all circumstances with very low |
| 255 | constant factor. But it requires a fairly large RAM budget |
| 256 | to store those list heads, and the limited features make it |
| 257 | incompatible with features like deadline scheduling that |
| 258 | need to sort threads more finely, and SMP affinity which |
| 259 | need to traverse the list of threads. Typical applications |
| 260 | with small numbers of runnable threads probably want the |
| 261 | DUMB scheduler. |
Andy Ross | 225c74b | 2018-06-27 11:20:50 -0700 | [diff] [blame] | 262 | |
| 263 | endchoice # SCHED_ALGORITHM |
| 264 | |
| 265 | choice WAITQ_ALGORITHM |
Andy Ross | 9f06a35 | 2018-06-28 10:38:14 -0700 | [diff] [blame] | 266 | prompt "Wait queue priority algorithm" |
| 267 | default WAITQ_DUMB |
| 268 | help |
| 269 | The wait_q abstraction used in IPC primitives to pend |
| 270 | threads for later wakeup shares the same backend data |
| 271 | structure choices as the scheduler, and can use the same |
| 272 | options. |
Andy Ross | 225c74b | 2018-06-27 11:20:50 -0700 | [diff] [blame] | 273 | |
| 274 | config WAITQ_SCALABLE |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 275 | bool "Use scalable wait_q implementation" |
Andy Ross | 225c74b | 2018-06-27 11:20:50 -0700 | [diff] [blame] | 276 | help |
| 277 | When selected, the wait_q will be implemented with a |
| 278 | balanced tree. Choose this if you expect to have many |
| 279 | threads waiting on individual primitives. There is a ~2kb |
| 280 | code size increase over WAITQ_DUMB (which may be shared with |
| 281 | SCHED_SCALABLE) if the rbtree is not used elsewhere in the |
| 282 | application, and pend/unpend operations on "small" queues |
| 283 | will be somewhat slower (though this is not generally a |
| 284 | performance path). |
| 285 | |
| 286 | config WAITQ_DUMB |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 287 | bool "Simple linked-list wait_q" |
Andy Ross | 225c74b | 2018-06-27 11:20:50 -0700 | [diff] [blame] | 288 | help |
| 289 | When selected, the wait_q will be implemented with a |
| 290 | doubly-linked list. Choose this if you expect to have only |
| 291 | a few threads blocked on any single IPC primitive. |
| 292 | |
| 293 | endchoice # WAITQ_ALGORITHM |
| 294 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 295 | menu "Kernel Debugging and Metrics" |
Anas Nashif | 8470b4d | 2018-02-25 22:18:17 -0500 | [diff] [blame] | 296 | |
| 297 | config INIT_STACKS |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 298 | bool "Initialize stack areas" |
Anas Nashif | 8470b4d | 2018-02-25 22:18:17 -0500 | [diff] [blame] | 299 | help |
| 300 | This option instructs the kernel to initialize stack areas with a |
| 301 | known value (0xaa) before they are first used, so that the high |
| 302 | water mark can be easily determined. This applies to the stack areas |
Ioannis Glaropoulos | 57b7c3d | 2018-09-25 09:48:15 +0200 | [diff] [blame] | 303 | for threads, as well as to the interrupt stack. |
Anas Nashif | 8470b4d | 2018-02-25 22:18:17 -0500 | [diff] [blame] | 304 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 305 | config BOOT_BANNER |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 306 | bool "Boot banner" |
Anas Nashif | a805c97 | 2018-01-06 14:29:47 -0500 | [diff] [blame] | 307 | default y |
Kumar Gala | a3629e8 | 2017-01-11 08:05:20 -0600 | [diff] [blame] | 308 | depends on CONSOLE_HAS_DRIVER |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 309 | select PRINTK |
| 310 | select EARLY_CONSOLE |
| 311 | help |
Sebastian Bøe | c028769 | 2018-09-26 09:46:23 +0200 | [diff] [blame] | 312 | This option outputs a banner to the console device during boot up. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 313 | |
Inaky Perez-Gonzalez | c51f73f | 2017-06-20 17:01:09 -0700 | [diff] [blame] | 314 | config BOOT_DELAY |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 315 | int "Boot delay in milliseconds" |
Inaky Perez-Gonzalez | c51f73f | 2017-06-20 17:01:09 -0700 | [diff] [blame] | 316 | default 0 |
| 317 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 318 | This option delays bootup for the specified amount of |
| 319 | milliseconds. This is used to allow serial ports to get ready |
| 320 | before starting to print information on them during boot, as |
| 321 | some systems might boot to fast for a receiving endpoint to |
| 322 | detect the new USB serial bus, enumerate it and get ready to |
| 323 | receive before it actually gets data. A similar effect can be |
| 324 | achieved by waiting for DCD on the serial port--however, not |
| 325 | all serial ports have DCD. |
Inaky Perez-Gonzalez | c51f73f | 2017-06-20 17:01:09 -0700 | [diff] [blame] | 326 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 327 | config THREAD_MONITOR |
Anas Nashif | 068e087 | 2021-03-22 17:31:33 -0400 | [diff] [blame] | 328 | bool "Thread monitoring" |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 329 | help |
| 330 | This option instructs the kernel to maintain a list of all threads |
| 331 | (excluding those that have not yet started or have already |
| 332 | terminated). |
Anas Nashif | 5755405 | 2018-03-03 02:31:05 -0600 | [diff] [blame] | 333 | |
| 334 | config THREAD_NAME |
Anas Nashif | 068e087 | 2021-03-22 17:31:33 -0400 | [diff] [blame] | 335 | bool "Thread name" |
Anas Nashif | 5755405 | 2018-03-03 02:31:05 -0600 | [diff] [blame] | 336 | help |
| 337 | This option allows to set a name for a thread. |
Andrew Boie | 38129ce | 2019-06-25 08:54:37 -0700 | [diff] [blame] | 338 | |
| 339 | config THREAD_MAX_NAME_LEN |
| 340 | int "Max length of a thread name" |
| 341 | default 32 |
| 342 | range 8 128 |
| 343 | depends on THREAD_NAME |
| 344 | help |
| 345 | Thread names get stored in the k_thread struct. Indicate the max |
| 346 | name length, including the terminating NULL byte. Reduce this value |
| 347 | to conserve memory. |
Daniel Leung | fc577c4 | 2020-08-27 13:54:14 -0700 | [diff] [blame] | 348 | |
| 349 | config INSTRUMENT_THREAD_SWITCHING |
| 350 | bool |
| 351 | |
Daniel Leung | fd7a68d | 2020-10-14 12:17:12 -0700 | [diff] [blame] | 352 | menuconfig THREAD_RUNTIME_STATS |
Daniel Leung | fc577c4 | 2020-08-27 13:54:14 -0700 | [diff] [blame] | 353 | bool "Thread runtime statistics" |
| 354 | select INSTRUMENT_THREAD_SWITCHING |
| 355 | help |
| 356 | Gather thread runtime statistics. |
| 357 | |
| 358 | For example: |
| 359 | - Thread total execution cycles |
| 360 | |
Daniel Leung | fd7a68d | 2020-10-14 12:17:12 -0700 | [diff] [blame] | 361 | if THREAD_RUNTIME_STATS |
| 362 | |
| 363 | config THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS |
| 364 | bool "Use timing functions to gather statistics" |
Daniel Leung | 1559712 | 2021-03-31 13:40:01 -0700 | [diff] [blame] | 365 | select TIMING_FUNCTIONS_NEED_AT_BOOT |
Daniel Leung | fd7a68d | 2020-10-14 12:17:12 -0700 | [diff] [blame] | 366 | help |
| 367 | Use timing functions to gather thread runtime statistics. |
| 368 | |
| 369 | Note that timing functions may use a different timer than |
| 370 | the default timer for OS timekeeping. |
| 371 | |
| 372 | endif # THREAD_RUNTIME_STATS |
| 373 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 374 | endmenu |
| 375 | |
| 376 | menu "Work Queue Options" |
| 377 | config SYSTEM_WORKQUEUE_STACK_SIZE |
| 378 | int "System workqueue stack size" |
Andrew Boie | afda764 | 2019-05-01 14:11:25 -0700 | [diff] [blame] | 379 | default 4096 if COVERAGE |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 380 | default 1024 |
| 381 | |
| 382 | config SYSTEM_WORKQUEUE_PRIORITY |
| 383 | int "System workqueue priority" |
Benjamin Walsh | e669559 | 2017-01-14 18:50:22 -0500 | [diff] [blame] | 384 | default -2 if COOP_ENABLED && !PREEMPT_ENABLED |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 385 | default 0 if !COOP_ENABLED |
| 386 | default -1 |
Paul Sokolovsky | fd55935 | 2018-06-07 16:58:11 +0300 | [diff] [blame] | 387 | help |
| 388 | By default, system work queue priority is the lowest cooperative |
| 389 | priority. This means that any work handler, once started, won't |
| 390 | be preempted by any other thread until finished. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 391 | |
Peter Bigot | dc34e7c | 2020-10-28 11:24:05 -0500 | [diff] [blame] | 392 | config SYSTEM_WORKQUEUE_NO_YIELD |
| 393 | bool "Select whether system work queue yields" |
| 394 | help |
| 395 | By default, the system work queue yields between each work item, to |
| 396 | prevent other threads from being starved. Selecting this removes |
| 397 | this yield, which may be useful if the work queue thread is |
| 398 | cooperative and a sequence of work items is expected to complete |
| 399 | without yielding. |
| 400 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 401 | endmenu |
| 402 | |
| 403 | menu "Atomic Operations" |
| 404 | config ATOMIC_OPERATIONS_BUILTIN |
| 405 | bool |
| 406 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 407 | Use the compiler builtin functions for atomic operations. This is |
| 408 | the preferred method. However, support for all arches in GCC is |
| 409 | incomplete. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 410 | |
Andy Ross | 820c94e | 2021-02-14 11:51:46 -0800 | [diff] [blame] | 411 | config ATOMIC_OPERATIONS_ARCH |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 412 | bool |
| 413 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 414 | Use when there isn't support for compiler built-ins, but you have |
| 415 | written optimized assembly code under arch/ which implements these. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 416 | |
| 417 | config ATOMIC_OPERATIONS_C |
| 418 | bool |
| 419 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 420 | Use atomic operations routines that are implemented entirely |
| 421 | in C by locking interrupts. Selected by architectures which either |
| 422 | do not have support for atomic operations in their instruction |
| 423 | set, or haven't been implemented yet during bring-up, and also |
| 424 | the compiler does not have support for the atomic __sync_* builtins. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 425 | endmenu |
| 426 | |
| 427 | menu "Timer API Options" |
| 428 | |
| 429 | config TIMESLICING |
| 430 | bool "Thread time slicing" |
| 431 | default y |
| 432 | depends on SYS_CLOCK_EXISTS && (NUM_PREEMPT_PRIORITIES != 0) |
| 433 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 434 | This option enables time slicing between preemptible threads of |
| 435 | equal priority. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 436 | |
| 437 | config TIMESLICE_SIZE |
| 438 | int "Time slice size (in ms)" |
| 439 | default 0 |
| 440 | range 0 2147483647 |
| 441 | depends on TIMESLICING |
| 442 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 443 | This option specifies the maximum amount of time a thread can execute |
| 444 | before other threads of equal priority are given an opportunity to run. |
| 445 | A time slice size of zero means "no limit" (i.e. an infinitely large |
| 446 | time slice). |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 447 | |
| 448 | config TIMESLICE_PRIORITY |
| 449 | int "Time slicing thread priority ceiling" |
| 450 | default 0 |
| 451 | range 0 NUM_PREEMPT_PRIORITIES |
| 452 | depends on TIMESLICING |
| 453 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 454 | This option specifies the thread priority level at which time slicing |
| 455 | takes effect; threads having a higher priority than this ceiling are |
| 456 | not subject to time slicing. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 457 | |
Benjamin Walsh | acc68c1 | 2017-01-29 18:57:45 -0500 | [diff] [blame] | 458 | config POLL |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 459 | bool "Async I/O Framework" |
Benjamin Walsh | acc68c1 | 2017-01-29 18:57:45 -0500 | [diff] [blame] | 460 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 461 | Asynchronous notification framework. Enable the k_poll() and |
Flavio Ceolin | aecd4ec | 2018-11-02 12:35:30 -0700 | [diff] [blame] | 462 | k_poll_signal_raise() APIs. The former can wait on multiple events |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 463 | concurrently, which can be either directly triggered or triggered by |
Anas Nashif | 5682117 | 2020-07-08 14:14:25 -0400 | [diff] [blame] | 464 | the availability of some kernel objects (semaphores and FIFOs). |
Benjamin Walsh | acc68c1 | 2017-01-29 18:57:45 -0500 | [diff] [blame] | 465 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 466 | endmenu |
| 467 | |
| 468 | menu "Other Kernel Object Options" |
Anas Nashif | 70a2e13 | 2017-01-07 08:43:32 -0500 | [diff] [blame] | 469 | |
Kamil Lazowski | 104f100 | 2020-09-11 14:27:55 +0200 | [diff] [blame] | 470 | config MEM_SLAB_TRACE_MAX_UTILIZATION |
| 471 | bool "Enable getting maximum slab utilization" |
| 472 | help |
| 473 | This adds variable to the k_mem_slab structure to hold |
| 474 | maximum utilization of the slab. |
| 475 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 476 | config NUM_MBOX_ASYNC_MSGS |
| 477 | int "Maximum number of in-flight asynchronous mailbox messages" |
| 478 | default 10 |
| 479 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 480 | This option specifies the total number of asynchronous mailbox |
| 481 | messages that can exist simultaneously, across all mailboxes |
| 482 | in the system. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 483 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 484 | Setting this option to 0 disables support for asynchronous |
| 485 | mailbox messages. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 486 | |
| 487 | config NUM_PIPE_ASYNC_MSGS |
| 488 | int "Maximum number of in-flight asynchronous pipe messages" |
| 489 | default 10 |
| 490 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 491 | This option specifies the total number of asynchronous pipe |
| 492 | messages that can exist simultaneously, across all pipes in |
| 493 | the system. |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 494 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 495 | Setting this option to 0 disables support for asynchronous |
| 496 | pipe messages. |
Andrew Boie | 945af95 | 2017-08-22 13:15:23 -0700 | [diff] [blame] | 497 | |
Daniel Leung | b5c2ff9 | 2020-09-18 14:12:51 -0700 | [diff] [blame] | 498 | config KERNEL_MEM_POOL |
| 499 | bool "Use Kernel Memory Pool" |
| 500 | default y |
| 501 | help |
| 502 | Enable the use of kernel memory pool. |
| 503 | |
| 504 | Say y if unsure. |
| 505 | |
| 506 | if KERNEL_MEM_POOL |
| 507 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 508 | config HEAP_MEM_POOL_SIZE |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 509 | int "Heap memory pool size (in bytes)" |
Youvedeep Singh | 4a8b2d2 | 2018-03-19 20:45:27 +0530 | [diff] [blame] | 510 | default 0 if !POSIX_MQUEUE |
| 511 | default 1024 if POSIX_MQUEUE |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 512 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 513 | This option specifies the size of the heap memory pool used when |
David Leach | db36b14 | 2020-07-23 14:13:09 -0500 | [diff] [blame] | 514 | dynamically allocating memory using k_malloc(). The maximum size of |
| 515 | the memory pool is only limited to available memory. A size of zero |
| 516 | means that no heap memory pool is defined. |
Pawel Dunaj | b87920b | 2019-03-11 17:28:23 +0100 | [diff] [blame] | 517 | |
Daniel Leung | b5c2ff9 | 2020-09-18 14:12:51 -0700 | [diff] [blame] | 518 | endif # KERNEL_MEM_POOL |
| 519 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 520 | endmenu |
| 521 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 522 | config ARCH_HAS_CUSTOM_SWAP_TO_MAIN |
| 523 | bool |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 524 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 525 | It's possible that an architecture port cannot use _Swap() to swap to |
| 526 | the _main() thread, but instead must do something custom. It must |
| 527 | enable this option in that case. |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 528 | |
Andy Ross | 7f42dba | 2019-01-04 12:47:21 -0800 | [diff] [blame] | 529 | config SWAP_NONATOMIC |
| 530 | bool |
| 531 | help |
| 532 | On some architectures, the _Swap() primitive cannot be made |
| 533 | atomic with respect to the irq_lock being released. That |
| 534 | is, interrupts may be received between the entry to _Swap |
| 535 | and the completion of the context switch. There are a |
| 536 | handful of workaround cases in the kernel that need to be |
| 537 | enabled when this is true. Currently, this only happens on |
| 538 | ARM when the PendSV exception priority sits below that of |
| 539 | Zephyr-handled interrupts. |
| 540 | |
Anas Nashif | 94d034d | 2017-12-21 18:23:34 -0500 | [diff] [blame] | 541 | config ARCH_HAS_CUSTOM_BUSY_WAIT |
| 542 | bool |
Anas Nashif | 94d034d | 2017-12-21 18:23:34 -0500 | [diff] [blame] | 543 | help |
| 544 | It's possible that an architecture port cannot or does not want to use |
| 545 | the provided k_busy_wait(), but instead must do something custom. It must |
| 546 | enable this option in that case. |
| 547 | |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 548 | config SYS_CLOCK_TICKS_PER_SEC |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 549 | int "System tick frequency (in ticks/second)" |
Andy Ross | 669730f | 2019-06-11 11:18:20 -0700 | [diff] [blame] | 550 | default 100 if QEMU_TARGET || SOC_POSIX |
Martin Åberg | 612dad2 | 2021-02-03 18:24:15 +0100 | [diff] [blame] | 551 | default 10000 if TICKLESS_KERNEL |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 552 | default 100 |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 553 | help |
Andy Ross | 669730f | 2019-06-11 11:18:20 -0700 | [diff] [blame] | 554 | This option specifies the nominal frequency of the system clock in Hz. |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 555 | |
Spoorthy Priya Yerabolu | e9ef078 | 2020-09-18 00:45:48 -0700 | [diff] [blame] | 556 | For asynchronous timekeeping, the kernel defines a "ticks" concept. A |
| 557 | "tick" is the internal count in which the kernel does all its internal |
Anas Nashif | 6df4405 | 2021-04-30 09:58:20 -0400 | [diff] [blame] | 558 | uptime and timeout bookkeeping. Interrupts are expected to be delivered |
Spoorthy Priya Yerabolu | e9ef078 | 2020-09-18 00:45:48 -0700 | [diff] [blame] | 559 | on tick boundaries to the extent practical, and no fractional ticks |
| 560 | are tracked. |
Benjamin Walsh | 6209218 | 2016-12-20 14:39:08 -0500 | [diff] [blame] | 561 | |
Spoorthy Priya Yerabolu | e9ef078 | 2020-09-18 00:45:48 -0700 | [diff] [blame] | 562 | The choice of tick rate is configurable by this option. Also the number |
| 563 | of cycles per tick should be chosen so that 1 millisecond is exactly |
| 564 | represented by an integral number of ticks. Defaults on most hardware |
| 565 | platforms (ones that support setting arbitrary interrupt timeouts) are |
| 566 | expected to be in the range of 10 kHz, with software emulation |
| 567 | platforms and legacy drivers using a more traditional 100 Hz value. |
Benjamin Walsh | 6209218 | 2016-12-20 14:39:08 -0500 | [diff] [blame] | 568 | |
Andy Ross | 393ec71 | 2018-09-19 11:08:19 -0700 | [diff] [blame] | 569 | Note that when available and enabled, in "tickless" mode |
| 570 | this config variable specifies the minimum available timing |
| 571 | granularity, not necessarily the number or frequency of |
| 572 | interrupts delivered to the kernel. |
| 573 | |
Carles Cufi | 201fdf0 | 2019-05-09 19:48:40 +0200 | [diff] [blame] | 574 | A value of 0 completely disables timer support in the kernel. |
| 575 | |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 576 | config SYS_CLOCK_HW_CYCLES_PER_SEC |
Peter Mitsis | d285740 | 2015-07-22 16:22:25 -0400 | [diff] [blame] | 577 | int "System clock's h/w timer frequency" |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 578 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 579 | This option specifies the frequency of the hardware timer used for the |
Ioannis Glaropoulos | 1d9bb5d | 2018-07-16 09:43:32 +0200 | [diff] [blame] | 580 | system clock (in Hz). This option is set by the SOC's or board's Kconfig file |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 581 | and the user should generally avoid modifying it via the menu configuration. |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 582 | |
Kumar Gala | 9ec2f3b | 2016-05-24 18:17:13 -0500 | [diff] [blame] | 583 | config SYS_CLOCK_EXISTS |
Andy Ross | 669730f | 2019-06-11 11:18:20 -0700 | [diff] [blame] | 584 | bool "System clock exists and is enabled" |
| 585 | default y |
Juan Manuel Cruz | c818cd2 | 2015-05-05 10:12:02 -0500 | [diff] [blame] | 586 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 587 | This option specifies that the kernel lacks timer support. |
Andy Ross | 669730f | 2019-06-11 11:18:20 -0700 | [diff] [blame] | 588 | Some device configurations can eliminate significant code if |
| 589 | this is disabled. Obviously timeout-related APIs will not |
| 590 | work. |
Juan Manuel Cruz | c818cd2 | 2015-05-05 10:12:02 -0500 | [diff] [blame] | 591 | |
Andy Ross | cfeb07e | 2020-03-05 21:14:02 -0800 | [diff] [blame] | 592 | config TIMEOUT_64BIT |
Andy Ross | 4d41703 | 2020-05-04 15:57:31 -0700 | [diff] [blame] | 593 | bool "Store kernel timeouts in 64 bit precision" |
Andy Ross | cfeb07e | 2020-03-05 21:14:02 -0800 | [diff] [blame] | 594 | default y |
| 595 | help |
| 596 | When this option is true, the k_ticks_t values passed to |
| 597 | kernel APIs will be a 64 bit quantity, allowing the use of |
| 598 | larger values (and higher precision tick rates) without fear |
Andy Ross | 4c7b77a | 2020-03-09 09:35:35 -0700 | [diff] [blame] | 599 | of overflowing the 32 bit word. This feature also gates the |
| 600 | availability of absolute timeout values (which require the |
| 601 | extra precision). |
Andy Ross | cfeb07e | 2020-03-05 21:14:02 -0800 | [diff] [blame] | 602 | |
Kumar Gala | 9ec2f3b | 2016-05-24 18:17:13 -0500 | [diff] [blame] | 603 | config XIP |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 604 | bool "Execute in place" |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 605 | help |
| 606 | This option allows the kernel to operate with its text and read-only |
David B. Kinder | d748577 | 2016-08-17 16:33:08 -0700 | [diff] [blame] | 607 | sections residing in ROM (or similar read-only memory). Not all boards |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 608 | support this option so it must be used with care; you must also |
| 609 | supply a linker command file when building your image. Enabling this |
| 610 | option increases both the code and data footprint of the image. |
| 611 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 612 | menu "Initialization Priorities" |
Anas Nashif | 3d8e86c | 2016-12-19 18:41:17 -0500 | [diff] [blame] | 613 | |
Dmitriy Korovkin | 4223ba7 | 2016-09-09 11:20:23 -0400 | [diff] [blame] | 614 | config KERNEL_INIT_PRIORITY_OBJECTS |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 615 | int "Kernel objects initialization priority" |
Dmitriy Korovkin | 4223ba7 | 2016-09-09 11:20:23 -0400 | [diff] [blame] | 616 | default 30 |
| 617 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 618 | Kernel objects use this priority for initialization. This |
| 619 | priority needs to be higher than minimal default initialization |
| 620 | priority. |
Dmitriy Korovkin | 4223ba7 | 2016-09-09 11:20:23 -0400 | [diff] [blame] | 621 | |
Dmitriy Korovkin | 57f2741 | 2015-10-26 15:56:02 -0400 | [diff] [blame] | 622 | config KERNEL_INIT_PRIORITY_DEFAULT |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 623 | int "Default init priority" |
Daniel Leung | 546b8ad | 2016-03-28 14:05:33 -0700 | [diff] [blame] | 624 | default 40 |
Dmitriy Korovkin | 57f2741 | 2015-10-26 15:56:02 -0400 | [diff] [blame] | 625 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 626 | Default minimal init priority for each init level. |
Dmitriy Korovkin | 57f2741 | 2015-10-26 15:56:02 -0400 | [diff] [blame] | 627 | |
| 628 | config KERNEL_INIT_PRIORITY_DEVICE |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 629 | int "Default init priority for device drivers" |
Daniel Leung | 546b8ad | 2016-03-28 14:05:33 -0700 | [diff] [blame] | 630 | default 50 |
Dmitriy Korovkin | 57f2741 | 2015-10-26 15:56:02 -0400 | [diff] [blame] | 631 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 632 | Device driver, that depends on common components, such as |
| 633 | interrupt controller, but does not depend on other devices, |
| 634 | uses this init priority. |
Dirk Brandewie | feee30c | 2015-09-29 07:08:58 -0700 | [diff] [blame] | 635 | |
Anas Nashif | 33118f9 | 2016-10-07 13:03:51 -0400 | [diff] [blame] | 636 | config APPLICATION_INIT_PRIORITY |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 637 | int "Default init priority for application level drivers" |
Anas Nashif | 33118f9 | 2016-10-07 13:03:51 -0400 | [diff] [blame] | 638 | default 90 |
| 639 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 640 | This priority level is for end-user drivers such as sensors and display |
| 641 | which have no inward dependencies. |
Andy Ross | 53c8599 | 2017-07-24 14:59:55 -0700 | [diff] [blame] | 642 | |
Anas Nashif | 8470b4d | 2018-02-25 22:18:17 -0500 | [diff] [blame] | 643 | |
| 644 | endmenu |
| 645 | |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 646 | menu "Security Options" |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 647 | |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 648 | config STACK_CANARIES |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 649 | bool "Compiler stack canaries" |
David Leach | aa91113 | 2019-11-12 16:02:05 -0600 | [diff] [blame] | 650 | depends on ENTROPY_GENERATOR || TEST_RANDOM_GENERATOR |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 651 | help |
Sebastian Bøe | 5a58da5 | 2019-01-21 14:02:55 +0100 | [diff] [blame] | 652 | This option enables compiler stack canaries. |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 653 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 654 | If stack canaries are supported by the compiler, it will emit |
| 655 | extra code that inserts a canary value into the stack frame when |
| 656 | a function is entered and validates this value upon exit. |
| 657 | Stack corruption (such as that caused by buffer overflow) results |
| 658 | in a fatal error condition for the running entity. |
| 659 | Enabling this option can result in a significant increase |
| 660 | in footprint and an associated decrease in performance. |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 661 | |
Sebastian Bøe | 5a58da5 | 2019-01-21 14:02:55 +0100 | [diff] [blame] | 662 | If stack canaries are not supported by the compiler an error |
| 663 | will occur at build time. |
Leandro Pereira | b007b64 | 2017-10-17 17:01:48 -0700 | [diff] [blame] | 664 | |
| 665 | config EXECUTE_XOR_WRITE |
| 666 | bool "Enable W^X for memory partitions" |
| 667 | depends on USERSPACE |
| 668 | depends on ARCH_HAS_EXECUTABLE_PAGE_BIT |
| 669 | default y |
| 670 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 671 | When enabled, will enforce that a writable page isn't executable |
| 672 | and vice versa. This might not be acceptable in all scenarios, |
| 673 | so this option is given for those unafraid of shooting themselves |
| 674 | in the foot. |
Leandro Pereira | b007b64 | 2017-10-17 17:01:48 -0700 | [diff] [blame] | 675 | |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 676 | If unsure, say Y. |
Leandro Pereira | b007b64 | 2017-10-17 17:01:48 -0700 | [diff] [blame] | 677 | |
Andrew Boie | 83752c1 | 2018-03-02 07:54:13 -0800 | [diff] [blame] | 678 | config STACK_POINTER_RANDOM |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 679 | int "Initial stack pointer randomization bounds" |
Andrew Boie | 83752c1 | 2018-03-02 07:54:13 -0800 | [diff] [blame] | 680 | depends on !STACK_GROWS_UP |
Flavio Ceolin | fbeaa0a | 2020-02-25 15:32:39 -0800 | [diff] [blame] | 681 | depends on MULTITHREADING |
Flavio Ceolin | 2e0095a | 2019-04-30 10:45:48 -0700 | [diff] [blame] | 682 | depends on TEST_RANDOM_GENERATOR || ENTROPY_HAS_DRIVER |
Andrew Boie | 83752c1 | 2018-03-02 07:54:13 -0800 | [diff] [blame] | 683 | default 0 |
| 684 | help |
| 685 | This option performs a limited form of Address Space Layout |
| 686 | Randomization by offsetting some random value to a thread's |
| 687 | initial stack pointer upon creation. This hinders some types of |
| 688 | security attacks by making the location of any given stack frame |
| 689 | non-deterministic. |
| 690 | |
| 691 | This feature can waste up to the specified size in bytes the stack |
| 692 | region, which is carved out of the total size of the stack region. |
| 693 | A reasonable minimum value would be around 100 bytes if this can |
| 694 | be spared. |
| 695 | |
| 696 | This is currently only implemented for systems whose stack pointers |
| 697 | grow towards lower memory addresses. |
| 698 | |
Andrew Boie | 576ebf4 | 2019-03-07 15:56:55 -0800 | [diff] [blame] | 699 | config BOUNDS_CHECK_BYPASS_MITIGATION |
| 700 | bool "Enable bounds check bypass mitigations for speculative execution" |
| 701 | depends on USERSPACE |
| 702 | help |
| 703 | Untrusted parameters from user mode may be used in system calls to |
| 704 | index arrays during speculative execution, also known as the Spectre |
| 705 | V1 vulnerability. When enabled, various macros defined in |
| 706 | misc/speculation.h will insert fence instructions or other appropriate |
| 707 | mitigations after bounds checking any array index parameters passed |
| 708 | in from untrusted sources (user mode threads). When disabled, these |
| 709 | macros do nothing. |
Juan Manuel Cruz | 0e301cc | 2015-03-11 12:44:14 -0600 | [diff] [blame] | 710 | endmenu |
| 711 | |
Chunlin Han | e9c9702 | 2017-07-07 20:29:30 +0800 | [diff] [blame] | 712 | config MAX_DOMAIN_PARTITIONS |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 713 | int "Maximum number of partitions per memory domain" |
Chunlin Han | e9c9702 | 2017-07-07 20:29:30 +0800 | [diff] [blame] | 714 | default 16 |
| 715 | range 0 255 |
| 716 | depends on USERSPACE |
| 717 | help |
Anas Nashif | 429c2a4 | 2017-12-13 10:08:21 -0500 | [diff] [blame] | 718 | Configure the maximum number of partitions per memory domain. |
Chunlin Han | e9c9702 | 2017-07-07 20:29:30 +0800 | [diff] [blame] | 719 | |
Andrew Boie | bc35b0b | 2020-08-19 13:11:47 -0700 | [diff] [blame] | 720 | config ARCH_MEM_DOMAIN_DATA |
| 721 | bool |
| 722 | depends on USERSPACE |
| 723 | help |
| 724 | This hidden option is selected by the target architecture if |
| 725 | architecture-specific data is needed on a per memory domain basis. |
| 726 | If so, the architecture defines a 'struct arch_mem_domain' which is |
| 727 | embedded within every struct k_mem_domain. The architecture |
| 728 | must also define the arch_mem_domain_init() function to set this up |
| 729 | when a memory domain is created. |
| 730 | |
| 731 | Typical uses might be a set of page tables for that memory domain. |
| 732 | |
Andrew Boie | 00f71b0 | 2020-08-25 17:02:38 -0700 | [diff] [blame] | 733 | config ARCH_MEM_DOMAIN_SYNCHRONOUS_API |
| 734 | bool |
| 735 | depends on USERSPACE |
| 736 | help |
| 737 | This hidden option is selected by the target architecture if |
| 738 | modifying a memory domain's partitions at runtime, or changing |
| 739 | a memory domain's thread membership requires synchronous calls |
| 740 | into the architecture layer. |
| 741 | |
| 742 | If enabled, the architecture layer must implement the following |
| 743 | APIs: |
| 744 | |
| 745 | arch_mem_domain_thread_add |
| 746 | arch_mem_domain_thread_remove |
| 747 | arch_mem_domain_partition_remove |
| 748 | arch_mem_domain_partition_add |
Andrew Boie | 00f71b0 | 2020-08-25 17:02:38 -0700 | [diff] [blame] | 749 | |
| 750 | It's important to note that although supervisor threads can be |
| 751 | members of memory domains, they have no implications on supervisor |
| 752 | thread access to memory. Memory domain APIs may only be invoked from |
| 753 | supervisor mode. |
| 754 | |
| 755 | For these reasons, on uniprocessor systems unless memory access |
| 756 | policy is managed in separate software constructions like page |
| 757 | tables, these APIs don't need to be implemented as the underlying |
| 758 | memory management hardware will be reprogrammed on context switch |
| 759 | anyway. |
| 760 | |
Anas Nashif | ee9bebf | 2018-02-25 22:12:35 -0500 | [diff] [blame] | 761 | menu "SMP Options" |
Sebastian Bøe | f42ed32 | 2018-12-27 18:20:56 +0100 | [diff] [blame] | 762 | |
Andy Ross | 042d8ec | 2017-12-09 08:37:20 -0800 | [diff] [blame] | 763 | config USE_SWITCH |
Andrew Boie | 4f77c2a | 2019-11-07 12:43:29 -0800 | [diff] [blame] | 764 | bool "Use new-style _arch_switch instead of arch_swap" |
Sebastian Bøe | f42ed32 | 2018-12-27 18:20:56 +0100 | [diff] [blame] | 765 | depends on USE_SWITCH_SUPPORTED |
Andy Ross | 042d8ec | 2017-12-09 08:37:20 -0800 | [diff] [blame] | 766 | help |
Anas Nashif | ee9bebf | 2018-02-25 22:12:35 -0500 | [diff] [blame] | 767 | The _arch_switch() API is a lower level context switching |
Andrew Boie | 4f77c2a | 2019-11-07 12:43:29 -0800 | [diff] [blame] | 768 | primitive than the original arch_swap mechanism. It is required |
Anas Nashif | ee9bebf | 2018-02-25 22:12:35 -0500 | [diff] [blame] | 769 | for an SMP-aware scheduler, or if the architecture does not |
Andrew Boie | 4f77c2a | 2019-11-07 12:43:29 -0800 | [diff] [blame] | 770 | provide arch_swap. In uniprocess situations where the |
Anas Nashif | ee9bebf | 2018-02-25 22:12:35 -0500 | [diff] [blame] | 771 | architecture provides both, _arch_switch incurs more somewhat |
| 772 | overhead and may be slower. |
Andy Ross | 042d8ec | 2017-12-09 08:37:20 -0800 | [diff] [blame] | 773 | |
Sebastian Bøe | f42ed32 | 2018-12-27 18:20:56 +0100 | [diff] [blame] | 774 | config USE_SWITCH_SUPPORTED |
| 775 | bool |
| 776 | help |
| 777 | Indicates whether _arch_switch() API is supported by the |
| 778 | currently enabled platform. This option should be selected by |
| 779 | platforms that implement it. |
| 780 | |
Andy Ross | d3376f2 | 2018-01-25 14:03:02 -0800 | [diff] [blame] | 781 | config SMP |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 782 | bool "Enable symmetric multithreading support" |
Sebastian Bøe | 21d6957 | 2018-12-27 18:08:24 +0100 | [diff] [blame] | 783 | depends on USE_SWITCH |
Andy Ross | d3376f2 | 2018-01-25 14:03:02 -0800 | [diff] [blame] | 784 | help |
Anas Nashif | ee9bebf | 2018-02-25 22:12:35 -0500 | [diff] [blame] | 785 | When true, kernel will be built with SMP support, allowing |
| 786 | more than one CPU to schedule Zephyr tasks at a time. |
Andy Ross | d3376f2 | 2018-01-25 14:03:02 -0800 | [diff] [blame] | 787 | |
Guennadi Liakhovetski | 8d07b77 | 2021-04-01 13:46:57 +0200 | [diff] [blame] | 788 | config SMP_BOOT_DELAY |
| 789 | bool "Delay booting secondary cores" |
| 790 | depends on SMP |
| 791 | help |
| 792 | By default Zephyr will boot all available CPUs during start up. |
| 793 | Select this option to skip this and allow architecture code boot |
| 794 | secondary CPUs at a later time. |
| 795 | |
Andy Ross | d3376f2 | 2018-01-25 14:03:02 -0800 | [diff] [blame] | 796 | config MP_NUM_CPUS |
Ulf Magnusson | 8cf8db3 | 2018-08-14 16:19:20 +0200 | [diff] [blame] | 797 | int "Number of CPUs/cores" |
Andy Ross | d3376f2 | 2018-01-25 14:03:02 -0800 | [diff] [blame] | 798 | default 1 |
Charles E. Youse | 64300a7 | 2019-09-24 13:29:41 -0400 | [diff] [blame] | 799 | range 1 4 |
Andy Ross | d3376f2 | 2018-01-25 14:03:02 -0800 | [diff] [blame] | 800 | help |
Anas Nashif | ee9bebf | 2018-02-25 22:12:35 -0500 | [diff] [blame] | 801 | Number of multiprocessing-capable cores available to the |
| 802 | multicpu API and SMP features. |
| 803 | |
Andy Ross | 42ed12a | 2019-02-19 16:03:39 -0800 | [diff] [blame] | 804 | config SCHED_IPI_SUPPORTED |
Ulf Magnusson | 40b49e2 | 2020-01-17 23:14:54 +0100 | [diff] [blame] | 805 | bool |
Andy Ross | 42ed12a | 2019-02-19 16:03:39 -0800 | [diff] [blame] | 806 | help |
| 807 | True if the architecture supports a call to |
Andrew Boie | 4f77c2a | 2019-11-07 12:43:29 -0800 | [diff] [blame] | 808 | arch_sched_ipi() to broadcast an interrupt that will call |
Andy Ross | 42ed12a | 2019-02-19 16:03:39 -0800 | [diff] [blame] | 809 | z_sched_ipi() on other CPUs in the system. Required for |
| 810 | k_thread_abort() to operate with reasonable latency |
| 811 | (otherwise we might have to wait for the other thread to |
| 812 | take an interrupt, which can be arbitrarily far in the |
| 813 | future). |
| 814 | |
Enjia Mai | 7ac40aa | 2020-05-28 11:29:50 +0800 | [diff] [blame] | 815 | config TRACE_SCHED_IPI |
| 816 | bool "Enable Test IPI" |
| 817 | help |
| 818 | When true, it will add a hook into z_sched_ipi(), in order |
| 819 | to check if schedule IPI has called or not, for testing |
| 820 | purpose. |
| 821 | depends on SCHED_IPI_SUPPORTED |
| 822 | depends on MP_NUM_CPUS>1 |
| 823 | |
Andy Ross | f6d32ab | 2020-05-13 15:34:04 +0000 | [diff] [blame] | 824 | config KERNEL_COHERENCE |
| 825 | bool "Place all shared data into coherent memory" |
Anas Nashif | e1d4272 | 2020-12-07 14:28:53 -0500 | [diff] [blame] | 826 | depends on ARCH_HAS_COHERENCE |
| 827 | default y if SMP && MP_NUM_CPUS > 1 |
Andy Ross | f6d32ab | 2020-05-13 15:34:04 +0000 | [diff] [blame] | 828 | select THREAD_STACK_INFO |
| 829 | help |
| 830 | When available and selected, the kernel will build in a mode |
| 831 | where all shared data is placed in multiprocessor-coherent |
| 832 | (generally "uncached") memory. Thread stacks will remain |
| 833 | cached, as will application memory declared with |
| 834 | __incoherent. This is intended for Zephyr SMP kernels |
| 835 | running on cache-incoherent architectures only. Note that |
| 836 | when this is selected, there is an implicit API change that |
| 837 | assumes cache coherence to any memory passed to the kernel. |
| 838 | Code that creates kernel data structures in uncached regions |
| 839 | may fail strangely. Some assertions exist to catch these |
| 840 | mistakes, but not all circumstances can be tested. |
| 841 | |
Anas Nashif | ee9bebf | 2018-02-25 22:12:35 -0500 | [diff] [blame] | 842 | endmenu |
Andy Ross | d3376f2 | 2018-01-25 14:03:02 -0800 | [diff] [blame] | 843 | |
Andy Ross | 0839727 | 2018-10-01 11:13:55 -0700 | [diff] [blame] | 844 | config TICKLESS_KERNEL |
| 845 | bool "Tickless kernel" |
Andy Ross | c0a184c | 2018-10-12 06:58:21 -0700 | [diff] [blame] | 846 | default y if TICKLESS_CAPABLE |
Flavio Ceolin | d6d4a83 | 2021-01-06 12:14:45 -0800 | [diff] [blame] | 847 | depends on TICKLESS_CAPABLE |
Andy Ross | 0839727 | 2018-10-01 11:13:55 -0700 | [diff] [blame] | 848 | help |
| 849 | This option enables a fully event driven kernel. Periodic system |
Sebastian Bøe | 204f05b | 2018-12-27 19:09:09 +0100 | [diff] [blame] | 850 | clock interrupt generation would be stopped at all times. |
Andy Ross | 0839727 | 2018-10-01 11:13:55 -0700 | [diff] [blame] | 851 | |
Daniel Leung | 2d152ab | 2020-10-27 10:50:10 -0700 | [diff] [blame] | 852 | config TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE |
| 853 | bool |
| 854 | default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" |
| 855 | help |
| 856 | Hidden option to signal that toolchain supports generating code |
| 857 | with thread local storage. |
| 858 | |
Daniel Leung | 240beb4 | 2020-09-28 11:03:52 -0700 | [diff] [blame] | 859 | config THREAD_LOCAL_STORAGE |
| 860 | bool "Thread Local Storage (TLS)" |
Daniel Leung | 2d152ab | 2020-10-27 10:50:10 -0700 | [diff] [blame] | 861 | depends on ARCH_HAS_THREAD_LOCAL_STORAGE && TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE |
Daniel Leung | 3887258 | 2020-09-29 12:16:01 -0700 | [diff] [blame] | 862 | select NEED_LIBC_MEM_PARTITION if (CPU_CORTEX_M && USERSPACE) |
Daniel Leung | 240beb4 | 2020-09-28 11:03:52 -0700 | [diff] [blame] | 863 | help |
| 864 | This option enables thread local storage (TLS) support in kernel. |
| 865 | |
Anas Nashif | 9463dc0 | 2016-12-17 17:36:20 -0500 | [diff] [blame] | 866 | endmenu |