summaryrefslogtreecommitdiff
path: root/src/arch/riscv/arch_timer.c
blob: af5db5ed610279eec7c620cf62f555a24cd4bd43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* SPDX-License-Identifier: GPL-2.0-only */
/* This file is part of the coreboot project. */

#include <device/mmio.h>
#include <arch/encoding.h>
#include <console/console.h>
#include <stddef.h>
#include <timer.h>
#include <mcall.h>

void timer_monotonic_get(struct mono_time *mt)
{
	if (HLS()->time == NULL)
		die("time not set in HLS");
	mono_time_set_usecs(mt, (long)read64((void *)(HLS()->time)));
}