Googler | 9398cc3 | 2022-12-02 17:21:52 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Googler | af606d2 | 2022-10-26 21:40:12 -0700 | [diff] [blame] | 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 | |
| 16 | typedef unsigned long cycles_t; |
| 17 | |
| 18 | static inline cycles_t get_cycles(void) |
| 19 | { |
Googler | 9398cc3 | 2022-12-02 17:21:52 +0800 | [diff] [blame] | 20 | if (IS_ENABLED(CONFIG_PPC_BOOK3S_601)) |
| 21 | return 0; |
| 22 | |
Googler | af606d2 | 2022-10-26 21:40:12 -0700 | [diff] [blame] | 23 | return mftb(); |
Googler | af606d2 | 2022-10-26 21:40:12 -0700 | [diff] [blame] | 24 | } |
Googler | af606d2 | 2022-10-26 21:40:12 -0700 | [diff] [blame] | 25 | |
| 26 | #endif /* __KERNEL__ */ |
| 27 | #endif /* _ASM_POWERPC_TIMEX_H */ |