Subversion Repositories Kolibri OS

Rev

Rev 5095 | Rev 5363 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5095 Rev 5196
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: 5095 $
8
$Revision: 5196 $
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 621... Line 621...
621
; 5. Decide whether we need to prefetch further sectors.
621
; 5. Decide whether we need to prefetch further sectors.
622
; If so, advance to 6. If not, go to 13.
622
; If so, advance to 6. If not, go to 13.
623
; Assume that devices < 3MB are floppies which are slow
623
; Assume that devices < 3MB are floppies which are slow
624
; (ramdisk does not have a cache, so we don't even get here for ramdisk).
624
; (ramdisk does not have a cache, so we don't even get here for ramdisk).
625
; This is a dirty hack, but the entire function is somewhat hacky. Use fs_read64*.
625
; This is a dirty hack, but the entire function is somewhat hacky. Use fs_read64*.
626
        mov     eax, [ebp+PARTITION.Disk]
626
        mov     ecx, [ebp+PARTITION.Disk]
627
        cmp     dword [eax+DISK.MediaInfo.Capacity+4], 0
627
        cmp     dword [ecx+DISK.MediaInfo.Capacity+4], 0
628
        jnz     @f
628
        jnz     @f
629
        cmp     dword [eax+DISK.MediaInfo.Capacity], 3 shl (20-9)
629
        cmp     dword [ecx+DISK.MediaInfo.Capacity], 3 shl (20-9)
630
        jb      .floppy
630
        jb      .floppy
631
@@:
631
@@:
632
; We want to prefetch CACHE_LEGACY_READ_SIZE sectors.
632
; We want to prefetch CACHE_LEGACY_READ_SIZE sectors.
633
; 6. Release the lock acquired at step 4a.
633
; 6. Release the lock acquired at step 4a.
634
        mov     ecx, [ebp+PARTITION.Disk]
634
        mov     ecx, [ebp+PARTITION.Disk]
Line 753... Line 753...
753
; 15. Get the slot and pointer to the cache item,
753
; 15. Get the slot and pointer to the cache item,
754
; change the status to not-modified copy of the disk
754
; change the status to not-modified copy of the disk
755
; and go to 4c.
755
; and go to 4c.
756
        pop     esi
756
        pop     esi
757
        mov     [esi+CACHE_ITEM.Status], CACHE_ITEM_COPY
757
        mov     [esi+CACHE_ITEM.Status], CACHE_ITEM_COPY
-
 
758
        mov     ecx, [ebx+DISKCACHE.sector_size_log]
758
        jmp     .found_in_cache
759
        jmp     .found_in_cache
Line 759... Line 760...
759
 
760
 
760
; On error at steps 13-14, release the lock
761
; On error at steps 13-14, release the lock
761
; and pass the error to the caller.
762
; and pass the error to the caller.