diff options
Diffstat (limited to 'src/mem/vmm.c')
-rw-r--r-- | src/mem/vmm.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mem/vmm.c b/src/mem/vmm.c index 77b06a8..f62eadf 100644 --- a/src/mem/vmm.c +++ b/src/mem/vmm.c @@ -18,8 +18,8 @@ vmm_map(unsigned int paddr, unsigned int vaddr) { if (paddr & 0xfff || vaddr & 0xfff) return 0; - const unsigned table_idx = vaddr >> 22; // high 10 bits - const unsigned entry_idx = (vaddr >> 12) & 0x3ff; // low 10 bits + const unsigned table_idx = vaddr >> 22; /* high 10 bits */ + const unsigned entry_idx = (vaddr >> 12) & 0x3ff; /* low 10 bits */ if (k_pagedir[table_idx].present == 0) return 0; struct TableEntry *table = (struct TableEntry *)to_vaddr(k_pagedir[table_idx].address << 12); @@ -34,12 +34,8 @@ vmm_map(unsigned int paddr, unsigned int vaddr) void alloc4M() { - // enable pse in cr4 - asm volatile(R"( - movl %cr4, %eax - orl $0x10, %eax - movl %eax, %cr4 -)"); + /* enable pse in cr4 */ + __asm__("movl %cr4, %eax; orl $0x10, %eax; movl %eax, %cr4"); struct DirectoryEntry4MB *directory = (struct DirectoryEntry4MB *)&k_pagedir[0x301]; directory->address_low = 0x1; |