From b61ba8df4a79cb035c678913319e62340acd834b Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Tue, 17 Mar 2020 15:49:05 +0100 Subject: [PATCH] doc: reference: kernel: remove inconsistent comment for k_cpu_idle k_cpu_idle() API does not need to be invoked with interrupts unlocked; it is actually invoked with interrupts locked by the kernel CPU idling mechanism. In most architectures, the function is, actually, un-locking interrupts itself. We need to remove this comment from the documentation of the CPU idle API. We add a note about the un-locking of interrupts. Signed-off-by: Ioannis Glaropoulos --- doc/reference/kernel/other/cpu_idle.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/reference/kernel/other/cpu_idle.rst b/doc/reference/kernel/other/cpu_idle.rst index 51078e0a82c..7290ba66e15 100644 --- a/doc/reference/kernel/other/cpu_idle.rst +++ b/doc/reference/kernel/other/cpu_idle.rst @@ -25,8 +25,9 @@ Making the CPU idle =================== Making the CPU idle is simple: call the k_cpu_idle() API. The CPU will stop -executing instructions until an event occurs. Make sure interrupts are not -locked before invoking it. Most likely, it will be called within a loop. +executing instructions until an event occurs. Most likely, the function will +be called within a loop. Note that in certain architectures, upon return, +k_cpu_idle() unconditionally unmasks interrupts. .. code-block:: c