summaryrefslogtreecommitdiffstats
path: root/tests/stubs/timestamp.c
blob: 3fd739f6f535ed8d281529e5ac0d42289d6c8910 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* SPDX-License-Identifier: GPL-2.0-only */

#include "stubs/timestamp.h"

static uint64_t timestamp_value = 0;
static int timestamp_tick_freq_mhz_value = 1;

/* Provides way to control timestamp value */
void dummy_timestamp_set(uint64_t v)
{
	timestamp_value = v;
}

/* Provides way to control timestamp tick frequency MHz value */
void dummy_timestamp_tick_freq_mhz_set(int v)
{
	timestamp_tick_freq_mhz_value = v;
}

/* Reimplementation of timestamp getter to control behaviour */
uint64_t timestamp_get(void)
{
	return timestamp_value;
}

int timestamp_tick_freq_mhz(void)
{
	return timestamp_tick_freq_mhz_value;
}