small network code updates, annotations

git-svn-id: svn://kolibrios.org@7680 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2019-08-25 19:02:34 +00:00
parent 93a672ba27
commit 38fd277557
3 changed files with 10 additions and 9 deletions

View File

@ -920,7 +920,7 @@ socket_receive_stream:
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_receive: STREAM\n" DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_receive: STREAM\n"
cmp [eax + STREAM_SOCKET.rcv + RING_BUFFER.size], 0 cmp [eax + STREAM_SOCKET.rcv.size], 0
je .wouldblock je .wouldblock
test edi, MSG_PEEK test edi, MSG_PEEK
@ -936,7 +936,7 @@ socket_receive_stream:
call socket_ring_free ; free read memory call socket_ring_free ; free read memory
pop eax pop eax
cmp [eax + STREAM_SOCKET.rcv + RING_BUFFER.size], 0 cmp [eax + STREAM_SOCKET.rcv.size], 0
jne .more_data jne .more_data
xor ebx, ebx ; errorcode = 0 (no error) xor ebx, ebx ; errorcode = 0 (no error)
ret ret
@ -953,7 +953,7 @@ socket_receive_stream:
ret ret
.peek: .peek:
mov ecx, [eax + STREAM_SOCKET.rcv + RING_BUFFER.size] mov ecx, [eax + STREAM_SOCKET.rcv.size]
xor ebx, ebx xor ebx, ebx
ret ret
@ -1561,7 +1561,7 @@ socket_input:
jmp socket_notify jmp socket_notify
.full: .full:
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_input: socket %x is full!\n", eax DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_input: socket %x is full!\n", eax
pusha pusha
lea ecx, [eax + SOCKET.mutex] lea ecx, [eax + SOCKET.mutex]
@ -1657,7 +1657,6 @@ socket_ring_write:
jb @f jb @f
sub edi, SOCKET_BUFFER_SIZE ; WRAP sub edi, SOCKET_BUFFER_SIZE ; WRAP
@@: @@:
mov [eax + RING_BUFFER.write_ptr], edi mov [eax + RING_BUFFER.write_ptr], edi
pop edi pop edi
@ -1753,7 +1752,7 @@ socket_ring_read:
call mutex_unlock ; TODO: check what registers this function actually destroys call mutex_unlock ; TODO: check what registers this function actually destroys
popa popa
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_read: no data at all!\n" DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_ring_read: no data at all!\n"
xor ecx, ecx xor ecx, ecx
ret ret
@ -1800,7 +1799,7 @@ socket_ring_free:
ret ret
.error: ; we could free all available bytes, but that would be stupid, i guess.. .error: ; we could free all available bytes, but that would be stupid, i guess..
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_free: buffer=%x error!\n", eax DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_ring_free: buffer=%x error!\n", eax
add [eax + RING_BUFFER.size], ecx add [eax + RING_BUFFER.size], ecx
push eax push eax

View File

@ -495,9 +495,9 @@ endl
xor ebx, ebx xor ebx, ebx
@@: @@:
cmp ebx, TCP_max_win cmp ebx, TCP_max_win ;;;; shl rcv_scale
jbe @f jbe @f
mov ebx, TCP_max_win mov ebx, TCP_max_win ;;;; shl rcv_scale
@@: @@:
mov ecx, [eax + TCP_SOCKET.RCV_ADV] mov ecx, [eax + TCP_SOCKET.RCV_ADV]

View File

@ -89,6 +89,8 @@ macro tcp_rcvseqinit ptr {
macro tcp_init_socket socket { macro tcp_init_socket socket {
; new tcp control block
mov [socket + TCP_SOCKET.t_maxseg], TCP_mss_default mov [socket + TCP_SOCKET.t_maxseg], TCP_mss_default
mov [socket + TCP_SOCKET.t_flags], TF_REQ_SCALE or TF_REQ_TSTMP mov [socket + TCP_SOCKET.t_flags], TF_REQ_SCALE or TF_REQ_TSTMP