gettimeofday(): an implementation based on CPU invariant TSC support

This commit is contained in:
Balazs Gerofi
2015-08-24 23:41:31 +02:00
parent b8f166e608
commit 9ae5bcf46e
8 changed files with 193 additions and 33 deletions

View File

@ -24,18 +24,21 @@
#include <process.h>
#include <init.h>
#include <march.h>
#include <cls.h>
int num_processors = 1;
static volatile int ap_stop = 1;
extern void zero_tsc(void);
static void ap_wait(void)
{
wrmsr(MSR_IA32_TIME_STAMP_COUNTER, 0);
while (ap_stop) {
barrier();
cpu_pause();
}
zero_tsc();
kmalloc_init();
sched_init();
@ -64,8 +67,6 @@ void ap_init(void)
ihk_mc_init_ap();
wrmsr(MSR_IA32_TIME_STAMP_COUNTER, 0);
cpu_info = ihk_mc_get_cpu_info();
bsp_hw_id = ihk_mc_get_hardware_processor_id();