Subversion Repositories Kolibri OS

Rev

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

Rev 6756 Rev 6774
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2013-2016. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2013-2016. 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: 6756 $
8
$Revision: 6774 $
9
 
9
 
10
; EXT external functions
10
; EXT external functions
11
;   in:
11
;   in:
Line 364... Line 364...
364
        mov     ebx, [ebp+EXTFS.tempBlockBuffer]
364
        mov     ebx, [ebp+EXTFS.tempBlockBuffer]
365
        call    extfsReadBlock
365
        call    extfsReadBlock
366
        jc      .fail
366
        jc      .fail
367
        pop     eax
367
        pop     eax
368
        push    ecx ebx edx
368
        push    ecx ebx edx
369
        add     [ebp+EXTFS.superblock.blocksFree], ecx
-
 
370
        mov     edi, eax
369
        mov     edi, eax
371
        shr     edi, 5
370
        shr     edi, 5
372
        shl     edi, 2
371
        shl     edi, 2
373
        add     edi, ebx
372
        add     edi, ebx
374
        and     eax, 31
-
 
375
        mov     edx, ecx
373
        mov     edx, ecx
-
 
374
        and     eax, 31
-
 
375
        jz      .aligned
376
        mov     ecx, 32
376
        mov     ecx, 32
377
        sub     ecx, eax
377
        sub     ecx, eax
378
        sub     edx, ecx
378
        sub     edx, ecx
379
        jnc     @f
379
        jnc     @f
380
        add     ecx, edx
380
        add     ecx, edx
Line 385... Line 385...
385
        not     ebx
385
        not     ebx
386
        mov     ecx, eax
386
        mov     ecx, eax
387
        shl     ebx, cl
387
        shl     ebx, cl
388
        not     ebx
388
        not     ebx
389
        and     [edi], ebx
389
        and     [edi], ebx
390
        mov     ecx, edx
-
 
391
        jecxz   @f
-
 
392
        shr     ecx, 5
-
 
393
        add     edi, 4
390
        add     edi, 4
394
        xor     eax, eax
391
        xor     eax, eax
-
 
392
.aligned:
-
 
393
        mov     ecx, edx
-
 
394
        shr     ecx, 5
395
        rep stosd
395
        rep stosd
396
        and     edx, 31
396
        and     edx, 31
-
 
397
        jz      @f
397
        mov     ecx, edx
398
        mov     ecx, edx
398
        jecxz   @f
-
 
399
        not     eax
399
        not     eax
400
        shl     eax, cl
400
        shl     eax, cl
401
        and     [edi], eax
401
        and     [edi], eax
402
@@:
402
@@:
403
        pop     eax ebx
403
        pop     eax ebx
404
        call    extfsWriteBlock
404
        call    extfsWriteBlock
405
        pop     ecx
405
        pop     ecx
406
        mov     eax, ecx
406
        mov     eax, ecx
-
 
407
        add     [ebp+EXTFS.superblock.blocksFree], ecx
407
        mul     [ebp+EXTFS.sectorsPerBlock]
408
        mul     [ebp+EXTFS.sectorsPerBlock]
408
        sub     [ebp+EXTFS.inodeBuffer.sectorsUsed], eax
409
        sub     [ebp+EXTFS.inodeBuffer.sectorsUsed], eax
409
.ret:
410
.ret:
410
        pop     edi edx ebx
411
        pop     edi edx ebx
411
        xor     eax, eax
412
        xor     eax, eax
Line 427... Line 428...
427
        push    eax eax
428
        push    eax eax
428
        mov     esi, .forward   ; search forward, then backward
429
        mov     esi, .forward   ; search forward, then backward
429
.test_block_group:
430
.test_block_group:
430
        call    extfsReadDescriptor
431
        call    extfsReadDescriptor
431
        jc      .fail
432
        jc      .fail
-
 
433
        cmp     [ebx+BGDESCR.blocksFree], 0
-
 
434
        jz      .next
432
        dec     [ebx+BGDESCR.inodesFree]
435
        dec     [ebx+BGDESCR.inodesFree]
433
        js      .next
436
        js      .next
434
        mov     edx, [ebx+BGDESCR.inodeBitmap]
437
        mov     edx, [ebx+BGDESCR.inodeBitmap]
435
        mov     eax, [esp]
438
        mov     eax, [esp]
436
        call    extfsWriteDescriptor
439
        call    extfsWriteDescriptor
Line 520... Line 523...
520
        not     eax
523
        not     eax
521
        bsf     ecx, eax
