mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-25 22:33:22 +00:00
bugfix: 修复因rsdp v1 v2版本问题,导致ACPI无法正常初始化的bug (#454)
bugfix: 修复因rsdp v1 v2版本问题,导致ACPI无法正常初始化的bug
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include <exception/gate.h>
|
||||
#include <mm/slab.h>
|
||||
#include <process/process.h>
|
||||
#include <arch/x86_64/driver/apic/apic_timer.h>
|
||||
|
||||
#include <process/preempt.h>
|
||||
#include <sched/sched.h>
|
||||
@ -13,10 +14,10 @@
|
||||
#include "ipi.h"
|
||||
|
||||
/* x86-64 specific MSRs */
|
||||
#define MSR_EFER 0xc0000080 /* extended feature register */
|
||||
#define MSR_STAR 0xc0000081 /* legacy mode SYSCALL target */
|
||||
#define MSR_LSTAR 0xc0000082 /* long mode SYSCALL target */
|
||||
#define MSR_SYSCALL_MASK 0xc0000084 /* EFLAGS mask for syscall */
|
||||
#define MSR_EFER 0xc0000080 /* extended feature register */
|
||||
#define MSR_STAR 0xc0000081 /* legacy mode SYSCALL target */
|
||||
#define MSR_LSTAR 0xc0000082 /* long mode SYSCALL target */
|
||||
#define MSR_SYSCALL_MASK 0xc0000084 /* EFLAGS mask for syscall */
|
||||
|
||||
static void __smp_kick_cpu_handler(uint64_t irq_num, uint64_t param, struct pt_regs *regs);
|
||||
static void __smp__flush_tlb_ipi_handler(uint64_t irq_num, uint64_t param, struct pt_regs *regs);
|
||||
@ -77,7 +78,7 @@ void smp_init()
|
||||
|
||||
kdebug("total_processor_num=%d", total_processor_num);
|
||||
// 注册接收kick_cpu功能的处理函数。(向量号200)
|
||||
ipi_regiserIPI(KICK_CPU_IRQ_NUM, NULL, &__smp_kick_cpu_handler, NULL, NULL, "IPI kick cpu");
|
||||
ipi_regiserIPI(KICK_CPU_IRQ_NUM, NULL, &__smp_kick_cpu_handler, (uint64_t)NULL, NULL, "IPI kick cpu");
|
||||
ipi_regiserIPI(FLUSH_TLB_IRQ_NUM, NULL, &__smp__flush_tlb_ipi_handler, NULL, NULL, "IPI flush tlb");
|
||||
|
||||
int core_to_start = 0;
|
||||
@ -116,7 +117,8 @@ void smp_init()
|
||||
// 连续发送两次start-up IPI
|
||||
|
||||
int r = rs_ipi_send_smp_startup(__cpu_info[i].apic_id);
|
||||
if(r){
|
||||
if (r)
|
||||
{
|
||||
kerror("Failed to send startup ipi to cpu: %d", __cpu_info[i].apic_id);
|
||||
}
|
||||
io_mfence();
|
||||
@ -158,9 +160,8 @@ void smp_ap_start_stage2()
|
||||
spin_unlock_no_preempt(&multi_core_starting_lock);
|
||||
|
||||
rs_init_syscall_64();
|
||||
|
||||
apic_timer_ap_core_init();
|
||||
|
||||
apic_timer_ap_core_init();
|
||||
|
||||
sti();
|
||||
sched();
|
||||
|
Reference in New Issue
Block a user