forked from KolibriOS/kolibrios
kernel: pipe io bugfixes
git-svn-id: svn://kolibrios.org@6928 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
7ee30af446
commit
65af271ccd
@ -40,8 +40,8 @@ sys_pipe2:
|
|||||||
mov ebp, -EINVAL
|
mov ebp, -EINVAL
|
||||||
jnz .fail
|
jnz .fail
|
||||||
|
|
||||||
push ecx
|
|
||||||
push edx
|
push edx
|
||||||
|
push ecx
|
||||||
sub esp, (5-2)*4
|
sub esp, (5-2)*4
|
||||||
|
|
||||||
mov ecx, sizeof.FILED
|
mov ecx, sizeof.FILED
|
||||||
@ -102,6 +102,9 @@ sys_pipe2:
|
|||||||
mov [edx+FILED.destroy], 0
|
mov [edx+FILED.destroy], 0
|
||||||
mov [edx+FILED.file], ebp
|
mov [edx+FILED.file], ebp
|
||||||
|
|
||||||
|
mov eax, [eax+FILED.handle]
|
||||||
|
mov edx, [edx+FILED.handle]
|
||||||
|
|
||||||
mov [ecx], eax
|
mov [ecx], eax
|
||||||
mov [ecx+4], edx
|
mov [ecx+4], edx
|
||||||
add esp, 5*4
|
add esp, 5*4
|
||||||
@ -220,14 +223,15 @@ pipe_write:
|
|||||||
jb .write
|
jb .write
|
||||||
mov ecx, esi
|
mov ecx, esi
|
||||||
.write:
|
.write:
|
||||||
mov esi, [ebp+PIPE.buffer]
|
mov esi, edi
|
||||||
add esi, [ebp+PIPE.write_end]
|
mov edi, [ebp+PIPE.buffer]
|
||||||
|
add edi, [ebp+PIPE.write_end]
|
||||||
mov [esp+SYSCALL_STACK._eax], ecx
|
mov [esp+SYSCALL_STACK._eax], ecx
|
||||||
add [ebp+PIPE.count], ecx
|
add [ebp+PIPE.count], ecx
|
||||||
cld
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
and esi, 0xFFF
|
and edi, 0xFFF
|
||||||
mov [ebp+PIPE.write_end], esi
|
mov [ebp+PIPE.write_end], edi
|
||||||
|
|
||||||
lea ecx, [ebp+PIPE.pipe_lock]
|
lea ecx, [ebp+PIPE.pipe_lock]
|
||||||
call mutex_unlock
|
call mutex_unlock
|
||||||
|
Loading…
Reference in New Issue
Block a user