From e85c475db096d1601b995f0561f56415b1aab0ba Mon Sep 17 00:00:00 2001 From: "Iliya Mihailov (Ghost)" Date: Wed, 20 Dec 2006 15:51:31 +0000 Subject: [PATCH] mutipliers for AMD : AthonXP-M, Athlon64, Athlon64-M Intel: Dothan, Yonah, Conroe, Merom git-svn-id: svn://kolibrios.org@241 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/gmon/gmon.asm | 3 +- programs/system/gmon/hwm_uguru.inc | 2 +- programs/system/gmon/system.inc | 71 ++++++++++++++++++++++++++---- 3 files changed, 66 insertions(+), 10 deletions(-) diff --git a/programs/system/gmon/gmon.asm b/programs/system/gmon/gmon.asm index b968328b49..c121492393 100644 --- a/programs/system/gmon/gmon.asm +++ b/programs/system/gmon/gmon.asm @@ -43,7 +43,8 @@ ; 24/08/2006 - добавленна частота процессора ; 10/09/2006 - bugfix ; 25/11/2006 - добавлен ABIT uGuru -; 20/12/2006 - W83627DHG, W83627EHF, W83627EHG +; 20/12/2006 - W83627DHG, W83627EHF, W83627EHG, mutipliers for AthonXP-M, Athlon64, Athlon64-M, +; Intel Dothan, Yonah, Conroe, Merom ; ; Эй! У меня нет много времени. diff --git a/programs/system/gmon/hwm_uguru.inc b/programs/system/gmon/hwm_uguru.inc index b349b2c101..f9bffcb4a6 100644 --- a/programs/system/gmon/hwm_uguru.inc +++ b/programs/system/gmon/hwm_uguru.inc @@ -48,7 +48,7 @@ msg_uguru: db 10, 'ABIT uGuru' uGuru_init: ; Проверка наличия и инициализация ; OUT - CF = 1 - error - cmp byte[acc_type], 3 ; Special IO interface + cmp byte[acc_type], 2 ; Special IO interface jne .uGuru_no pusha mov ecx, UGURU_CMD_PORT diff --git a/programs/system/gmon/system.inc b/programs/system/gmon/system.inc index ecf9dc149a..7d92f6902e 100644 --- a/programs/system/gmon/system.inc +++ b/programs/system/gmon/system.inc @@ -178,10 +178,17 @@ if (OS_version >= 0x0510) jae @f mov cl, 20 @@: ret - + noAMDK6:cmp byte [CPU_fam], 6 jne noAMDK7 - mov eax, 68 ; Athlon/AthlonXP + cmp byte [CPU_mod], 5 + jna @f + mov eax, 0x80000007 + cpuid + and edx, 6 ; voltage ID control & frequency ID control + cmp edx, 6 + je AMDK7M +@@: mov eax, 68 ; Athlon/AthlonXP mov ebx, 3 mov edx, 0x0C0010015 int 0x40 @@ -189,10 +196,49 @@ noAMDK6:cmp byte [CPU_fam], 6 shr ebx, 24 and ebx, 0x0F shr eax, 20 - jc @f - mov cl, [athloncoef + ebx] + jnc @f + add bl, 16 +@@: mov cl, [athloncoef + ebx] ret -@@: mov cl, [athloncoef2 + ebx] + +AMDK7M: mov eax, 68 ; AthonXP-M + mov ebx, 3 + mov edx, 0xC0010042 + int 0x40 + and eax, 0x1F + mov cl, [athlonmcoef + eax] + ret + +noAMDK7:cmp byte [CPU_fam], 0xF + jne noAMDK8 + mov eax, 0x80000007 + cpuid + and edx, 6 ; voltage ID control & frequency ID control + cmp edx, 6 + je AMDK8M + mov eax, 68 ; Athon64 + mov ebx, 3 + mov edx, 0xC0010015 + int 0x40 + shr eax, 24 + and al, 0x3F + shr al, 1 + add al, 4 + mov dl, 10 + mul dl + mov cl, al + ret + +AMDK8M: mov eax, 68 ; Athon64-M + mov ebx, 3 + mov edx, 0xC0010042 + int 0x40 + and al, 0x3F + shr al, 1 + add al, 4 + mov dl, 10 + mul dl + mov cl, al ret noAMD: cmp dword [Vendor + 8], 'ntel' ; Check for International Electronics CPU @@ -257,15 +303,24 @@ noIntelP4: cmp byte[CPU_mod], 0x0B jb @f mov cl, [tualatcoeff + eax] + + cmp byte[CPU_mod], 0x0B + je @f + mov dl, 10 ; model 0x0C - 0x0F - Dothan / Yonah / Conroe / Merom + mul dl + mov cl, al + @@: ret noIntel: noIntelP6: -noAMDK7: +noAMDK8: ret -athloncoef db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105 -athloncoef2 db 120, 190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240 +athloncoef db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 120 + db 190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240 +athlonmcoef: db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105 + db 30, 190, 40, 200, 130, 135, 14, 210, 150, 220, 160, 165, 170, 230, 240 athloncoef3 db 45, 50, 40, 55, 25, 30, 60, 35 p4coef db 160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150 ; Pentium 4 coppercoeff db 50, 30, 40, 20, 55, 35, 45, 25, 35, 70, 80, 60, 20, 75, 15, 65, 90, 110, 120, 20, 95, 115, 85, 25, 35, 70, 80, 100, 20, 75, 15, 105