2017-01-22 17:21:34 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Cadence Design Systems, Inc.
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2023-07-19 22:36:27 +02:00
|
|
|
#include <zephyr/toolchain.h>
|
2022-05-06 10:49:15 +02:00
|
|
|
#include <zephyr/tracing/tracing.h>
|
2017-01-22 17:21:34 +01:00
|
|
|
|
2023-11-03 06:53:54 +01:00
|
|
|
#ifndef CONFIG_ARCH_CPU_IDLE_CUSTOM
|
2019-11-07 21:43:29 +01:00
|
|
|
void arch_cpu_idle(void)
|
2017-01-22 17:21:34 +01:00
|
|
|
{
|
2019-09-19 09:25:19 +02:00
|
|
|
sys_trace_idle();
|
2017-02-15 23:57:29 +01:00
|
|
|
__asm__ volatile ("waiti 0");
|
2017-01-22 17:21:34 +01:00
|
|
|
}
|
2023-11-03 06:53:54 +01:00
|
|
|
#endif
|
2021-08-13 18:29:31 +02:00
|
|
|
|
2019-11-07 21:43:29 +01:00
|
|
|
void arch_cpu_atomic_idle(unsigned int key)
|
2017-01-22 17:21:34 +01:00
|
|
|
{
|
2019-09-19 09:25:19 +02:00
|
|
|
sys_trace_idle();
|
2017-02-15 23:57:29 +01:00
|
|
|
__asm__ volatile ("waiti 0\n\t"
|
|
|
|
"wsr.ps %0\n\t"
|
|
|
|
"rsync" :: "a"(key));
|
2017-01-22 17:21:34 +01:00
|
|
|
}
|