forked from KolibriOS/kolibrios
[KERNEL]: Replaced magic numbers with constants and cleaned code
git-svn-id: svn://kolibrios.org@9917 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
7f50e02fca
commit
cd441e7929
@ -278,10 +278,7 @@ master_tab = page_tabs + (page_tabs shr 10) ;0xFDFF70000
|
|||||||
|
|
||||||
LFB_BASE = 0xFE000000
|
LFB_BASE = 0xFE000000
|
||||||
|
|
||||||
|
std_application_base_address = 0
|
||||||
new_app_base = 0;
|
|
||||||
|
|
||||||
std_application_base_address = new_app_base
|
|
||||||
RING0_STACK_SIZE = 0x2000
|
RING0_STACK_SIZE = 0x2000
|
||||||
|
|
||||||
REG_SS = RING0_STACK_SIZE - 4
|
REG_SS = RING0_STACK_SIZE - 4
|
||||||
@ -350,6 +347,9 @@ EVENT_DEBUG = 0x00000100
|
|||||||
EVENT_NETWORK2 = 0x00000200
|
EVENT_NETWORK2 = 0x00000200
|
||||||
EVENT_EXTENDED = 0x00000400
|
EVENT_EXTENDED = 0x00000400
|
||||||
|
|
||||||
|
EVM_MOUSE_FILTER = 0x80000000 ; see in macros.inc for apps
|
||||||
|
EVM_CURSOR_FILTER = 0x40000000
|
||||||
|
|
||||||
EV_INTR = 1
|
EV_INTR = 1
|
||||||
|
|
||||||
STDIN_FILENO = 0
|
STDIN_FILENO = 0
|
||||||
|
@ -1016,7 +1016,7 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
|
|||||||
mov [edi+4], ecx
|
mov [edi+4], ecx
|
||||||
add edi, 8
|
add edi, 8
|
||||||
mov esi, [msg_addr]
|
mov esi, [msg_addr]
|
||||||
; add esi, new_app_base
|
; add esi, std_application_base_address
|
||||||
cld
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
|
|
||||||
|
@ -331,11 +331,11 @@ nosb8:
|
|||||||
|
|
||||||
mov [background_defined], 1
|
mov [background_defined], 1
|
||||||
|
|
||||||
mov [draw_data+32 + RECT.left], eax
|
mov [draw_data + sizeof.RECT + RECT.left], eax
|
||||||
mov [draw_data+32 + RECT.top], ebx
|
mov [draw_data + sizeof.RECT + RECT.top], ebx
|
||||||
|
|
||||||
mov [draw_data+32 + RECT.right], ecx
|
mov [draw_data + sizeof.RECT + RECT.right], ecx
|
||||||
mov [draw_data+32 + RECT.bottom], edx
|
mov [draw_data + sizeof.RECT + RECT.bottom], edx
|
||||||
|
|
||||||
inc [REDRAW_BACKGROUND]
|
inc [REDRAW_BACKGROUND]
|
||||||
call wakeup_osloop
|
call wakeup_osloop
|
||||||
@ -356,15 +356,15 @@ endg
|
|||||||
|
|
||||||
align 4
|
align 4
|
||||||
force_redraw_background:
|
force_redraw_background:
|
||||||
and [draw_data+32 + RECT.left], 0
|
and [draw_data + sizeof.RECT + RECT.left], 0
|
||||||
and [draw_data+32 + RECT.top], 0
|
and [draw_data + sizeof.RECT + RECT.top], 0
|
||||||
push eax ebx
|
push eax ebx
|
||||||
mov eax, [_display.width]
|
mov eax, [_display.width]
|
||||||
mov ebx, [_display.height]
|
mov ebx, [_display.height]
|
||||||
dec eax
|
dec eax
|
||||||
dec ebx
|
dec ebx
|
||||||
mov [draw_data+32 + RECT.right], eax
|
mov [draw_data + sizeof.RECT + RECT.right], eax
|
||||||
mov [draw_data+32 + RECT.bottom], ebx
|
mov [draw_data + sizeof.RECT + RECT.bottom], ebx
|
||||||
pop ebx eax
|
pop ebx eax
|
||||||
inc [REDRAW_BACKGROUND]
|
inc [REDRAW_BACKGROUND]
|
||||||
call wakeup_osloop
|
call wakeup_osloop
|
||||||
|
@ -2282,12 +2282,12 @@ sysfn_getdiskinfo: ; 18.11 = get disk info table
|
|||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
sysfn_getversion: ; 18.13 = get kernel ID and version
|
sysfn_getversion: ; 18.13 = get kernel ID and version
|
||||||
; if given memory address belongs to kernel then error
|
; if given memory address belongs to kernel then error
|
||||||
stdcall is_region_userspace, ecx, version_end-version_inf
|
stdcall is_region_userspace, ecx, version_inf.size
|
||||||
jnz .addr_error
|
jnz .addr_error
|
||||||
|
|
||||||
mov edi, ecx
|
mov edi, ecx
|
||||||
mov esi, version_inf
|
mov esi, version_inf
|
||||||
mov ecx, version_end-version_inf
|
mov ecx, version_inf.size
|
||||||
rep movsb
|
rep movsb
|
||||||
ret
|
ret
|
||||||
.addr_error: ; if given memory address is illegal
|
.addr_error: ; if given memory address is illegal
|
||||||
@ -2466,15 +2466,12 @@ sound_flag db 0
|
|||||||
|
|
||||||
endg
|
endg
|
||||||
|
|
||||||
;UID_NONE=0
|
|
||||||
;UID_KOLIBRI=2 ;russian
|
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
version_inf:
|
version_inf:
|
||||||
db 0,7,7,0 ; version 0.7.7.0
|
db 0,7,7,0 ; version 0.7.7.0
|
||||||
db 0
|
db 0
|
||||||
.rev dd __REV__
|
.rev dd __REV__
|
||||||
version_end:
|
.size = $ - version_inf
|
||||||
endg
|
endg
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
align 4
|
align 4
|
||||||
@ -2646,7 +2643,7 @@ sys_redrawstat:
|
|||||||
jnz .srl1
|
jnz .srl1
|
||||||
|
|
||||||
mov edx, [current_slot_idx] ; return whole screen draw area for this app
|
mov edx, [current_slot_idx] ; return whole screen draw area for this app
|
||||||
shl edx, 5 ;?
|
shl edx, BSF sizeof.RECT
|
||||||
add edx, draw_data
|
add edx, draw_data
|
||||||
mov [edx + RECT.left], 0
|
mov [edx + RECT.left], 0
|
||||||
mov [edx + RECT.top], 0
|
mov [edx + RECT.top], 0
|
||||||
@ -2814,7 +2811,7 @@ align 4
|
|||||||
|
|
||||||
mov ecx, [thread_count]
|
mov ecx, [thread_count]
|
||||||
movzx eax, word [WIN_POS + ecx*2] ; active window
|
movzx eax, word [WIN_POS + ecx*2] ; active window
|
||||||
shl eax, 8
|
shl eax, BSF sizeof.APPDATA ;8
|
||||||
push eax
|
push eax
|
||||||
|
|
||||||
movzx eax, word [MOUSE_X]
|
movzx eax, word [MOUSE_X]
|
||||||
@ -2824,7 +2821,7 @@ align 4
|
|||||||
.set_mouse_event:
|
.set_mouse_event:
|
||||||
add edi, sizeof.APPDATA
|
add edi, sizeof.APPDATA
|
||||||
add ebx, sizeof.WDATA
|
add ebx, sizeof.WDATA
|
||||||
test [SLOT_BASE + edi + APPDATA.event_mask], 0x80000000
|
test [SLOT_BASE + edi + APPDATA.event_mask], EVM_MOUSE_FILTER
|
||||||
jz .pos_filter
|
jz .pos_filter
|
||||||
|
|
||||||
cmp edi, [esp] ; skip if filtration active
|
cmp edi, [esp] ; skip if filtration active
|
||||||
@ -2832,7 +2829,7 @@ align 4
|
|||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
.pos_filter:
|
.pos_filter:
|
||||||
test [SLOT_BASE + edi + APPDATA.event_mask], 0x40000000
|
test [SLOT_BASE + edi + APPDATA.event_mask], EVM_CURSOR_FILTER
|
||||||
jz .set
|
jz .set
|
||||||
|
|
||||||
mov esi, [ebx + WDATA.box.left]
|
mov esi, [ebx + WDATA.box.left]
|
||||||
@ -2869,14 +2866,14 @@ align 4
|
|||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
backgr:
|
backgr:
|
||||||
mov eax, [draw_data + 32 + RECT.left]
|
mov eax, [draw_data + sizeof.RECT + RECT.left]
|
||||||
shl eax, 16
|
shl eax, 16
|
||||||
add eax, [draw_data + 32 + RECT.right]
|
add eax, [draw_data + sizeof.RECT + RECT.right]
|
||||||
mov [BG_Rect_X_left_right], eax ; [left]*65536 + [right]
|
mov [BG_Rect_X_left_right], eax ; [left]*65536 + [right]
|
||||||
|
|
||||||
mov eax, [draw_data + 32 + RECT.top]
|
mov eax, [draw_data + sizeof.RECT + RECT.top]
|
||||||
shl eax, 16
|
shl eax, 16
|
||||||
add eax, [draw_data + 32 + RECT.bottom]
|
add eax, [draw_data + sizeof.RECT + RECT.bottom]
|
||||||
mov [BG_Rect_Y_top_bottom], eax ; [top]*65536 + [bottom]
|
mov [BG_Rect_Y_top_bottom], eax ; [top]*65536 + [bottom]
|
||||||
|
|
||||||
call drawbackground
|
call drawbackground
|
||||||
@ -2927,10 +2924,10 @@ set_bgr_event:
|
|||||||
jnz backgr
|
jnz backgr
|
||||||
|
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
mov [draw_data + 32 + RECT.left], eax
|
mov [draw_data + sizeof.RECT + RECT.left], eax
|
||||||
mov [draw_data + 32 + RECT.top], eax
|
mov [draw_data + sizeof.RECT + RECT.top], eax
|
||||||
mov [draw_data + 32 + RECT.right], eax
|
mov [draw_data + sizeof.RECT + RECT.right], eax
|
||||||
mov [draw_data + 32 + RECT.bottom], eax
|
mov [draw_data + sizeof.RECT + RECT.bottom], eax
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
nobackgr:
|
nobackgr:
|
||||||
@ -3448,14 +3445,14 @@ r_f_port_area:
|
|||||||
jnz .free_port_area
|
jnz .free_port_area
|
||||||
|
|
||||||
cmp ecx, edx ; beginning > end ?
|
cmp ecx, edx ; beginning > end ?
|
||||||
ja .rpal1
|
ja .err
|
||||||
cmp edx, 65536 ;test ebx, not 0xffff
|
cmp edx, 65536 ;test ebx, not 0xffff
|
||||||
jae .rpal1
|
jae .err
|
||||||
mov eax, [RESERVED_PORTS]
|
mov eax, [RESERVED_PORTS]
|
||||||
test eax, eax ; no reserved areas ?
|
test eax, eax ; no reserved areas ?
|
||||||
je .rpal2
|
je .rpal2
|
||||||
cmp eax, 255 ; max reserved
|
cmp eax, 255 ; max reserved
|
||||||
jae .rpal1
|
jae .err
|
||||||
.rpal3:
|
.rpal3:
|
||||||
mov ebx, eax
|
mov ebx, eax
|
||||||
shl ebx, 4 ;16 byte is sizeof item in RESERVED_PORTS table
|
shl ebx, 4 ;16 byte is sizeof item in RESERVED_PORTS table
|
||||||
@ -3463,15 +3460,16 @@ r_f_port_area:
|
|||||||
cmp ecx, [ebx+8]
|
cmp ecx, [ebx+8]
|
||||||
ja .rpal4
|
ja .rpal4
|
||||||
cmp edx, [ebx+4]
|
cmp edx, [ebx+4]
|
||||||
jae .rpal1
|
jae .err
|
||||||
.rpal4:
|
.rpal4:
|
||||||
dec eax
|
dec eax
|
||||||
jnz .rpal3
|
jnz .rpal3
|
||||||
jmp .rpal2
|
jmp .rpal2
|
||||||
.rpal1:
|
.err:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
inc eax
|
inc eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.rpal2:
|
.rpal2:
|
||||||
; enable port access at port IO map
|
; enable port access at port IO map
|
||||||
pushad ; start enable io map
|
pushad ; start enable io map
|
||||||
@ -3484,7 +3482,7 @@ r_f_port_area:
|
|||||||
inc eax
|
inc eax
|
||||||
cmp eax, edx
|
cmp eax, edx
|
||||||
jbe .new_port_access
|
jbe .new_port_access
|
||||||
;no_unmask_io:
|
|
||||||
sti
|
sti
|
||||||
popad ; end enable io map
|
popad ; end enable io map
|
||||||
|
|
||||||
@ -3551,7 +3549,7 @@ r_f_port_area:
|
|||||||
inc eax
|
inc eax
|
||||||
cmp eax, edx
|
cmp eax, edx
|
||||||
jbe .new_port_access_disable
|
jbe .new_port_access_disable
|
||||||
;no_mask_io: ; end disable io map
|
; end disable io map
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
|
@ -40,6 +40,8 @@ struct SOCKET
|
|||||||
snd_proc dd ?
|
snd_proc dd ?
|
||||||
rcv_proc dd ?
|
rcv_proc dd ?
|
||||||
connect_proc dd ?
|
connect_proc dd ?
|
||||||
|
;sndto_proc dd ?
|
||||||
|
;rcvfrom_proc dd ?
|
||||||
|
|
||||||
ends
|
ends
|
||||||
|
|
||||||
@ -256,7 +258,7 @@ macro socket_init {
|
|||||||
align 4
|
align 4
|
||||||
sys_socket:
|
sys_socket:
|
||||||
|
|
||||||
mov dword[esp+20], 0 ; Set error code to 0
|
mov dword[esp + SYSCALL_STACK.ebx], 0 ; Set error code to 0
|
||||||
|
|
||||||
cmp ebx, 255
|
cmp ebx, 255
|
||||||
jz socket_debug
|
jz socket_debug
|
||||||
@ -277,11 +279,14 @@ sys_socket:
|
|||||||
dd socket_set_opt ; 8
|
dd socket_set_opt ; 8
|
||||||
dd socket_get_opt ; 9
|
dd socket_get_opt ; 9
|
||||||
dd socket_pair ; 10
|
dd socket_pair ; 10
|
||||||
|
|
||||||
|
;dd socket_sendto ; 11
|
||||||
|
;dd socket_recvfrom ; 12
|
||||||
.number = ($ - .table) / 4 - 1
|
.number = ($ - .table) / 4 - 1
|
||||||
|
|
||||||
.error:
|
.error:
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -309,7 +314,7 @@ socket_open:
|
|||||||
test eax, eax
|
test eax, eax
|
||||||
jz .nobuffs
|
jz .nobuffs
|
||||||
|
|
||||||
mov [esp+32], edi ; return socketnumber
|
mov [esp + SYSCALL_STACK.eax], edi ; return socketnumber
|
||||||
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_open: socknum=%u\n", edi
|
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_open: socknum=%u\n", edi
|
||||||
|
|
||||||
test edx, SO_NONBLOCK
|
test edx, SO_NONBLOCK
|
||||||
@ -349,13 +354,13 @@ socket_open:
|
|||||||
push eax
|
push eax
|
||||||
call socket_free
|
call socket_free
|
||||||
pop eax
|
pop eax
|
||||||
mov dword[esp+20], EOPNOTSUPP
|
mov dword[esp + SYSCALL_STACK.ebx], EOPNOTSUPP
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.nobuffs:
|
.nobuffs:
|
||||||
mov dword[esp+20], ENOBUFS
|
mov dword[esp + SYSCALL_STACK.ebx], ENOBUFS
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.raw:
|
.raw:
|
||||||
@ -459,18 +464,18 @@ socket_bind:
|
|||||||
je .af_local
|
je .af_local
|
||||||
|
|
||||||
.notsupp:
|
.notsupp:
|
||||||
mov dword[esp+20], EOPNOTSUPP
|
mov dword[esp + SYSCALL_STACK.ebx], EOPNOTSUPP
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.af_local:
|
.af_local:
|
||||||
; TODO: write code here
|
; TODO: write code here
|
||||||
mov dword[esp+32], 0
|
mov dword[esp + SYSCALL_STACK.eax], 0
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.af_inet4:
|
.af_inet4:
|
||||||
@ -505,12 +510,12 @@ socket_bind:
|
|||||||
[eax + IP_SOCKET.LocalIP + 0]:1,[eax + IP_SOCKET.LocalIP + 1]:1,\
|
[eax + IP_SOCKET.LocalIP + 0]:1,[eax + IP_SOCKET.LocalIP + 1]:1,\
|
||||||
[eax + IP_SOCKET.LocalIP + 2]:1,[eax + IP_SOCKET.LocalIP + 3]:1
|
[eax + IP_SOCKET.LocalIP + 2]:1,[eax + IP_SOCKET.LocalIP + 3]:1
|
||||||
|
|
||||||
mov dword[esp+32], 0
|
mov dword[esp + SYSCALL_STACK.eax], 0
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.addrinuse:
|
.addrinuse:
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
mov dword[esp+20], EADDRINUSE
|
mov dword[esp + SYSCALL_STACK.ebx], EADDRINUSE
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -549,24 +554,24 @@ socket_connect:
|
|||||||
|
|
||||||
call [eax + SOCKET.connect_proc]
|
call [eax + SOCKET.connect_proc]
|
||||||
|
|
||||||
mov dword[esp+20], ebx
|
mov dword[esp + SYSCALL_STACK.ebx], ebx
|
||||||
mov dword[esp+32], eax
|
mov dword[esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
.notsupp:
|
.notsupp:
|
||||||
mov dword[esp+20], EOPNOTSUPP
|
mov dword[esp + SYSCALL_STACK.ebx], EOPNOTSUPP
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.already:
|
.already:
|
||||||
mov dword[esp+20], EALREADY
|
mov dword[esp + SYSCALL_STACK.ebx], EALREADY
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -627,22 +632,22 @@ socket_listen:
|
|||||||
init_queue (eax + SOCKET_QUEUE_LOCATION) ; Set up sockets queue
|
init_queue (eax + SOCKET_QUEUE_LOCATION) ; Set up sockets queue
|
||||||
pop eax
|
pop eax
|
||||||
|
|
||||||
mov dword[esp+32], 0
|
mov dword[esp + SYSCALL_STACK.eax], 0
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.notsupp:
|
.notsupp:
|
||||||
mov dword[esp+20], EOPNOTSUPP
|
mov dword[esp + SYSCALL_STACK.ebx], EOPNOTSUPP
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.already:
|
.already:
|
||||||
mov dword[esp+20], EALREADY
|
mov dword[esp + SYSCALL_STACK.ebx], EALREADY
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -694,7 +699,7 @@ socket_accept:
|
|||||||
|
|
||||||
; Return socket number to caller
|
; Return socket number to caller
|
||||||
mov eax, [eax + SOCKET.Number]
|
mov eax, [eax + SOCKET.Number]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.block:
|
.block:
|
||||||
@ -705,18 +710,18 @@ socket_accept:
|
|||||||
jmp .loop
|
jmp .loop
|
||||||
|
|
||||||
.wouldblock:
|
.wouldblock:
|
||||||
mov dword[esp+20], EWOULDBLOCK
|
mov dword[esp + SYSCALL_STACK.ebx], EWOULDBLOCK
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.notsupp:
|
.notsupp:
|
||||||
mov dword[esp+20], EOPNOTSUPP
|
mov dword[esp + SYSCALL_STACK.ebx], EOPNOTSUPP
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;-----------------------------------------------------------------;
|
;-----------------------------------------------------------------;
|
||||||
@ -739,7 +744,7 @@ socket_close:
|
|||||||
test eax, eax
|
test eax, eax
|
||||||
jz .invalid
|
jz .invalid
|
||||||
|
|
||||||
mov dword[esp+32], 0 ; The socket exists, so we will succeed in closing it.
|
mov dword[esp + SYSCALL_STACK.eax], 0 ; The socket exists, so we will succeed in closing it.
|
||||||
|
|
||||||
or [eax + SOCKET.options], SO_NONBLOCK ; Mark the socket as non blocking, we dont want it to block any longer!
|
or [eax + SOCKET.options], SO_NONBLOCK ; Mark the socket as non blocking, we dont want it to block any longer!
|
||||||
|
|
||||||
@ -772,8 +777,8 @@ socket_close:
|
|||||||
|
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -831,8 +836,8 @@ socket_receive:
|
|||||||
.return_err:
|
.return_err:
|
||||||
mov ecx, -1
|
mov ecx, -1
|
||||||
.return:
|
.return:
|
||||||
mov [esp+20], ebx
|
mov [esp + SYSCALL_STACK.ebx], ebx
|
||||||
mov [esp+32], ecx
|
mov [esp + SYSCALL_STACK.eax], ecx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.last_data:
|
.last_data:
|
||||||
@ -1019,8 +1024,8 @@ socket_send:
|
|||||||
jmp [eax + SOCKET.snd_proc]
|
jmp [eax + SOCKET.snd_proc]
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1029,15 +1034,15 @@ socket_send_udp:
|
|||||||
|
|
||||||
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: UDP\n"
|
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: UDP\n"
|
||||||
|
|
||||||
mov [esp+32], ecx
|
mov [esp + SYSCALL_STACK.eax], ecx
|
||||||
call udp_output
|
call udp_output
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
je .error
|
je .error
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.error:
|
.error:
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
mov dword[esp+20], EMSGSIZE ; FIXME: UDP_output should return error codes!
|
mov dword[esp + SYSCALL_STACK.ebx], EMSGSIZE ; FIXME: UDP_output should return error codes!
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1051,13 +1056,13 @@ socket_send_tcp:
|
|||||||
call socket_ring_write
|
call socket_ring_write
|
||||||
pop eax
|
pop eax
|
||||||
|
|
||||||
mov [esp+32], ecx
|
mov [esp + SYSCALL_STACK.eax], ecx
|
||||||
mov [eax + SOCKET.errorcode], 0
|
mov [eax + SOCKET.errorcode], 0
|
||||||
push eax
|
push eax
|
||||||
call tcp_output ; FIXME: this doesnt look pretty, does it?
|
call tcp_output ; FIXME: this doesnt look pretty, does it?
|
||||||
pop eax
|
pop eax
|
||||||
mov eax, [eax + SOCKET.errorcode]
|
mov eax, [eax + SOCKET.errorcode]
|
||||||
mov [esp+20], eax
|
mov [esp + SYSCALL_STACK.ebx], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1066,15 +1071,15 @@ socket_send_ip:
|
|||||||
|
|
||||||
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: IPv4\n"
|
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: IPv4\n"
|
||||||
|
|
||||||
mov [esp+32], ecx
|
mov [esp + SYSCALL_STACK.eax], ecx
|
||||||
call ipv4_output_raw
|
call ipv4_output_raw
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
je .error
|
je .error
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.error:
|
.error:
|
||||||
mov dword[esp+32], eax
|
mov dword[esp + SYSCALL_STACK.eax], eax
|
||||||
mov dword[esp+20], ebx
|
mov dword[esp + SYSCALL_STACK.ebx], ebx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1083,15 +1088,15 @@ socket_send_icmp:
|
|||||||
|
|
||||||
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: ICMP\n"
|
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: ICMP\n"
|
||||||
|
|
||||||
mov [esp+32], ecx
|
mov [esp + SYSCALL_STACK.eax], ecx
|
||||||
call icmp_output_raw
|
call icmp_output_raw
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
je .error
|
je .error
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.error:
|
.error:
|
||||||
mov dword[esp+32], eax
|
mov dword[esp + SYSCALL_STACK.eax], eax
|
||||||
mov dword[esp+20], ebx
|
mov dword[esp + SYSCALL_STACK.ebx], ebx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1100,7 +1105,7 @@ socket_send_icmp:
|
|||||||
;
|
;
|
||||||
; DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: PPPoE\n"
|
; DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: PPPoE\n"
|
||||||
;
|
;
|
||||||
; mov [esp+32], ecx
|
; mov [esp + SYSCALL_STACK.eax], ecx
|
||||||
; mov ebx, [eax + SOCKET.device]
|
; mov ebx, [eax + SOCKET.device]
|
||||||
;
|
;
|
||||||
; call pppoe_discovery_output ; FIXME: errorcodes
|
; call pppoe_discovery_output ; FIXME: errorcodes
|
||||||
@ -1109,8 +1114,8 @@ socket_send_icmp:
|
|||||||
; ret
|
; ret
|
||||||
;
|
;
|
||||||
; .error:
|
; .error:
|
||||||
; mov dword[esp+32], -1
|
; mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
; mov dword[esp+20], EMSGSIZE
|
; mov dword[esp + SYSCALL_STACK.ebx], EMSGSIZE
|
||||||
; ret
|
; ret
|
||||||
|
|
||||||
|
|
||||||
@ -1147,7 +1152,7 @@ socket_send_local_initialized:
|
|||||||
pop eax
|
pop eax
|
||||||
|
|
||||||
; return the number of written bytes (or errorcode) to application
|
; return the number of written bytes (or errorcode) to application
|
||||||
mov [esp+32], ecx
|
mov [esp + SYSCALL_STACK.eax], ecx
|
||||||
|
|
||||||
; and notify the other end
|
; and notify the other end
|
||||||
call socket_notify
|
call socket_notify
|
||||||
@ -1155,8 +1160,8 @@ socket_send_local_initialized:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1213,12 +1218,12 @@ socket_get_opt:
|
|||||||
jz @f
|
jz @f
|
||||||
mov [eax], ecx
|
mov [eax], ecx
|
||||||
@@:
|
@@:
|
||||||
mov dword [esp+32], 0
|
mov dword [esp + SYSCALL_STACK.eax], 0
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1267,13 +1272,13 @@ socket_set_opt:
|
|||||||
|
|
||||||
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_set_opt: Bound socket %x to device %x\n", eax, edx
|
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_set_opt: Bound socket %x to device %x\n", eax, edx
|
||||||
|
|
||||||
mov dword[esp+32], 0 ; success!
|
mov dword[esp + SYSCALL_STACK.eax], 0 ; success!
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.unbind:
|
.unbind:
|
||||||
mov [eax + SOCKET.device], 0
|
mov [eax + SOCKET.device], 0
|
||||||
|
|
||||||
mov dword[esp+32], 0 ; success!
|
mov dword[esp + SYSCALL_STACK.eax], 0 ; success!
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.ip:
|
.ip:
|
||||||
@ -1284,17 +1289,17 @@ socket_set_opt:
|
|||||||
mov bl, byte[edx + socket_options.optval]
|
mov bl, byte[edx + socket_options.optval]
|
||||||
mov [eax + IP_SOCKET.ttl], bl
|
mov [eax + IP_SOCKET.ttl], bl
|
||||||
|
|
||||||
mov dword[esp+32], 0 ; success!
|
mov dword[esp + SYSCALL_STACK.eax], 0 ; success!
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.already:
|
.already:
|
||||||
mov dword[esp+20], EALREADY
|
mov dword[esp + SYSCALL_STACK.ebx], EALREADY
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1320,7 +1325,7 @@ socket_pair:
|
|||||||
call socket_alloc
|
call socket_alloc
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .nomem1
|
jz .nomem1
|
||||||
mov [esp+32], edi ; application's eax
|
mov [esp + SYSCALL_STACK.eax], edi ; application's eax
|
||||||
|
|
||||||
mov [eax + SOCKET.Domain], AF_LOCAL
|
mov [eax + SOCKET.Domain], AF_LOCAL
|
||||||
mov [eax + SOCKET.Type], SOCK_STREAM
|
mov [eax + SOCKET.Type], SOCK_STREAM
|
||||||
@ -1333,7 +1338,7 @@ socket_pair:
|
|||||||
call socket_alloc
|
call socket_alloc
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .nomem2
|
jz .nomem2
|
||||||
mov [esp+20], edi ; application's ebx
|
mov [esp + SYSCALL_STACK.ebx], edi ; application's ebx
|
||||||
|
|
||||||
mov [eax + SOCKET.Domain], AF_LOCAL
|
mov [eax + SOCKET.Domain], AF_LOCAL
|
||||||
mov [eax + SOCKET.Type], SOCK_STREAM
|
mov [eax + SOCKET.Type], SOCK_STREAM
|
||||||
@ -1359,15 +1364,15 @@ socket_pair:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.nomem2:
|
.nomem2:
|
||||||
mov eax, [esp+20]
|
mov eax, [esp + SYSCALL_STACK.ebx]
|
||||||
call socket_free
|
call socket_free
|
||||||
|
|
||||||
.nomem1:
|
.nomem1:
|
||||||
mov eax, [esp+32]
|
mov eax, [esp + SYSCALL_STACK.eax]
|
||||||
call socket_free
|
call socket_free
|
||||||
|
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
mov dword[esp+20], ENOMEM
|
mov dword[esp + SYSCALL_STACK.ebx], ENOMEM
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1420,12 +1425,12 @@ socket_debug:
|
|||||||
.done:
|
.done:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
stosd
|
stosd
|
||||||
mov dword[esp+32], eax
|
mov dword[esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.invalid:
|
.invalid:
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
mov dword[esp+20], EINVAL
|
mov dword[esp + SYSCALL_STACK.ebx], EINVAL
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -1904,7 +1909,7 @@ socket_notify:
|
|||||||
call socket_check
|
call socket_check
|
||||||
jz .error
|
jz .error
|
||||||
|
|
||||||
; Find the associated thread's TASK_DATA
|
; Find the associated thread's
|
||||||
push ebx ecx esi
|
push ebx ecx esi
|
||||||
mov ebx, [eax + SOCKET.TID]
|
mov ebx, [eax + SOCKET.TID]
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
@ -1936,8 +1941,7 @@ socket_notify:
|
|||||||
|
|
||||||
; Socket and thread exists and socket is of non blocking type.
|
; Socket and thread exists and socket is of non blocking type.
|
||||||
; We'll try to flag an event to the thread.
|
; We'll try to flag an event to the thread.
|
||||||
shl ecx, BSF sizeof.APPDATA
|
or [esi + APPDATA.occurred_events], EVENT_NETWORK
|
||||||
or [SLOT_BASE + ecx + APPDATA.occurred_events], EVENT_NETWORK
|
|
||||||
|
|
||||||
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: poking thread %u!\n", ebx
|
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: poking thread %u!\n", ebx
|
||||||
pop esi ecx ebx
|
pop esi ecx ebx
|
||||||
@ -1948,8 +1952,7 @@ socket_notify:
|
|||||||
; Socket and thread exists and socket is of blocking type
|
; Socket and thread exists and socket is of blocking type
|
||||||
; We'll try to unblock it.
|
; We'll try to unblock it.
|
||||||
and [eax + SOCKET.state], not SS_BLOCKED ; Clear the 'socket is blocked' flag
|
and [eax + SOCKET.state], not SS_BLOCKED ; Clear the 'socket is blocked' flag
|
||||||
shl ecx, BSF sizeof.APPDATA
|
mov [esi + APPDATA.state], TSTATE_RUNNING ; Run the thread
|
||||||
mov [SLOT_BASE + ecx + APPDATA.state], TSTATE_RUNNING ; Run the thread
|
|
||||||
|
|
||||||
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Unblocked socket!\n"
|
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Unblocked socket!\n"
|
||||||
pop esi ecx ebx
|
pop esi ecx ebx
|
||||||
@ -2539,6 +2542,6 @@ socket_cant_send_more:
|
|||||||
jmp socket_notify
|
jmp socket_notify
|
||||||
|
|
||||||
.notconn:
|
.notconn:
|
||||||
mov dword[esp+20], ENOTCONN
|
mov dword[esp + SYSCALL_STACK.ebx], ENOTCONN
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
@ -779,7 +779,7 @@ sys_network:
|
|||||||
jne @f
|
jne @f
|
||||||
|
|
||||||
mov eax, [net_device_count]
|
mov eax, [net_device_count]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
@ -824,7 +824,7 @@ sys_network:
|
|||||||
|
|
||||||
.get_type:
|
.get_type:
|
||||||
mov eax, [eax + NET_DEVICE.device_type]
|
mov eax, [eax + NET_DEVICE.device_type]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.get_dev_name:
|
.get_dev_name:
|
||||||
@ -837,93 +837,93 @@ sys_network:
|
|||||||
rep movsd
|
rep movsd
|
||||||
|
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.reset:
|
.reset:
|
||||||
call [eax + NET_DEVICE.reset]
|
call [eax + NET_DEVICE.reset]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.stop:
|
.stop:
|
||||||
call [eax + NET_DEVICE.unload]
|
call [eax + NET_DEVICE.unload]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
.get_ptr:
|
.get_ptr:
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
.get_drv_name:
|
.get_drv_name:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.packets_tx:
|
.packets_tx:
|
||||||
mov eax, [eax + NET_DEVICE.packets_tx]
|
mov eax, [eax + NET_DEVICE.packets_tx]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.packets_rx:
|
.packets_rx:
|
||||||
mov eax, [eax + NET_DEVICE.packets_rx]
|
mov eax, [eax + NET_DEVICE.packets_rx]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.bytes_tx:
|
.bytes_tx:
|
||||||
mov ebx, dword[eax + NET_DEVICE.bytes_tx + 4]
|
mov ebx, dword[eax + NET_DEVICE.bytes_tx + 4]
|
||||||
mov [esp+20], ebx
|
mov [esp + SYSCALL_STACK.ebx], ebx
|
||||||
mov eax, dword[eax + NET_DEVICE.bytes_tx]
|
mov eax, dword[eax + NET_DEVICE.bytes_tx]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.bytes_rx:
|
.bytes_rx:
|
||||||
mov ebx, dword[eax + NET_DEVICE.bytes_rx + 4]
|
mov ebx, dword[eax + NET_DEVICE.bytes_rx + 4]
|
||||||
mov [esp+20], ebx
|
mov [esp + SYSCALL_STACK.ebx], ebx
|
||||||
mov eax, dword[eax + NET_DEVICE.bytes_rx]
|
mov eax, dword[eax + NET_DEVICE.bytes_rx]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.packets_tx_err:
|
.packets_tx_err:
|
||||||
mov eax, [eax + NET_DEVICE.packets_tx_err]
|
mov eax, [eax + NET_DEVICE.packets_tx_err]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.packets_tx_drop:
|
.packets_tx_drop:
|
||||||
mov eax, [eax + NET_DEVICE.packets_tx_drop]
|
mov eax, [eax + NET_DEVICE.packets_tx_drop]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.packets_tx_ovr:
|
.packets_tx_ovr:
|
||||||
mov eax, [eax + NET_DEVICE.packets_tx_ovr]
|
mov eax, [eax + NET_DEVICE.packets_tx_ovr]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.packets_rx_err:
|
.packets_rx_err:
|
||||||
mov eax, [eax + NET_DEVICE.packets_rx_err]
|
mov eax, [eax + NET_DEVICE.packets_rx_err]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.packets_rx_drop:
|
.packets_rx_drop:
|
||||||
mov eax, [eax + NET_DEVICE.packets_rx_drop]
|
mov eax, [eax + NET_DEVICE.packets_rx_drop]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.packets_rx_ovr:
|
.packets_rx_ovr:
|
||||||
mov eax, [eax + NET_DEVICE.packets_rx_ovr]
|
mov eax, [eax + NET_DEVICE.packets_rx_ovr]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.state:
|
.state:
|
||||||
mov eax, [eax + NET_DEVICE.link_state]
|
mov eax, [eax + NET_DEVICE.link_state]
|
||||||
mov [esp+32], eax
|
mov [esp + SYSCALL_STACK.eax], eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
.doesnt_exist:
|
.doesnt_exist:
|
||||||
.bad_buffer: ; Sanity check failed, exit
|
.bad_buffer: ; Sanity check failed, exit
|
||||||
mov dword[esp+32], -1
|
mov dword[esp + SYSCALL_STACK.eax], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -979,5 +979,5 @@ sys_protocols:
|
|||||||
mov eax, -1
|
mov eax, -1
|
||||||
|
|
||||||
.return:
|
.return:
|
||||||
mov [esp+28+4], eax ; return eax value to the program
|
mov [esp + SYSCALL_STACK.eax], eax ; return eax value to the program
|
||||||
ret
|
ret
|
||||||
|
Loading…
Reference in New Issue
Block a user