524
        bsf     ecx, eax
522
        not     eax
525
        not     eax
523
        shr     eax, cl
526
        shr     eax, cl
524
        shl     eax, cl
527
        shl     eax, cl
525
        bsf     ebx, eax
-
 
526
        jnz     @f
-
 
527
        mov     ebx, 32
528
        mov     ebx, 32
528
@@:
529
        bsf     ebx, eax
529
        sub     ebx, ecx
530
        sub     ebx, ecx
530
        mov     eax, [esp+16]
531
        mov     eax, [esp+16]
531
        cmp     ebx, eax
532
        cmp     ebx, eax
532
        jc      @f
533
        jc      @f
533
        mov     ebx, eax
534
        mov     ebx, eax
534
@@:
535
@@:
535
        xchg    ebx, ecx
-
 
536
        or      eax, -1
536
        or      eax, -1
-
 
537
        cmp     ebx, 32
-
 
538
        jz      @f
-
 
539
        xchg    ebx, ecx
537
        shl     eax, cl
540
        shl     eax, cl
538
        not     eax
541
        not     eax
539
        xchg    ebx, ecx
542
        xchg    ebx, ecx
540
        shl     eax, cl
543
        shl     eax, cl
-
 
544
@@:
541
        or      [esi], eax
545
        or      [esi], eax
542
        sub     esi, [ebp+EXTFS.tempBlockBuffer]
546
        sub     esi, [ebp+EXTFS.tempBlockBuffer]
543
        shl     esi, 3
547
        shl     esi, 3
544
        add     esi, ecx
548
        add     esi, ecx
545
        mov     eax, [esp+16]
549
        mov     eax, [esp+16]
Line 587... Line 591...
587
        shr     ecx, 2
591
        shr     ecx, 2
588
        dec     ecx
592
        dec     ecx
589
        or      eax, -1
593
        or      eax, -1
590
        rep stosd
594
        rep stosd
591
        mov     ecx, ebx
595
        mov     ecx, ebx
-
 
596
        neg     ecx
592
        shl     eax, cl
597
        add     ecx, 32
593
        not     eax
598
        shr     eax, cl
594
        or      [edi], eax
599
        or      [edi], eax
595
.done:
600
.done:
596
        pop     eax
601
        pop     eax
597
        mov     ebx, [ebp+EXTFS.tempBlockBuffer]
602
        mov     ebx, [ebp+EXTFS.tempBlockBuffer]
598
        call    extfsWriteBlock
603
        call    extfsWriteBlock
Line 819... Line 824...
819
        mov     edi, ebx
824
        mov     edi, ebx
820
        call    fsGetTime
825
        call    fsGetTime
821
        add     eax, 978307200
826
        add     eax, 978307200
822
        mov     [edi+INODE.inodeModified], eax
827
        mov     [edi+INODE.inodeModified], eax
823
        pop     eax
828
        pop     eax
-
 
829
        cmp     eax, ROOT_INODE
-
 
830
        jnz     @f
-
 
831
        movzx   ecx, [ebp+EXTFS.superblock.inodeSize]
-
 
832
        mov     esi, edi
-
 
833
        mov     edi, [ebp+EXTFS.rootInodeBuffer]
-
 
834
        rep movsb
-
 
835
@@:
824
        call    getInodeLocation
836
        call    getInodeLocation
825
        jc      .ret
837
        jc      .ret
826
        mov     ebx, [ebp+EXTFS.tempBlockBuffer]
838
        mov     ebx, [ebp+EXTFS.tempBlockBuffer]
827
        mov     ecx, eax
839
        mov     ecx, eax
828
        call    fs_read32_sys
840
        call    fs_read32_sys
829
        test    eax, eax
841
        test    eax, eax
830
        jnz     @f
842
        jnz     @f
831
        mov     eax, ecx
843
        mov     eax, ecx
832
        mov     esi, edi
-
 
833
        movzx   ecx, [ebp+EXTFS.superblock.inodeSize]
844
        movzx   ecx, [ebp+EXTFS.superblock.inodeSize]
834
        mov     edi, edx
845
        mov     edi, edx
835
        add     edi, ebx
846
        add     edi, ebx
-
 
847
        mov     esi, [esp]
836
        rep movsb
848
        rep movsb
837
        call    fs_write32_sys
849
        call    fs_write32_sys
838
.ret:
850
.ret:
839
        pop     ebx ecx esi edi edx
851
        pop     ebx ecx esi edi edx
840
        ret
852
        ret