Rename TIME_MS_DELTA to CYCLES_PER_MS

TIME_MS_DELTA is not clear enough, rename it to CYCLES_PER_MS.

Signed-off-by: Qi Yadong <yadong.qi@intel.com>
This commit is contained in:
Qi Yadong 2018-03-29 08:55:09 +08:00 committed by Jack Ren
parent 8502c8eff3
commit 8d67f292ef
5 changed files with 6 additions and 6 deletions

View File

@ -317,7 +317,7 @@ static bool setup_trusty_info(struct vcpu *vcpu,
mem->first_page.startup_param.size_of_this_struct = mem->first_page.startup_param.size_of_this_struct =
sizeof(struct trusty_startup_param); sizeof(struct trusty_startup_param);
mem->first_page.startup_param.mem_size = mem_size; mem->first_page.startup_param.mem_size = mem_size;
mem->first_page.startup_param.tsc_per_ms = TIME_MS_DELTA; mem->first_page.startup_param.tsc_per_ms = CYCLES_PER_MS;
mem->first_page.startup_param.trusty_mem_base = TRUSTY_EPT_REBASE_GPA; mem->first_page.startup_param.trusty_mem_base = TRUSTY_EPT_REBASE_GPA;
/* According to trusty boot protocol, it will use RDI as the /* According to trusty boot protocol, it will use RDI as the

View File

@ -105,7 +105,7 @@
#define IOMMU_LOCK(u) spinlock_obtain(&((u)->lock)) #define IOMMU_LOCK(u) spinlock_obtain(&((u)->lock))
#define IOMMU_UNLOCK(u) spinlock_release(&((u)->lock)) #define IOMMU_UNLOCK(u) spinlock_release(&((u)->lock))
#define DMAR_OP_TIMEOUT TIME_MS_DELTA #define DMAR_OP_TIMEOUT CYCLES_PER_MS
#define DMAR_WAIT_COMPLETION(offset, condition, status) \ #define DMAR_WAIT_COMPLETION(offset, condition, status) \
do { \ do { \
@ -114,7 +114,7 @@
status = iommu_read32(dmar_uint, offset); \ status = iommu_read32(dmar_uint, offset); \
if (condition) \ if (condition) \
break; \ break; \
ASSERT((rdtsc() - start < TIME_MS_DELTA), \ ASSERT((rdtsc() - start < CYCLES_PER_MS), \
"DMAR OP Timeout!"); \ "DMAR OP Timeout!"); \
asm volatile ("pause" ::: "memory"); \ asm volatile ("pause" ::: "memory"); \
} \ } \

View File

@ -231,6 +231,6 @@ void console_setup_timer(void)
{ {
/* Start an one-shot timer */ /* Start an one-shot timer */
if (add_timer(console_timer_callback, 0, if (add_timer(console_timer_callback, 0,
rdtsc() + TIME_MS_DELTA * CONSOLE_KICK_TIMER_TIMEOUT) < 0) rdtsc() + CYCLES_PER_MS * CONSOLE_KICK_TIMER_TIMEOUT) < 0)
pr_err("Failed to add console kick timer"); pr_err("Failed to add console kick timer");
} }

View File

@ -67,7 +67,7 @@ int udiv32(uint32_t dividend, uint32_t divisor, struct udiv_result *res);
extern uint64_t tsc_clock_freq; extern uint64_t tsc_clock_freq;
#define US_TO_TICKS(x) ((x)*tsc_clock_freq/1000000UL) #define US_TO_TICKS(x) ((x)*tsc_clock_freq/1000000UL)
#define TIME_MS_DELTA US_TO_TICKS(1000UL) #define CYCLES_PER_MS US_TO_TICKS(1000UL)
#define TICKS_TO_US(x) ((((x) * (1000000UL >> 8)) / tsc_clock_freq) << 8) #define TICKS_TO_US(x) ((((x) * (1000000UL >> 8)) / tsc_clock_freq) << 8)
#define TICKS_TO_MS(x) (((x) * 1000UL) / tsc_clock_freq) #define TICKS_TO_MS(x) (((x) * 1000UL) / tsc_clock_freq)

View File

@ -36,7 +36,7 @@ void udelay(int loop_count)
uint64_t dest_tsc, delta_tsc; uint64_t dest_tsc, delta_tsc;
/* Calculate number of ticks to wait */ /* Calculate number of ticks to wait */
delta_tsc = TIME_MS_DELTA * loop_count; delta_tsc = CYCLES_PER_MS * loop_count;
dest_tsc = rdtsc() + delta_tsc; dest_tsc = rdtsc() + delta_tsc;
/* Loop until time expired */ /* Loop until time expired */