Subversion Repositories Kolibri OS

Rev

Rev 9715 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9715 Rev 9831
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2022. 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: 9715 $
8
$Revision: 9831 $
9
 
9
 
Line 10... Line 10...
10
F_READ              = 0x0001  ; file opened for reading
10
F_READ              = 0x0001  ; file opened for reading
Line 113... Line 113...
113
        mov     [ecx], eax
113
        mov     [ecx], eax
114
        mov     [ecx+4], edx
114
        mov     [ecx+4], edx
115
        add     esp, 5*4
115
        add     esp, 5*4
116
        pop     ebp
116
        pop     ebp
117
        xor     eax, eax
117
        xor     eax, eax
118
        mov     [esp + SYSCALL_STACK._eax], eax
118
        mov     [esp + SYSCALL_STACK.eax], eax
119
        ret
119
        ret
120
.err_3:
120
.err_3:
121
        mov     eax, ebp
121
        mov     eax, ebp
122
        call    free
122
        call    free
123
        mov     ebp, -ENFILE
123
        mov     ebp, -ENFILE
Line 130... Line 130...
130
.err_0:
130
.err_0:
131
        add     esp, 5*4
131
        add     esp, 5*4
132
.fail:
132
.fail:
133
        mov     eax, ebp
133
        mov     eax, ebp
134
        pop     ebp
134
        pop     ebp
135
        mov     [esp + SYSCALL_STACK._eax], eax
135
        mov     [esp + SYSCALL_STACK.eax], eax
136
        ret
136
        ret
Line 137... Line 137...
137
 
137
 
138
purge .pipeflags
138
purge .pipeflags
139
purge .filefd
139
purge .filefd
Line 167... Line 167...
167
        jb      .read
167
        jb      .read
168
        mov     ecx, esi
168
        mov     ecx, esi
169
.read:
169
.read:
170
        mov     esi, [ebp + PIPE.buffer]
170
        mov     esi, [ebp + PIPE.buffer]
171
        add     esi, [ebp + PIPE.read_end]
171
        add     esi, [ebp + PIPE.read_end]
172
        mov     [esp + SYSCALL_STACK._eax], ecx
172
        mov     [esp + SYSCALL_STACK.eax], ecx
173
        sub     [ebp + PIPE.count], ecx
173
        sub     [ebp + PIPE.count], ecx
174
        cld
174
        cld
175
        rep movsb
175
        rep movsb
176
        and     esi, 0xFFF
176
        and     esi, 0xFFF
177
        mov     [ebp + PIPE.read_end], esi
177
        mov     [ebp + PIPE.read_end], esi
Line 221... Line 221...
221
        add     esp, sizeof.MUTEX_WAITER
221
        add     esp, sizeof.MUTEX_WAITER
222
        popfd
222
        popfd
223
        jmp     .again
223
        jmp     .again
Line 224... Line 224...
224
 
224
 
225
.eof:
225
.eof:
226
        mov     [esp + SYSCALL_STACK._eax], eax
226
        mov     [esp + SYSCALL_STACK.eax], eax
227
        lea     ecx, [ebp + PIPE.pipe_lock]
227
        lea     ecx, [ebp + PIPE.pipe_lock]
228
        call    mutex_unlock
228
        call    mutex_unlock
Line 229... Line 229...
229
        ret
229
        ret
Line 295... Line 295...
295
 
295
 
296
        test    ebx, ebx
296
        test    ebx, ebx
Line 297... Line 297...
297
        jnz     .again
297
        jnz     .again
298
 
298
 
299
        pop     eax                             ; written
299
        pop     eax                             ; written
Line 300... Line 300...
300
        mov     [esp + SYSCALL_STACK._eax], eax
300
        mov     [esp + SYSCALL_STACK.eax], eax
301
        ret
301
        ret
302
 
302
 
Line 328... Line 328...
328
.epipe:
328
.epipe:
329
        lea     ecx, [ebp + PIPE.pipe_lock]
329
        lea     ecx, [ebp + PIPE.pipe_lock]
330
        call    mutex_unlock
330
        call    mutex_unlock
Line 331... Line 331...
331
 
331
 
332
        add     esp, 4
332
        add     esp, 4
333
        mov     [esp + SYSCALL_STACK._eax], -EPIPE
333
        mov     [esp + SYSCALL_STACK.eax], -EPIPE
Line 334... Line 334...
334
        ret
334
        ret
335
 
335
 
336
align 4
336
align 4
337
pipe_close:
337
pipe_close: