xref: /optee_os/core/arch/riscv/include/kernel/delay_arch.h (revision fab37ad7dc719c507661870039f7bcf91f5a6029)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright 2022-2023 NXP
4  */
5 
6 #ifndef __KERNEL_DELAY_ARCH_H
7 #define __KERNEL_DELAY_ARCH_H
8 
9 #include <riscv.h>
10 #include <stdint.h>
11 
delay_cnt_freq(void)12 static inline unsigned int delay_cnt_freq(void)
13 {
14 	return read_cntfrq();
15 }
16 
delay_cnt_read(void)17 static inline uint64_t delay_cnt_read(void)
18 {
19 	return read_time();
20 }
21 #endif /*__KERNEL_DELAY_ARCH_H*/
22