From 1aac2c8e23b3f32199bc49fee80243e6a510db93 Mon Sep 17 00:00:00 2001 From: NAKAMURA Gou Date: Fri, 11 Mar 2016 18:41:29 +0900 Subject: [PATCH] add CPU timer initialization (refs #402) There is no actual initialization in x86 now. The initialization rely on hardware reset and Linux initialization. --- arch/x86/kernel/cpu.c | 18 ++++++++++++++++++ kernel/ap.c | 5 +++++ lib/include/ihk/cpu.h | 4 ++++ 3 files changed, 27 insertions(+) diff --git a/arch/x86/kernel/cpu.c b/arch/x86/kernel/cpu.c index 2339a235..ce1b7add 100644 --- a/arch/x86/kernel/cpu.c +++ b/arch/x86/kernel/cpu.c @@ -1517,3 +1517,21 @@ ihk_mc_user_context_t *lookup_user_context(struct thread *thread) return uctx; } /* lookup_user_context() */ + +void init_tick(void) +{ + dkprintf("init_tick():\n"); + return; +} + +void init_delay(void) +{ + dkprintf("init_delay():\n"); + return; +} + +void sync_tick(void) +{ + dkprintf("sync_tick():\n"); + return; +} diff --git a/kernel/ap.c b/kernel/ap.c index 7a66ff62..7194873d 100644 --- a/kernel/ap.c +++ b/kernel/ap.c @@ -31,10 +31,12 @@ static volatile int ap_stop = 1; static void ap_wait(void) { + init_tick(); while (ap_stop) { barrier(); cpu_pause(); } + sync_tick(); kmalloc_init(); sched_init(); @@ -53,7 +55,9 @@ static void ap_wait(void) void ap_start(void) { + init_tick(); ap_stop = 0; + sync_tick(); } void ap_init(void) @@ -63,6 +67,7 @@ void ap_init(void) int bsp_hw_id; ihk_mc_init_ap(); + init_delay(); cpu_info = ihk_mc_get_cpu_info(); bsp_hw_id = ihk_mc_get_hardware_processor_id(); diff --git a/lib/include/ihk/cpu.h b/lib/include/ihk/cpu.h index ae167683..78e41504 100644 --- a/lib/include/ihk/cpu.h +++ b/lib/include/ihk/cpu.h @@ -104,4 +104,8 @@ extern unsigned int ihk_ikc_irq_apicid; extern int gettime_local_support; +void init_tick(void); +void init_delay(void); +void sync_tick(void); + #endif