2020-12-01 18:29:58 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020 Antony Pavlov <antonynpavlov@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2022-05-06 16:49:15 +08:00
|
|
|
#include <zephyr/irq.h>
|
2020-12-01 18:29:58 +08:00
|
|
|
|
2022-05-06 16:49:15 +08:00
|
|
|
#include <zephyr/tracing/tracing.h>
|
2020-12-01 18:29:58 +08:00
|
|
|
|
|
|
|
static ALWAYS_INLINE void mips_idle(unsigned int key)
|
|
|
|
{
|
|
|
|
sys_trace_idle();
|
|
|
|
|
|
|
|
/* unlock interrupts */
|
|
|
|
irq_unlock(key);
|
|
|
|
|
|
|
|
/* wait for interrupt */
|
|
|
|
__asm__ volatile("wait");
|
|
|
|
}
|
|
|
|
|
|
|
|
void arch_cpu_idle(void)
|
|
|
|
{
|
|
|
|
mips_idle(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void arch_cpu_atomic_idle(unsigned int key)
|
|
|
|
{
|
|
|
|
mips_idle(key);
|
|
|
|
}
|