zephyr/arch/riscv/core/cpu_idle.c

23 lines
402 B
C

/*
* Copyright (c) 2016 Jean-Paul Etienne <fractalclone@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/irq.h>
#include <zephyr/tracing/tracing.h>
void __weak arch_cpu_idle(void)
{
sys_trace_idle();
irq_unlock(MSTATUS_IEN);
__asm__ volatile("wfi");
}
void __weak arch_cpu_atomic_idle(unsigned int key)
{
sys_trace_idle();
irq_unlock(key);
__asm__ volatile("wfi");
}