kernel: Nullability check for current_cpu when changing memory page table
This attempts to fix segfault in some tests where page table is set before initializing cpu core (intended behaviour? might be worth a check...) see: src/tests/core/arm/arm_test_common.cpp see: src/tests/core/arm/dyncom/arm_dyncom_vfp_tests.cpp
This commit is contained in:
parent
dbfd830695
commit
ed095f3bff
1 changed files with 3 additions and 1 deletions
|
@ -53,8 +53,10 @@ void KernelSystem::SetCurrentProcess(std::shared_ptr<Process> process) {
|
||||||
|
|
||||||
void KernelSystem::SetCurrentMemPageTable(Memory::PageTable* page_table) {
|
void KernelSystem::SetCurrentMemPageTable(Memory::PageTable* page_table) {
|
||||||
memory.SetCurrentPageTable(page_table);
|
memory.SetCurrentPageTable(page_table);
|
||||||
|
if (current_cpu != nullptr) {
|
||||||
current_cpu->PageTableChanged(); // notify the CPU the page table in memory has changed
|
current_cpu->PageTableChanged(); // notify the CPU the page table in memory has changed
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void KernelSystem::SetCPU(std::shared_ptr<ARM_Interface> cpu) {
|
void KernelSystem::SetCPU(std::shared_ptr<ARM_Interface> cpu) {
|
||||||
current_cpu = cpu;
|
current_cpu = cpu;
|
||||||
|
|
Loading…
Reference in a new issue