Timer API¶
API for reading and manipulating the machine timer.
Functions
-
int
metal_timer_get_cyclecount
(int hartid, unsigned long long *cyclecount)¶ Read the machine cycle count.
- Return
0 upon success
- Parameters
hartid
: The hart ID to read the cycle count ofcyclecount
: The variable to hold the value
-
int
metal_timer_get_timebase_frequency
(int hartid, unsigned long long *timebase)¶ Get the machine timebase frequency.
- Return
0 upon success
- Parameters
hartid
: The hart ID to read the timebase oftimebase
: The variable to hold the value
-
int
metal_timer_set_tick
(int hartid, int second)¶ Set the machine timer tick interval in seconds.
- Return
0 upon success
- Parameters
hartid
: The hart ID to read the timebase ofsecond
: The number of seconds to set the tick interval to