blob: 6047402b0a4dbbf0e2f4710eca5eeca4915a9ad2 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* 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{
Olivier Deprez0e641232021-09-23 10:07:05 +020020 if (IS_ENABLED(CONFIG_PPC_BOOK3S_601))
David Brazdil0f672f62019-12-10 10:32:29 +000021 return 0;
22
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000023 return mftb();
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000024}
25
26#endif /* __KERNEL__ */
27#endif /* _ASM_POWERPC_TIMEX_H */