Fix user apps randomly crashing (APIC, GDT layout, syscall entry)
All checks were successful
Build documentation / build-and-deploy (push) Successful in 23s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 23s
This commit is contained in:
@@ -37,7 +37,11 @@ static uintptr_t amd64_current_cr3 (void) {
|
||||
|
||||
/* Load kernel CR3 as current CR3 */
|
||||
void amd64_load_kernel_cr3 (void) {
|
||||
__asm__ volatile ("movq %0, %%cr3" ::"r"(kernel_pd.cr3_paddr) : "memory");
|
||||
uintptr_t cr3 = amd64_current_cr3 ();
|
||||
|
||||
if (cr3 != kernel_pd.cr3_paddr) {
|
||||
__asm__ volatile ("movq %0, %%cr3" ::"r"(kernel_pd.cr3_paddr) : "memory");
|
||||
}
|
||||
}
|
||||
|
||||
/* Extract PML info from virtual address */
|
||||
|
||||
Reference in New Issue
Block a user