kernel: add k_cpu_idle/k_cpu_atomic_idle()
nano_cpu_idle/nano_cpu_atomic_idle were not ported to the unified kernel, and only the old APIs were available. There was no real impact since, in the unified kernel, only the idle thread should really be doing power management. However, with a single-threaded kernel, these functions can be useful again. The kernel internals now make use of these APIs instead of the legacy ones. Change-Id: Ie8a6396ba378d3ddda27b8dd32fa4711bf53eb36 Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
b889fa8b20
commit
c3a2bbba16
21 changed files with 247 additions and 48 deletions
|
@ -2925,6 +2925,32 @@ extern void k_free(void *ptr);
|
|||
* @} end defgroup heap_apis
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Make the CPU idle.
|
||||
*
|
||||
* This function makes the CPU idle until an event wakes it up.
|
||||
*
|
||||
* In a regular system, the idle thread should be the only thread responsible
|
||||
* for making the CPU idle and triggering any type of power management.
|
||||
* However, in some more constrained systems, such as a single-threaded system,
|
||||
* the only thread would be responsible for this if needed.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
extern void k_cpu_idle(void);
|
||||
|
||||
/**
|
||||
* @brief Make the CPU idle in an atomic fashion.
|
||||
*
|
||||
* Similar to k_cpu_idle(), but called with interrupts locked if operations
|
||||
* must be done atomically before making the CPU idle.
|
||||
*
|
||||
* @param key Interrupt locking key obtained from irq_lock().
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
extern void k_cpu_atomic_idle(unsigned int key);
|
||||
|
||||
/*
|
||||
* legacy.h must be before arch/cpu.h to allow the ioapic/loapic drivers to
|
||||
* hook into the device subsystem, which itself uses nanokernel semaphores,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue