Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* 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 | |
| 16 | typedef unsigned long cycles_t; |
| 17 | |
| 18 | static inline cycles_t get_cycles(void) |
| 19 | { |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 20 | return mftb(); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 21 | } |
Olivier Deprez | 92d4c21 | 2022-12-06 15:05:30 +0100 | [diff] [blame^] | 22 | #define get_cycles get_cycles |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 23 | |
| 24 | #endif /* __KERNEL__ */ |
| 25 | #endif /* _ASM_POWERPC_TIMEX_H */ |