From 3dac4b35a45e4e67a8f577e2eb21a457e9908c94 Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Wed, 9 Jul 2008 21:46:35 +0000 Subject: [PATCH] fixed problem with extremely slow work on some machines git-svn-id: svn://kolibrios.org@821 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/memory.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/trunk/core/memory.inc b/kernel/trunk/core/memory.inc index 16adfec298..aad54f1dd9 100644 --- a/kernel/trunk/core/memory.inc +++ b/kernel/trunk/core/memory.inc @@ -1159,8 +1159,14 @@ proc init_mtrr mov ecx, 0x2FF wrmsr ;disable all MTRR - stdcall set_mtrr, dword 0,dword 0,[MEM_AMOUNT],MEM_WB - stdcall set_mtrr, dword 1,[LFBAddress],[LFBSize],MEM_WC + mov eax, [MEM_AMOUNT] +; round eax up to next power of 2 + dec eax + bsr ecx, eax + mov eax, 2 + shl eax, cl + stdcall set_mtrr, edx,edx,eax,MEM_WB + stdcall set_mtrr, 1,[LFBAddress],[LFBSize],MEM_WC xor edx, edx xor eax, eax mov ecx, 0x204