From 90083dcb0054ba793256c3e4508085d8684f8ff0 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 15 Jun 2017 12:57:58 +0200 Subject: [PATCH] reuse irq 121 to wakeup a core --- arch/x86/kernel/apic.c | 18 ++++++------------ arch/x86/kernel/tasks.c | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index ff968c3a5..7b7aac0f3 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c @@ -918,12 +918,6 @@ int smp_start(void) // install IDT idt_install(); - /* - * we turned on paging - * => now, we are able to register our task - */ - register_task(); - // enable additional cpu features cpu_detection(); @@ -938,6 +932,12 @@ int smp_start(void) set_idle_task(); + /* + * TSS is set, pagining is enabled + * => now, we are able to register our task + */ + register_task(); + irq_enable(); atomic_int32_inc(&cpu_online); @@ -1091,11 +1091,6 @@ static void apic_shutdown(struct state * s) LOG_DEBUG("Receive shutdown interrupt\n"); } -static void apic_wakeup_handler(struct state * s) -{ - LOG_DEBUG("Receive wakeup interrupt\n"); -} - int apic_init(void) { int ret; @@ -1110,7 +1105,6 @@ int apic_init(void) irq_install_handler(80+32, apic_tlb_handler); #endif irq_install_handler(81+32, apic_shutdown); - irq_install_handler(83+32, apic_wakeup_handler); if (apic_processors[boot_processor]) LOG_INFO("Boot processor %u (ID %u)\n", boot_processor, apic_processors[boot_processor]->id); else diff --git a/arch/x86/kernel/tasks.c b/arch/x86/kernel/tasks.c index d293c6331..d063662d8 100644 --- a/arch/x86/kernel/tasks.c +++ b/arch/x86/kernel/tasks.c @@ -219,5 +219,5 @@ void wakeup_core(uint32_t core_id) return; LOG_DEBUG("wakeup core %d\n", core_id); - apic_send_ipi(core_id, 83+32); + apic_send_ipi(core_id, 121); }