From: Ankur Arora ankur.a.arora@oracle.com
virt inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IB7PU3 CVE: NA
----------------------------------------------------
Adds some constants and functions related to xloops, cycles computation to a new header.
No functional change.
Signed-off-by: Ankur Arora ankur.a.arora@oracle.com Signed-off-by: lishusen lishusen2@huawei.com --- arch/arm64/include/asm/delay-const.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 arch/arm64/include/asm/delay-const.h
diff --git a/arch/arm64/include/asm/delay-const.h b/arch/arm64/include/asm/delay-const.h new file mode 100644 index 000000000000..610283ba8712 --- /dev/null +++ b/arch/arm64/include/asm/delay-const.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _ASM_DELAY_CONST_H +#define _ASM_DELAY_CONST_H + +#include <asm/param.h> /* For HZ */ + +/* 2**32 / 1000000000 (rounded up) */ +#define __nsecs_to_xloops_mult 0x5UL + +extern unsigned long loops_per_jiffy; + +#define NSECS_TO_CYCLES(time_nsecs) \ + ((((time_nsecs) * __nsecs_to_xloops_mult) * loops_per_jiffy * HZ) >> 32) + +#endif /* _ASM_DELAY_CONST_H */