cpuidle.h 450 B

123456789101112131415161718192021222324
  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. #ifndef _ASM_RISCV_CPUIDLE_H
  7. #define _ASM_RISCV_CPUIDLE_H
  8. #include <asm/barrier.h>
  9. #include <asm/processor.h>
  10. static inline void cpu_do_idle(void)
  11. {
  12. /*
  13. * Add mb() here to ensure that all
  14. * IO/MEM accesses are completed prior
  15. * to entering WFI.
  16. */
  17. mb();
  18. wait_for_interrupt();
  19. }
  20. #endif