2017-01-23 00:21:34 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Cadence Design Systems, Inc.
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2019-06-26 00:25:12 +08:00
|
|
|
#include <debug/tracing.h>
|
2017-01-23 00:21:34 +08:00
|
|
|
|
2019-09-22 07:17:23 +08:00
|
|
|
void z_arch_cpu_idle(void)
|
2017-01-23 00:21:34 +08:00
|
|
|
{
|
2019-09-19 15:25:19 +08:00
|
|
|
sys_trace_idle();
|
2017-02-16 06:57:29 +08:00
|
|
|
__asm__ volatile ("waiti 0");
|
2017-01-23 00:21:34 +08:00
|
|
|
}
|
2019-09-22 07:17:23 +08:00
|
|
|
void z_arch_cpu_atomic_idle(unsigned int key)
|
2017-01-23 00:21:34 +08:00
|
|
|
{
|
2019-09-19 15:25:19 +08:00
|
|
|
sys_trace_idle();
|
2017-02-16 06:57:29 +08:00
|
|
|
__asm__ volatile ("waiti 0\n\t"
|
|
|
|
"wsr.ps %0\n\t"
|
|
|
|
"rsync" :: "a"(key));
|
2017-01-23 00:21:34 +08:00
|
|
|
}
|