Subversion Repositories Kolibri OS

Rev

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

Rev 2142 Rev 2150
Line 1223... Line 1223...
1223
; It is called several times, first time with eax=0
1223
; It is called several times, first time with eax=0
1224
; in: eax = 0 for first call, previously returned value for subsequent calls
1224
; in: eax = 0 for first call, previously returned value for subsequent calls
1225
; out: eax = 0 => no more items
1225
; out: eax = 0 => no more items
1226
;      eax != 0 => buffer pointed to by edi contains name of item
1226
;      eax != 0 => buffer pointed to by edi contains name of item
1227
dyndisk_enum_root:
1227
dyndisk_enum_root:
1228
        push    ebx             ; save register used in file_system_lfn
1228
        push    edx             ; save register used in file_system_lfn
1229
        mov     ecx, disk_list_mutex    ; it will be useful
1229
        mov     ecx, disk_list_mutex    ; it will be useful
1230
; 1. If this is the first call, acquire the mutex and initialize.
1230
; 1. If this is the first call, acquire the mutex and initialize.
1231
        test    eax, eax
1231
        test    eax, eax
1232
        jnz     .notfirst
1232
        jnz     .notfirst
1233
        call    mutex_lock
1233
        call    mutex_lock
Line 1246... Line 1246...
1246
        stosb
1246
        stosb
1247
        test    al, al
1247
        test    al, al
1248
        jnz     @b
1248
        jnz     @b
1249
        pop     esi eax
1249
        pop     esi eax
1250
; 5. Return with eax = item.
1250
; 5. Return with eax = item.
1251
        pop     ebx             ; restore register used in file_system_lfn
1251
        pop     edx             ; restore register used in file_system_lfn
1252
        ret
1252
        ret
1253
.last:
1253
.last:
1254
; 6. Release the mutex and return with eax = 0.
1254
; 6. Release the mutex and return with eax = 0.
1255
        call    mutex_unlock
1255
        call    mutex_unlock
1256
        xor     eax, eax
1256
        xor     eax, eax
1257
        pop     ebx             ; restore register used in file_system_lfn
1257
        pop     edx             ; restore register used in file_system_lfn
1258
        ret
1258
        ret