1 /* Copyright 2018 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
9 * @brief API for reading and manipulating the machine timer
13 * @brief Read the machine cycle count
14 * @param hartid The hart ID to read the cycle count of
15 * @param cyclecount The variable to hold the value
16 * @return 0 upon success
18 int metal_timer_get_cyclecount(int hartid, unsigned long long *cyclecount);
21 * @brief Get the machine timebase frequency
22 * @param hartid The hart ID to read the timebase of
23 * @param timebase The variable to hold the value
24 * @return 0 upon success
26 int metal_timer_get_timebase_frequency(int hartid, unsigned long long *timebase);
29 * @brief Set the machine timer tick interval in seconds
30 * @param hartid The hart ID to read the timebase of
31 * @param second The number of seconds to set the tick interval to
32 * @return 0 upon success
34 int metal_timer_set_tick(int hartid, int second);