David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* Copyright Altera Corporation (C) 2014. All rights reserved. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 3 | */ |
| 4 | |
| 5 | #ifndef _ASM_NIOS2_TIMEX_H |
| 6 | #define _ASM_NIOS2_TIMEX_H |
| 7 | |
| 8 | typedef unsigned long cycles_t; |
| 9 | |
| 10 | extern cycles_t get_cycles(void); |
Olivier Deprez | 92d4c21 | 2022-12-06 15:05:30 +0100 | [diff] [blame^] | 11 | #define get_cycles get_cycles |
| 12 | |
| 13 | #define random_get_entropy() (((unsigned long)get_cycles()) ?: random_get_entropy_fallback()) |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 14 | |
| 15 | #endif |