mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 00:46:31 +00:00
将内核定位到高地址(存在bug,中断时会访问低地址)
This commit is contained in:
@ -425,6 +425,19 @@ void apic_init()
|
||||
|
||||
apic_io_apic_init();
|
||||
|
||||
// get RCBA address
|
||||
io_out32(0xcf8, 0x8000f8f0);
|
||||
uint32_t RCBA_phys = io_in32(0xcfc);
|
||||
|
||||
// 获取RCBA寄存器的地址
|
||||
if (RCBA_phys > 0xfec00000 && RCBA_phys < 0xfee00000)
|
||||
RCBA_vaddr = SPECIAL_MEMOEY_MAPPING_VIRT_ADDR_BASE + RCBA_phys;
|
||||
else
|
||||
{
|
||||
RCBA_vaddr = 0;
|
||||
kwarn("Cannot get RCBA address. RCBA_phys=%#010lx", RCBA_phys);
|
||||
|
||||
}
|
||||
sti();
|
||||
}
|
||||
/**
|
||||
|
@ -73,6 +73,8 @@
|
||||
// 分频配置寄存器(定时器专用)
|
||||
#define LOCAL_APIC_OFFSET_Local_APIC_CLKDIV 0x3e0
|
||||
|
||||
uint32_t RCBA_vaddr = 0;// RCBA寄存器的虚拟地址
|
||||
|
||||
/*
|
||||
|
||||
1: LVT CMCI
|
||||
|
Reference in New Issue
Block a user