processor.h 437 B

123456789101112131415161718192021
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef __ASM_VDSO_PROCESSOR_H
  3. #define __ASM_VDSO_PROCESSOR_H
  4. #ifndef __ASSEMBLY__
  5. #include <asm/barrier.h>
  6. static inline void cpu_relax(void)
  7. {
  8. #ifdef __riscv_muldiv
  9. int dummy;
  10. /* In lieu of a halt instruction, induce a long-latency stall. */
  11. __asm__ __volatile__ ("div %0, %0, zero" : "=r" (dummy));
  12. #endif
  13. barrier();
  14. }
  15. #endif /* __ASSEMBLY__ */
  16. #endif /* __ASM_VDSO_PROCESSOR_H */