Skip to content

Commit a6dcf33

Browse files
laurenmurphyx64nashif
authored andcommitted
doc: misc fixes
Makes miscellaneous fixes to kernel and usermode documentation, such as fixing broken links and adding clarifying wording. Signed-off-by: Lauren Murphy <[email protected]>
1 parent 1510600 commit a6dcf33

File tree

7 files changed

+30
-18
lines changed

7 files changed

+30
-18
lines changed

doc/reference/kernel/data_passing/message_queues.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,11 @@ in an asynchronous manner.
202202
.. note::
203203
A message queue can be used to transfer large data items, if desired.
204204
However, this can increase interrupt latency as interrupts are locked
205-
while a data item is written or read. It is usually preferable to transfer
206-
large data items by exchanging a pointer to the data item, rather than the
207-
data item itself. The kernel's memory map and memory pool object types
208-
can be helpful for data transfers of this sort.
205+
while a data item is written or read. The time to write or read a data item
206+
increases linearly with its size since the item is copied in its entirety
207+
to or from the buffer in memory. For this reason, it is usually preferable
208+
to transfer large data items by exchanging a pointer to the data item,
209+
rather than the data item itself.
209210

210211
A synchronous transfer can be achieved by using the kernel's mailbox
211212
object type.

doc/reference/kernel/data_passing/pipes.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ Use a pipe to send streams of data between threads.
164164
.. note::
165165
A pipe can be used to transfer long streams of data if desired. However
166166
it is often preferable to send pointers to large data items to avoid
167-
copying the data. The kernel's memory map and memory pool object types
168-
can be helpful for data transfers of this sort.
167+
copying the data.
169168

170169
Configuration Options
171170
*********************

doc/reference/kernel/data_passing/stacks.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ A stack must be initialized before it can be used. This sets its queue to empty.
3232
A data value can be **added** to a stack by a thread or an ISR.
3333
The value is given directly to a waiting thread, if one exists;
3434
otherwise the value is added to the LIFO's queue.
35-
The kernel does *not* detect attempts to add a data value to a stack
36-
that has already reached its maximum quantity of queued values.
3735

3836
.. note::
39-
Adding a data value to a stack that is already full will result in
40-
array overflow, and lead to unpredictable behavior.
37+
If :kconfig:`CONFIG_NO_RUNTIME_CHECKS` is enabled, the kernel will *not* detect
38+
and prevent attempts to add a data value to a stack that has already reached
39+
its maximum quantity of queued values. Adding a data value to a stack that is
40+
already full will result in array overflow, and lead to unpredictable behavior.
4141

4242
A data value may be **removed** from a stack by a thread.
4343
If the stack's queue is empty a thread may choose to wait for it to be given.

doc/reference/kernel/other/float.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ an extra 72 bytes of stack space where the callee-saved FP context can
113113
be saved.
114114

115115
`Lazy Stacking
116-
<http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0298a/DAFGGBJD.html>`_
116+
<https://developer.arm.com/documentation/dai0298/a>`_
117117
is currently enabled in Zephyr applications on ARM Cortex-M
118118
architecture, minimizing interrupt latency, when the floating
119119
point context is active.

doc/reference/kernel/synchronization/semaphores.rst

+7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ Any number of threads may wait on an unavailable semaphore simultaneously.
3737
When the semaphore is given, it is taken by the highest priority thread
3838
that has waited longest.
3939

40+
.. note::
41+
You may initialize a "full" semaphore (count equal to limit) to limit the number
42+
of threads able to execute the critical section at the same time. You may also
43+
initialize an empty semaphore (count equal to 0, with a limit greater than 0)
44+
to create a gate through which no waiting thread may pass until the semaphore
45+
is incremented. All standard use cases of the common semaphore are supported.
46+
4047
.. note::
4148
The kernel does allow an ISR to take a semaphore, however the ISR must
4249
not attempt to wait if the semaphore is unavailable.

doc/reference/kernel/threads/index.rst

+8-3
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ A thread's initial priority value can be altered up or down after the thread
245245
has been started. Thus it is possible for a preemptible thread to become
246246
a cooperative thread, and vice versa, by changing its priority.
247247

248+
.. note::
249+
The scheduler does not make heuristic decisions to re-prioritize threads.
250+
Thread priorities are set and changed only at the application's request.
251+
248252
The kernel supports a virtually unlimited number of thread priority levels.
249253
The configuration options :kconfig:`CONFIG_NUM_COOP_PRIORITIES` and
250254
:kconfig:`CONFIG_NUM_PREEMPT_PRIORITIES` specify the number of priority
@@ -269,9 +273,10 @@ When enabled (see :kconfig:`CONFIG_NUM_METAIRQ_PRIORITIES`), there is a special
269273
subclass of cooperative priorities at the highest (numerically lowest)
270274
end of the priority space: meta-IRQ threads. These are scheduled
271275
according to their normal priority, but also have the special ability
272-
to preempt all other threads (and other meta-irq threads) at lower
276+
to preempt all other threads (and other meta-IRQ threads) at lower
273277
priorities, even if those threads are cooperative and/or have taken a
274-
scheduler lock.
278+
scheduler lock. Meta-IRQ threads are still threads, however,
279+
and can still be interrupted by any hardware interrupt.
275280

276281
This behavior makes the act of unblocking a meta-IRQ thread (by any
277282
means, e.g. creating it, calling k_sem_give(), etc.) into the
@@ -284,7 +289,7 @@ run before the current CPU returns into application code.
284289

285290
Unlike similar features in other OSes, meta-IRQ threads are true
286291
threads and run on their own stack (which must be allocated normally),
287-
not the per-CPU interrupt stack. Design work to enable the use of the
292+
not the per-CPU interrupt stack. Design work to enable the use of the
288293
IRQ stack on supported architectures is pending.
289294

290295
Note that because this breaks the promise made to cooperative

doc/reference/usermode/memory_domain.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Memory Protection Design
44
########################
55

66
Zephyr's memory protection design is geared towards microcontrollers with MPU
7-
(Memory Protection Unit) hardware. We do support some architectures which have
8-
a paged MMU (Memory Management Unit), but in that case the MMU is used like
9-
an MPU with an identity page table.
7+
(Memory Protection Unit) hardware. We do support some architectures, such as x86,
8+
which have a paged MMU (Memory Management Unit), but in that case the MMU is
9+
used like an MPU with an identity page table.
1010

1111
All of the discussion below will be using MPU terminology; systems with MMUs
1212
can be considered to have an MPU with an unlimited number of programmable
@@ -46,7 +46,7 @@ text/ro-data, this is sufficient for the boot time configuration.
4646
Hardware Stack Overflow
4747
***********************
4848

49-
``CONFIG_HW_STACK_PROTECTION`` is an optional feature which detects stack
49+
:kconfig:`CONFIG_HW_STACK_PROTECTION` is an optional feature which detects stack
5050
buffer overflows when the system is running in supervisor mode. This
5151
catches issues when the entire stack buffer has overflowed, and not
5252
individual stack frames, use compiler-assisted :kconfig:`CONFIG_STACK_CANARIES`

0 commit comments

Comments
 (0)