Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 2287 → Rev 2288

/kernel/trunk/drivers/apm.asm
42,16 → 42,20
mcall 4,10*65536+3,0x80000000,text.4
bts [flags],1
jmp .end
@@: cmp al,0
@@:
cmp al, 0
jne @f
mov edx,text.1
jmp .0
@@: cmp al,1
@@:
cmp al, 1
jne @f
mov edx,text.2
jmp .0
@@: mov edx,text.3
.0: push edx
@@:
mov edx, text.3
.0:
push edx
mcall 4,169*65536+3,0x80dddddd,text.0
pop edx
add ebx,47*65536
65,16 → 69,20
jne @f
mov edx,text.01
jmp .1
@@: cmp bh,1
@@:
cmp bh, 1
jne @f
mov edx,text.02
jmp .1
@@: cmp bh,2
@@:
cmp bh, 2
jne @f
mov edx,text.03
jmp .1
@@: mov edx,text.04
.1: push edx
@@:
mov edx, text.04
.1:
push edx
mcall 4,10*65536+10,0x80000000,text.00
pop edx
mcall ,100*65536+10,;0x80000000
85,20 → 93,25
jne @f
mov edx,text.11
jmp .2
@@: cmp bl,1
@@:
cmp bl, 1
jne @f
mov edx,text.12
jmp .2
@@: cmp bl,2
@@:
cmp bl, 2
jne @f
mov edx,text.13
jmp .2
@@: cmp bl,3
@@:
cmp bl, 3
jne @f
mov edx,text.14
jmp .2
@@: mov edx,text.04
.2: push edx
@@:
mov edx, text.04
.2:
push edx
mcall 4,10*65536+20,0x80000000,text.10
pop edx
mcall ,100*65536+20,
111,10 → 124,12
mcall ,100*65536+30,0x80000000,text.04
pop eax
jmp .end
@@: shl ecx,24
@@:
shl ecx, 24
shr ecx,24
mcall 47,0x80030000,,100*65536+30,0x347636
.3: mcall 4,115*65536+30,0x80000000,text.15
.3:
mcall 4,115*65536+30,0x80000000,text.15
mov dx,[esp]
shl edx,17
shr edx,17
125,7 → 140,8
bt cx,15
jc @f
mov edx,text.22
@@: mcall 4,160*65536+30,0x80000000
@@:
mcall 4,160*65536+30,0x80000000
pop si
.error:
.end:
137,7 → 153,8
bt [flags],1
jc @f
mcall ,65*65536+45,,2,
@@: mcall 4,10*65536+50,0x80564242,text.30
@@:
mcall 4,10*65536+50,0x80564242,text.30
mcall 12,2
 
still:
167,28 → 184,34
jne @f
mcall -1
 
@@: cmp ah,2
@@:
cmp ah, 2
jne @f
mcall 5,50
mcall 49,0x0001,0x0001,0x5307
jmp redraw
 
@@: cmp ah,4
@@:
cmp ah, 4
jg @f
mov edx,0x01f7 ;primary chan.
call reserv_ports
jc redraw
sub bh,3
.1: call set_drive
.1:
call set_drive
btc [flags],2
jnc .2
call device_reset
jmp .3
.2: call standby_hdd
.3: call free_ports
.2:
call standby_hdd
.3:
call free_ports
jmp redraw
 
@@: cmp ah,6
@@:
cmp ah, 6
jg redraw
mov edx,0x0177 ;secondary chan.
call reserv_ports
202,10 → 225,12
test bh,bh
jnz @f
btr ax,4
.1: out dx,al
.1:
out dx, al
inc dx
ret
@@: bts ax,4
@@:
bts ax, 4
jmp .1
 
 
217,7 → 242,8
; 98h E5h nondata check power mode
; 99h E6h nondata set sleep mode
xor ecx,ecx
@@: in al,dx
@@:
in al, dx
dec cx
jz @f
bt ax,6
239,13 → 265,15
pop bx
clc
ret
@@: pop bx
@@:
pop bx
stc
ret
 
device_reset:
xor ecx,ecx
@@: in al,dx
@@:
in al, dx
dec cx
jz @f
bt ax,6
267,29 → 295,49
flags dw 0
 
text:
.0: db 'APM v.1.',0
.1: db '0',0
.2: db '1',0
.3: db '2',0
.4: db 'APM not supported',0
.0:
db 'APM v.1.',0
.1:
db '0',0
.2:
db '1',0
.3:
db '2',0
.4:
db 'APM not supported',0
 
.00: db 'power status:',0
.01: db 'off-line',0
.02: db 'on-line',0
.03: db 'on backup power',0
.04: db 'unknown',0
.00:
db 'power status:',0
.01:
db 'off-line',0
.02:
db 'on-line',0
.03:
db 'on backup power',0
.04:
db 'unknown',0
 
.10: db 'battery flag:',0
.11: db 'high',0
.12: db 'low',0
.13: db 'critical',0
.14: db 'charging',0
.15: db ' % ,',0
.10:
db 'battery flag:',0
.11:
db 'high',0
.12:
db 'low',0
.13:
db 'critical',0
.14:
db 'charging',0
.15:
db ' % ,',0
 
.20: db 'battery life:',0
.21: db 'min',0
.22: db 'sec',0
.20:
db 'battery life:',0
.21:
db 'min',0
.22:
db 'sec',0
 
.30: db 'STAND-BY: SYSTEM HDD: 0 1 2 3',0
.30:
db 'STAND-BY: SYSTEM HDD: 0 1 2 3',0
 
I_END:
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property