vma: Implement VMA.

+ acpi: Start implementation of table lookup
+ cpu: Remove useless argument to "cpu_invalidate_page"
+ cpu (x86_64): Removed "read_cr3"
+ arch/x86_64: Replace debug with trace for GDT & IDT initialization.
This commit is contained in:
RaphProductions 2025-05-19 17:56:29 +02:00
parent 16246cc167
commit dcea7360d2
18 changed files with 205 additions and 34 deletions

View file

@ -25,23 +25,7 @@ void cpu_load_pm(pagemap_t pm) {
__asm__ volatile("mov %0, %%cr3" : : "r"(physical((uint64_t)pm)) : "memory");
}
static uint64_t read_cr3(void)
{
unsigned long val;
asm volatile ( "mov %%cr3, %0" : "=r"(val) );
return val;
}
void cpu_invalidate_page(pagemap_t pm, uint64_t vaddr) {
uint64_t cr3 = read_cr3();
if (physical((uint64_t)pm) != cr3)
{
// load the provided PM in cr3, invalidate the page and return into the previous cr3.
cpu_load_pm(pm);
asm volatile ( "invlpg (%0)" : : "b"(vaddr) : "memory" );
cpu_load_pm((pagemap_t)cr3);
return;
}
void cpu_invalidate_page(uint64_t vaddr) {
asm volatile ( "invlpg (%0)" : : "b"(vaddr) : "memory" );
}