mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
hv/mod_timer: separate delay functions from the timer module
Modules that use udelay() should include "delay.h" explicitly. Tracked-On: #5920 Signed-off-by: Rong Liu <rong2.liu@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <asm/rtcm.h>
|
||||
#include <reloc.h>
|
||||
#include <ticks.h>
|
||||
#include <delay.h>
|
||||
|
||||
#define CPU_UP_TIMEOUT 100U /* millisecond */
|
||||
#define CPU_DOWN_TIMEOUT 100U /* millisecond */
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include <asm/cpu_caps.h>
|
||||
#include <asm/lapic.h>
|
||||
#include <asm/apicreg.h>
|
||||
#include <delay.h>
|
||||
|
||||
/* intr_lapic_icr_delivery_mode */
|
||||
#define INTR_LAPIC_ICR_FIXED 0x0U
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include <asm/ioapic.h>
|
||||
#include <asm/vtd.h>
|
||||
#include <asm/lapic.h>
|
||||
#include <delay.h>
|
||||
|
||||
struct cpu_context cpu_ctx;
|
||||
|
||||
|
@@ -200,16 +200,3 @@ void timer_init(void)
|
||||
init_tsc_deadline_timer();
|
||||
}
|
||||
}
|
||||
|
||||
void udelay(uint32_t us)
|
||||
{
|
||||
uint64_t dest_tsc, delta_tsc;
|
||||
|
||||
/* Calculate number of ticks to wait */
|
||||
delta_tsc = us_to_ticks(us);
|
||||
dest_tsc = rdtsc() + delta_tsc;
|
||||
|
||||
/* Loop until time expired */
|
||||
while (rdtsc() < dest_tsc) {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user