Path: blob/master/tools/arch/riscv/include/asm/vdso/processor.h
26310 views
/* SPDX-License-Identifier: GPL-2.0-only */1#ifndef __ASM_VDSO_PROCESSOR_H2#define __ASM_VDSO_PROCESSOR_H34#ifndef __ASSEMBLY__56#include <asm-generic/barrier.h>78static inline void cpu_relax(void)9{10#ifdef __riscv_muldiv11int dummy;12/* In lieu of a halt instruction, induce a long-latency stall. */13__asm__ __volatile__ ("div %0, %0, zero" : "=r" (dummy));14#endif1516#ifdef CONFIG_TOOLCHAIN_HAS_ZIHINTPAUSE17/*18* Reduce instruction retirement.19* This assumes the PC changes.20*/21__asm__ __volatile__ ("pause");22#else23/* Encoding of the pause instruction */24__asm__ __volatile__ (".4byte 0x100000F");25#endif26barrier();27}2829#endif /* __ASSEMBLY__ */3031#endif /* __ASM_VDSO_PROCESSOR_H */323334