Rev 4437 | Rev 4465 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4437 | Rev 4442 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2011-2014. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2011-2014. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 4437 $ |
8 | $Revision: 4442 $ |
9 | 9 | ||
10 | ; Read/write functions try to do large operations, |
10 | ; Read/write functions try to do large operations, |
11 | ; it is significantly faster than several small operations. |
11 | ; it is significantly faster than several small operations. |
Line 229... | Line 229... | ||
229 | mov al, DISKFUNC.read |
229 | mov al, DISKFUNC.read |
230 | call disk_call_driver |
230 | call disk_call_driver |
231 | ; If failed, save error code. |
231 | ; If failed, save error code. |
232 | test eax, eax |
232 | test eax, eax |
233 | jz @f |
233 | jz @f |
234 | mov [.error_code], eax |
234 | mov [.error_code+.local_vars2_size], eax |
235 | @@: |
235 | @@: |
236 | ; 11. Copy data for the caller. |
236 | ; 11. Copy data for the caller. |
237 | ; Note that buffer in edi is advanced automatically. |
237 | ; Note that buffer in edi is advanced automatically. |
238 | cmp [.current_num_sectors], 0 |
238 | cmp [.current_num_sectors], 0 |
239 | jz .copy_done |
239 | jz .copy_done |
Line 248... | Line 248... | ||
248 | add ecx, DISK.CacheLock |
248 | add ecx, DISK.CacheLock |
249 | call mutex_lock |
249 | call mutex_lock |
250 | ; 12b. Prepare for the loop: save edi and create a local variable that |
250 | ; 12b. Prepare for the loop: save edi and create a local variable that |
251 | ; stores number of sectors to be copied. |
251 | ; stores number of sectors to be copied. |
252 | push edi |
252 | push edi |
253 | push [.current_num_sectors] |
253 | push [.current_num_sectors+4] |
254 | .store_to_cache: |
254 | .store_to_cache: |
255 | ; 12c. For each sector, call the lookup function with adding to the cache, if not yet. |
255 | ; 12c. For each sector, call the lookup function with adding to the cache, if not yet. |
256 | mov eax, [.sector_lo+.local_vars2_size+8] |
256 | mov eax, [.sector_lo+.local_vars2_size+8] |
257 | mov edx, [.sector_hi+.local_vars2_size+8] |
257 | mov edx, [.sector_hi+.local_vars2_size+8] |
258 | call cache_lookup_write |
258 | call cache_lookup_write |