Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 467 → Rev 472

/kernel/trunk/blkdev/hd_drv.inc
33,7 → 33,7
push ecx esi edi ; scan cache
 
mov ecx,cache_max ; entries in cache
mov esi,OS_BASE+0x600000+8
mov esi,HD_CACHE+8
mov edi,1
 
hdreadcache:
62,7 → 62,7
call hd_read_pio
@@:
 
lea esi,[edi*8+OS_BASE+0x600000]
lea esi,[edi*8+HD_CACHE]
mov [esi],eax ; sector number
mov dword [esi+4],1 ; hd read - mark as same as in hd
 
70,7 → 70,7
 
mov esi,edi
shl esi,9
add esi,OS_BASE+0x600000+65536
add esi,HD_CACHE+65536
mov edi,ebx
mov ecx,512/4
cld
123,7 → 123,7
cli
push edi
shl edi,9
add edi,OS_BASE+0x600000+65536
add edi,HD_CACHE+65536
mov ecx,256
mov edx,[hdbase]
cld
161,7 → 161,7
; check if the cache already has the sector and overwrite it
 
mov ecx,cache_max
mov esi,OS_BASE+0x600000+8
mov esi,HD_CACHE+8
mov edi,1
 
hdwritecache:
186,7 → 186,7
cmp [hd_error],0
jne hd_write_access_denied
 
lea esi,[edi*8+OS_BASE+0x600000]
lea esi,[edi*8+HD_CACHE]
mov [esi],eax ; sector number
 
yes_in_cache_write:
194,7 → 194,7
mov dword [esi+4],2 ; write - differs from hd
 
shl edi,9
add edi,OS_BASE+0x600000+65536
add edi,HD_CACHE+65536
mov esi,ebx
mov ecx,512/4
cld
213,7 → 213,7
; write difference ( 2 ) from cache to hd
 
mov ecx,cache_max
mov esi,OS_BASE+0x600000+8
mov esi,HD_CACHE+8
mov edi,1
 
write_cache_more:
331,7 → 331,7
; cli
mov esi,edi
shl esi,9
add esi,OS_BASE+0x600000+65536 ; esi = from memory position
add esi,HD_CACHE+65536 ; esi = from memory position
mov ecx,256
mov edx,[hdbase]
cld
365,7 → 365,7
 
inside_cache:
 
cmp dword [edi*8+OS_BASE+0x600000+4],2 ; get cache slot info
cmp dword [edi*8+HD_CACHE+4],2 ; get cache slot info
jb found_slot ; it's empty or read
dec ecx
jnz search_for_empty
386,7 → 386,7
clear_hd_cache:
 
push eax ecx edi
mov edi,OS_BASE+0x600000
mov edi, HD_CACHE
mov ecx,16384
xor eax,eax
cld
680,7 → 680,7
push ecx esi edi
mov esi, eax
shl edi, 9
add edi, OS_BASE+0x610000
add edi, HD_CACHE+0x10000
mov ecx, 512/4
cld
rep movsd
775,7 → 775,7
mov eax, IDE_descriptor_table
mov edx, [cache_chain_pos]
shl edx, 9
add edx, 0x610000
add edx, DMA_HD_MEM+0x10000
mov [eax], edx
movzx edx, [cache_chain_size]
shl edx, 9
786,7 → 786,7
mov eax, IDE_descriptor_table
mov edx, edi
shl edx, 9
add edx, 0x610000
add edx, DMA_HD_MEM+0x10000
mov [eax], edx
mov word [eax+4], 0x200
do_write_dma: