blob: 5405cb2fe65a27a319e0ea1b3e5814fe37715b48 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_POWERPC_TIMEX_H
3#define _ASM_POWERPC_TIMEX_H
4
5#ifdef __KERNEL__
6
7/*
8 * PowerPC architecture timex specifications
9 */
10
11#include <asm/cputable.h>
12#include <asm/reg.h>
13
14#define CLOCK_TICK_RATE 1024000 /* Underlying HZ */
15
16typedef unsigned long cycles_t;
17
18static inline cycles_t get_cycles(void)
19{
20 if (IS_ENABLED(CONFIG_PPC_BOOK3S_601))
21 return 0;
22
23 return mftb();
24}
25#define get_cycles get_cycles
26
27#endif /* __KERNEL__ */
28#endif /* _ASM_POWERPC_TIMEX_H */