Jakub Czapiga | e0c60f3 | 2020-10-09 10:07:47 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include "stubs/timestamp.h" |
| 4 | |
| 5 | static uint64_t timestamp_value = 0; |
| 6 | static int timestamp_tick_freq_mhz_value = 1; |
| 7 | |
| 8 | /* Provides way to control timestamp value */ |
| 9 | void dummy_timestamp_set(uint64_t v) |
| 10 | { |
| 11 | timestamp_value = v; |
| 12 | } |
| 13 | |
| 14 | /* Provides way to control timestamp tick frequency MHz value */ |
| 15 | void dummy_timestamp_tick_freq_mhz_set(int v) |
| 16 | { |
| 17 | timestamp_tick_freq_mhz_value = v; |
| 18 | } |
| 19 | |
| 20 | /* Reimplementation of timestamp getter to control behaviour */ |
| 21 | uint64_t timestamp_get(void) |
| 22 | { |
| 23 | return timestamp_value; |
| 24 | } |
| 25 | |
| 26 | int timestamp_tick_freq_mhz(void) |
| 27 | { |
| 28 | return timestamp_tick_freq_mhz_value; |
| 29 | } |