kernel: add function to calculate delta between two cycle timestamps
This commit is contained in:
@@ -36,6 +36,10 @@ extern void cpu_set_available(unsigned int cpu_id);
|
||||
extern void cpu_set_online(unsigned int cpu_id);
|
||||
|
||||
extern cycles_t get_cycles(void);
|
||||
static inline cycles_t cycles_diff(cycles_t then, cycles_t now)
|
||||
{
|
||||
return now >= then ? now - then : (CYCLES_MAX - then) + now;
|
||||
}
|
||||
|
||||
#define irq_enable() ml_int_enable()
|
||||
#define irq_disable() ml_int_disable()
|
||||
|
||||
Reference in New Issue
Block a user