Subversion Repositories Kolibri OS

Rev

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

Rev 4528 Rev 4535
Line 291... Line 291...
291
        DEBUGF  DEBUG_NETWORK_VERBOSE, "SOCKET_open: domain=%u type=%u protocol=%x ", ecx, edx, esi
291
        DEBUGF  DEBUG_NETWORK_VERBOSE, "SOCKET_open: domain=%u type=%u protocol=%x ", ecx, edx, esi
Line 292... Line 292...
292
 
292
 
293
        push    ecx edx esi
293
        push    ecx edx esi
294
        call    SOCKET_alloc
294
        call    SOCKET_alloc
-
 
295
        pop     esi edx ecx
295
        pop     esi edx ecx
296
        test    eax, eax
Line 296... Line 297...
296
        jz      .nobuffs
297
        jz      .nobuffs
297
 
298
 
Line 1190... Line 1191...
1190
SOCKET_pair:
1191
SOCKET_pair:
Line 1191... Line 1192...
1191
 
1192
 
Line 1192... Line 1193...
1192
        DEBUGF  DEBUG_NETWORK_VERBOSE, "SOCKET_pair\n"
1193
        DEBUGF  DEBUG_NETWORK_VERBOSE, "SOCKET_pair\n"
-
 
1194
 
1193
 
1195
        call    SOCKET_alloc
1194
        call    SOCKET_alloc
1196
        test    eax, eax
Line 1195... Line 1197...
1195
        jz      .nomem1
1197
        jz      .nomem1
1196
        mov     [esp+32], edi   ; application's eax
1198
        mov     [esp+32], edi   ; application's eax
Line 1202... Line 1204...
1202
        mov     [eax + SOCKET.rcv_proc], SOCKET_receive_local
1204
        mov     [eax + SOCKET.rcv_proc], SOCKET_receive_local
1203
        mov     [eax + SOCKET.PID], 0
1205
        mov     [eax + SOCKET.PID], 0
1204
        mov     ebx, eax
1206
        mov     ebx, eax
Line 1205... Line 1207...
1205
 
1207
 
-
 
1208
        call    SOCKET_alloc
1206
        call    SOCKET_alloc
1209
        test    eax, eax
1207
        jz      .nomem2
1210
        jz      .nomem2
Line 1208... Line 1211...
1208
        mov     [esp+20], edi   ; application's ebx
1211
        mov     [esp+20], edi   ; application's ebx
1209
 
1212
 
Line 1813... Line 1816...
1813
; put into beginning of list (which is a fastest way).
1816
; put into beginning of list (which is a fastest way).
1814
;
1817
;
1815
; IN:  /
1818
; IN:  /
1816
; OUT: eax = 0 on error, socket ptr otherwise
1819
; OUT: eax = 0 on error, socket ptr otherwise
1817
;      edi = socket number
1820
;      edi = socket number
1818
;       ZF = cleared on error
-
 
1819
;
1821
;
1820
;--------------------------------------------------------------------
1822
;--------------------------------------------------------------------
1821
align 4
1823
align 4
1822
SOCKET_alloc:
1824
SOCKET_alloc:
Line 1900... Line 1902...
1900
        call    mutex_unlock
1902
        call    mutex_unlock
1901
        popa
1903
        popa
1902
       @@:
1904
       @@:
Line 1903... Line 1905...
1903
 
1905
 
1904
        mov     [net_sockets + SOCKET.NextPtr], eax
-
 
Line 1905... Line 1906...
1905
        or      eax, eax                ; used to clear zero flag
1906
        mov     [net_sockets + SOCKET.NextPtr], eax
1906
 
1907
 
1907
        pusha
1908
        pusha
1908
        mov     ecx, socket_mutex
1909
        mov     ecx, socket_mutex
Line 2005... Line 2006...
2005
 
2006
 
2006
; Allocate new socket
2007
; Allocate new socket
2007
        push    ebx
2008
        push    ebx
2008
        call    SOCKET_alloc
2009
        call    SOCKET_alloc
-
 
2010
        pop     ebx
2009
        pop     ebx
2011
        test    eax, eax
Line 2010... Line 2012...
2010
        jz      .fail
2012
        jz      .fail
2011
 
2013
 
2012
        push    eax
2014
        push    eax