From f3e381dd0cf6a08c2e20c8c24f5ff8b78ac04032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 15 Nov 2014 20:09:58 +0100 Subject: [PATCH] bios_ia32: for correctness, add clobber memory for asm invlpg. * generated code is the same for x86_gcc2 and x86_64. * fixed TRACE build for mmu.cpp. --- src/system/boot/platform/bios_ia32/mmu.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/system/boot/platform/bios_ia32/mmu.cpp b/src/system/boot/platform/bios_ia32/mmu.cpp index 60a77c64c6..0247e773fa 100644 --- a/src/system/boot/platform/bios_ia32/mmu.cpp +++ b/src/system/boot/platform/bios_ia32/mmu.cpp @@ -212,7 +212,7 @@ unmap_page(addr_t virtualAddress) / (B_PAGE_SIZE * 1024)] & 0xfffff000); pageTable[(virtualAddress % (B_PAGE_SIZE * 1024)) / B_PAGE_SIZE] = 0; - asm volatile("invlpg (%0)" : : "r" (virtualAddress)); + asm volatile("invlpg (%0)" : : "r" (virtualAddress) : "memory"); } @@ -257,7 +257,7 @@ map_page(addr_t virtualAddress, addr_t physicalAddress, uint32 flags) pageTable[tableEntry] = physicalAddress | flags; - asm volatile("invlpg (%0)" : : "r" (virtualAddress)); + asm volatile("invlpg (%0)" : : "r" (virtualAddress) : "memory"); TRACE("map_page: done\n"); } @@ -653,8 +653,9 @@ mmu_init(void) gKernelArgs.cpu_kstack[0].size = KERNEL_STACK_SIZE + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE; - TRACE("kernel stack at 0x%lx to 0x%lx\n", gKernelArgs.cpu_kstack[0].start, - gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size); + TRACE("kernel stack at 0x%" B_PRIx64 " to 0x%" B_PRIx64 "\n", + gKernelArgs.cpu_kstack[0].start, gKernelArgs.cpu_kstack[0].start + + gKernelArgs.cpu_kstack[0].size); extended_memory *extMemoryBlock; uint32 extMemoryCount = get_memory_map(&extMemoryBlock);