xref: /openbmc/linux/arch/riscv/include/asm/cpuidle.h (revision 173940b3)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2021 Allwinner Ltd
4  * Copyright (C) 2021 Western Digital Corporation or its affiliates.
5  */
6 
7 #ifndef _ASM_RISCV_CPUIDLE_H
8 #define _ASM_RISCV_CPUIDLE_H
9 
10 #include <asm/barrier.h>
11 #include <asm/processor.h>
12 
13 static inline void cpu_do_idle(void)
14 {
15 	/*
16 	 * Add mb() here to ensure that all
17 	 * IO/MEM accesses are completed prior
18 	 * to entering WFI.
19 	 */
20 	mb();
21 	wait_for_interrupt();
22 }
23 
24 #endif
25