kolibrios/programs/system/gmon/hwm.inc
heavyiron 3eda462807 Kernel: Smoothing image code from Mario79, build scripts for skin and drivers/build.bat
Programs: fasm updated to 1.67.14, small fixes in desktop, stackcfg, calc, board, pipes, freecell, big cleanup of unused programs, added some applications from 0.6.3.0 distr...

git-svn-id: svn://kolibrios.org@205 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-11-02 14:18:23 +00:00

81 lines
1.4 KiB
PHP

include 'hwm_wb.inc'
include 'hwm_it87.inc'
uglobal
hwm_enable:db 0 ; 0 - no, 1 - Winbond, 2 - ITE
temps db 0,0, 0,0, 0,0 ; ãðàäóñ, äåñÿòûå, ãðàäóñ, ...
rpms dd 0, 0, 0 ; fan1, fan2, fan3
Vcore dd 0.0
Vin0 dd 0.0
Vin1 dd 0.0
AVcc dd 0.0
Vin2 dd 0.0
V12 dd 0.0
V5 dd 0.0
endg
hwm_unk db 9, 'Not found'
hwm_chip_name dd hwm_unk
hwm_init:
; Ïðîâåðêà íàëè÷èÿ è èíèöèàëèçàöèÿ
pusha
mov eax, 46 ; ðåçåðâèðóåì 0x295 è 0x296 ïîðòû
xor ebx, ebx
mov ecx, 0x295
mov edx, 0x296
int 0x40
test eax, eax
jz hwm_ports_ok
hwm_no:
mov eax, 46 ; îñâîáîæäàåì 0x295 è 0x296 ïîðòû
xor ebx, ebx
inc ebx
mov ecx, 0x295
mov edx, 0x296
int 0x40
popa
ret
hwm_ports_ok:
call wb_init
jc not_wb
mov byte [hwm_enable], 1
call wb_get_name
jmp hwm_ok
not_wb: call it87_init
jc hwm_no
mov byte [hwm_enable], 2
call it87_get_name
hwm_ok: mov [hwm_chip_name], edx
popa
ret
;----------------------------------------------------
hwm_get_params:
; Âûçûâàòü òîëüêî åñëè íàéäåí
pusha
mov al, [hwm_enable]
dec al
jnz @f
call wb_get_temp
call wb_get_fan_speed
mov edi, wb_coeff
call wb_get_volt
fld dword[V12]
fld dword[wb_n12v_const]
faddp st1, st0
fstp dword[V12]
popa
ret
@@: call it87_get_temp
call it87_get_fan_speed
mov edi, ite_coeff
call wb_get_volt
popa
ret
;----------------------------------------------------