1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 */ 5 #ifndef _ASM_TIMEX_H 6 #define _ASM_TIMEX_H 7 8 #ifdef __KERNEL__ 9 10 #include <linux/compiler.h> 11 12 #include <asm/cpu.h> 13 #include <asm/cpu-features.h> 14 15 /* 16 * Standard way to access the cycle counter. 17 * Currently only used on SMP for scheduling. 18 * 19 * We know that all SMP capable CPUs have cycle counters. 20 */ 21 22 typedef unsigned long cycles_t; 23 24 #define get_cycles get_cycles 25 26 static inline cycles_t get_cycles(void) 27 { 28 return drdtime(); 29 } 30 31 #endif /* __KERNEL__ */ 32 33 #endif /* _ASM_TIMEX_H */ 34