mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
kernel/time: provide uptime based on APIC timer ticks
This commit is contained in:
parent
068fbf2cb6
commit
900d17fa40
1 changed files with 4 additions and 0 deletions
|
@ -81,6 +81,10 @@ static inline uint64_t get_clock_tick(void)
|
|||
*/
|
||||
static inline void sleep(unsigned int sec) { timer_wait(sec*TIMER_FREQ); }
|
||||
|
||||
/** @brief Get milliseconds since system boot
|
||||
*/
|
||||
static inline uint64_t get_uptime() { return (get_clock_tick() * 1000) / TIMER_FREQ; }
|
||||
|
||||
static inline int timer_deadline(uint32_t t) { return apic_timer_deadline(t); }
|
||||
|
||||
static inline void timer_disable(void) { apic_disable_timer(); }
|
||||
|
|
Loading…
Add table
Reference in a new issue