2017-01-23 00:21:34 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Cadence Design Systems, Inc.
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2020-02-06 22:14:51 +08:00
|
|
|
#include <tracing/tracing.h>
|
2017-01-23 00:21:34 +08:00
|
|
|
|
2019-11-08 04:43:29 +08:00
|
|
|
void 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-11-08 04:43:29 +08:00
|
|
|
void 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
|
|
|
}
|