Subversion Repositories Kolibri OS

Rev

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

Rev 2987 Rev 3232
Line 133... Line 133...
133
 
133
 
134
        push    1
134
        push    1
135
        push    esp
135
        push    esp
136
        push    edx
136
        push    edx
137
        push    [.sector_lo+12]
137
        push    [.sector_lo+12]
138
        mov     ecx, [.cache]
138
        mov     ecx, [.cache+16]
139
        mov     eax, edi
139
        mov     eax, edi
140
        shl     eax, 9
140
        shl     eax, 9
141
        add     eax, [ecx+DISKCACHE.data]
141
        add     eax, [ecx+DISKCACHE.data]
142
        push    eax
142
        push    eax
Line 315... Line 315...
315
        mov     [esi], eax      ; sector number
315
        mov     [esi], eax      ; sector number
316
        mov     [esi+4], edx    ; sector number
316
        mov     [esi+4], edx    ; sector number
Line 317... Line 317...
317
 
317
 
Line 318... Line 318...
318
.yes_in_cache_write:
318
.yes_in_cache_write:
Line 319... Line 319...
319
 
319
 
320
        mov     dword [esi+4], 2        ; write - differs from hd
320
        mov     dword [esi+8], 2        ; write - differs from hd
321
 
321
 
Line 371... Line 371...
371
        ret
371
        ret
Line 372... Line 372...
372
 
372
 
373
; This function is intended to replace the old 'write_cache' function.
373
; This function is intended to replace the old 'write_cache' function.
374
proc write_cache64 uses ecx edx esi edi, disk:dword
374
proc write_cache64 uses ecx edx esi edi, disk:dword
375
locals
375
locals
376
cache_chain_started     dd      ?
376
cache_chain_started     dd      0
377
cache_chain_size        dd      ?
377
cache_chain_size        dd      ?
378
cache_chain_pos         dd      ?
378
cache_chain_pos         dd      ?
379
cache_chain_ptr         dd      ?
379
cache_chain_ptr         dd      ?
-
 
380
endl
380
endl
381
saved_esi_pos = 16+12 ; size of local variables + size of registers before esi
381
; If there is no cache for this disk, nothing to do.
382
; If there is no cache for this disk, nothing to do.
382
        cmp     [esi+DISKCACHE.pointer], 0
383
        cmp     [esi+DISKCACHE.pointer], 0
383
        jz      .flush
384
        jz      .flush
384
;-----------------------------------------------------------
385
;-----------------------------------------------------------
Line 463... Line 464...
463
        mov     [cache_chain_size], 1
464
        mov     [cache_chain_size], 1
464
        mov     [cache_chain_pos], edi
465
        mov     [cache_chain_pos], edi
465
.write_cache_chain:
466
.write_cache_chain:
466
        pusha
467
        pusha
467
        mov     edi, [cache_chain_pos]
468
        mov     edi, [cache_chain_pos]
468
        mov     ecx, [ebp-12]
469
        mov     ecx, [ebp-saved_esi_pos]
469
        shl     edi, 9
470
        shl     edi, 9
470
        add     edi, [ecx+DISKCACHE.data]
471
        add     edi, [ecx+DISKCACHE.data]
471
        mov     ecx, [cache_chain_size]
472
        mov     ecx, [cache_chain_size]
472
        push    ecx
473
        push    ecx
473
        push    esp     ; numsectors
474
        push    esp     ; numsectors
Line 547... Line 548...
547
        mov     [esi+DISK.AppCache.data_size], eax
548
        mov     [esi+DISK.AppCache.data_size], eax
548
        mov     [esi+DISK.AppCache.pointer], edx
549
        mov     [esi+DISK.AppCache.pointer], edx
Line 549... Line 550...
549
 
550
 
550
        mov     eax, [esi+DISK.SysCache.data_size]
551
        mov     eax, [esi+DISK.SysCache.data_size]
551
        push    ebx
552
        push    ebx
552
        call    calculate_for_hd
553
        call    calculate_for_hd64
553
        pop     ebx
554
        pop     ebx
554
        add     eax, [esi+DISK.SysCache.pointer]
555
        add     eax, [esi+DISK.SysCache.pointer]
555
        mov     [esi+DISK.SysCache.data], eax
556
        mov     [esi+DISK.SysCache.data], eax
Line 562... Line 563...
562
        rep     stosd
563
        rep     stosd
563
        pop     edi
564
        pop     edi
Line 564... Line 565...
564
 
565
 
565
        mov     eax, [esi+DISK.AppCache.data_size]
566
        mov     eax, [esi+DISK.AppCache.data_size]
566
        push    ebx
567
        push    ebx
567
        call    calculate_for_hd
568
        call    calculate_for_hd64
568
        pop     ebx
569
        pop     ebx
569
        add     eax, [esi+DISK.AppCache.pointer]
570
        add     eax, [esi+DISK.AppCache.pointer]
570
        mov     [esi+DISK.AppCache.data], eax
571
        mov     [esi+DISK.AppCache.data], eax
Line 588... Line 589...
588
        mov     [esi+DISK.SysCache.pointer], eax
589
        mov     [esi+DISK.SysCache.pointer], eax
589
        mov     [esi+DISK.AppCache.pointer], eax
590
        mov     [esi+DISK.AppCache.pointer], eax
590
        mov     al, 1
591
        mov     al, 1
591
        ret
592
        ret
Line -... Line 593...
-
 
593
 
-
 
594
calculate_for_hd64:
-
 
595
        push    eax
-
 
596
        mov     ebx, eax
-
 
597
        shr     eax, 9
-
 
598
        lea     eax, [eax*3]
-
 
599
        shl     eax, 2
-
 
600
        sub     ebx, eax
-
 
601
        shr     ebx, 9
-
 
602
        mov     ecx, ebx
-
 
603
        shl     ebx, 9
-
 
604
        pop     eax
-
 
605
        sub     eax, ebx
-
 
606
        dec     ecx
-
 
607
        ret
-
 
608
 
592
 
609
 
593
; This internal function is called from disk_media_dereference to free the
610
; This internal function is called from disk_media_dereference to free the
594
; allocated cache, if there is one.
611
; allocated cache, if there is one.
595
; esi = pointer to DISK structure
612
; esi = pointer to DISK structure
596
disk_free_cache:
613
disk_free_cache: