1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (C) 2020 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 #include <asm/loongarchregs.h> 15 16 /* 17 * Standard way to access the cycle counter. 18 * Currently only used on SMP for scheduling. 19 * 20 * We know that all SMP capable CPUs have cycle counters. 21 */ 22 23 typedef unsigned long cycles_t; 24 25 #define get_cycles get_cycles 26 get_cycles(void)27static inline cycles_t get_cycles(void) 28 { 29 return drdtime(); 30 } 31 32 #endif /* __KERNEL__ */ 33 34 #endif /* _ASM_TIMEX_H */ 35