1.. _timer-hld: 2 3Timer 4##### 5 6Because ACRN is a flexible, lightweight reference hypervisor, we provide 7limited timer management services: 8 9- Only the LAPIC tsc-deadline timer is supported as the clock source. 10 11- A timer can only be added on the logical CPU for a process or thread. Timer 12 scheduling or timer migrating is not supported. 13 14How It Works 15************ 16 17When the system boots, we check that the hardware supports the LAPIC 18tsc-deadline timer by checking CPUID.01H:ECX.TSC_Deadline[bit 24]. If 19support is missing, we output an error message and panic the hypervisor. 20If supported, we register the timer interrupt callback that raises a 21timer softirq on each logical CPU and sets the LAPIC timer mode to 22tsc-deadline timer mode by writing the local APIC LVT register. 23 24Data Structures and APIs 25************************ 26 27Interfaces Design 28================= 29 30.. doxygenfunction:: initialize_timer 31 :project: Project ACRN 32 33.. doxygenfunction:: timer_expired 34 :project: Project ACRN 35 36.. doxygenfunction:: timer_is_started 37 :project: Project ACRN 38 39.. doxygenfunction:: add_timer 40 :project: Project ACRN 41 42.. doxygenfunction:: del_timer 43 :project: Project ACRN 44 45.. doxygenfunction:: timer_init 46 :project: Project ACRN 47 48.. doxygenfunction:: calibrate_tsc 49 :project: Project ACRN 50 51.. doxygenfunction:: cpu_ticks 52 :project: Project ACRN 53 54.. doxygenfunction:: cpu_tickrate 55 :project: Project ACRN 56 57.. doxygenfunction:: us_to_ticks 58 :project: Project ACRN 59 60.. doxygenfunction:: ticks_to_us 61 :project: Project ACRN 62 63.. doxygenfunction:: ticks_to_ms 64 :project: Project ACRN 65 66.. doxygenfunction:: udelay 67 :project: Project ACRN 68