- set the apic_timer_x factor variable to slowdown apic timer in
virtual machines
u32_t ticks_per_us;
const u8_t cpu = cpuid;
- ticks_per_us = lapic_bus_freq[cpu] / 1000000;
+ ticks_per_us = (lapic_bus_freq[cpu] / 1000000) * config_apic_timer_x;
lvtt = APIC_TDCR_1;
lapic_write(LAPIC_TIMER_DCR, lvtt);
u32_t lapic_ticks_per_clock_tick;
const u8_t cpu = cpuid;
- lapic_ticks_per_clock_tick = lapic_bus_freq[cpu] / freq;
+ lapic_ticks_per_clock_tick = (lapic_bus_freq[cpu] / freq) * config_apic_timer_x;
lvtt = APIC_TDCR_1;
lapic_write(LAPIC_TIMER_DCR, lvtt);
#ifdef CONFIG_APIC
EXTERN int config_no_apic; /* optionaly turn off apic */
+EXTERN int config_apic_timer_x; /* apic timer slowdown factor */
#endif
EXTERN u64_t cpu_hz[CONFIG_MAX_CPUS];
config_no_apic = atoi(value);
else
config_no_apic = 1;
+ value = env_get("apic_timer_x");
+ if(value)
+ config_apic_timer_x = atoi(value);
+ else
+ config_apic_timer_x = 1;
#endif
#ifdef CONFIG_WATCHDOG