kolibri-process:use per-process pointers to HDLL structure

git-svn-id: svn://kolibrios.org@4433 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2014-01-08 22:12:08 +00:00
parent a7414ad7ff
commit 5647b8ca46
4 changed files with 16 additions and 31 deletions

View File

@ -1095,10 +1095,9 @@ proc load_library stdcall, file_name:dword
; ignore timestamp ; ignore timestamp
cli cli
mov esi, [CURRENT_TASK] mov esi, [current_process]
shl esi, 8
lea edi, [fullname] lea edi, [fullname]
mov ebx, [esi+SLOT_BASE+APPDATA.dlls_list_ptr] mov ebx, [esi+PROC.dlls_list_ptr]
test ebx, ebx test ebx, ebx
jz .not_in_process jz .not_in_process
mov esi, [ebx+HDLL.fd] mov esi, [ebx+HDLL.fd]
@ -1458,28 +1457,21 @@ endp
; out: eax = APPDATA.dlls_list_ptr if all is OK, ; out: eax = APPDATA.dlls_list_ptr if all is OK,
; NULL if memory allocation failed ; NULL if memory allocation failed
init_dlls_in_thread: init_dlls_in_thread:
mov ebx, [current_slot] mov ebx, [current_process]
mov eax, [ebx+APPDATA.dlls_list_ptr] mov eax, [ebx+PROC.dlls_list_ptr]
test eax, eax test eax, eax
jnz .ret jnz .ret
push [ebx+APPDATA.process]
mov eax, 8 mov eax, 8
call malloc call malloc ; FIXME
pop edx
test eax, eax test eax, eax
jz .ret jz .ret
mov [eax], eax mov [eax], eax
mov [eax+4], eax mov [eax+4], eax
mov ecx, [TASK_COUNT]
mov ebx, SLOT_BASE+256 mov ebx, [current_process]
.set: mov [ebx+PROC.dlls_list_ptr], eax
cmp [ebx+APPDATA.process], edx
jnz @f
mov [ebx+APPDATA.dlls_list_ptr], eax
@@:
add ebx, 256
dec ecx
jnz .set
.ret: .ret:
ret ret

View File

@ -625,11 +625,6 @@ end if
pop ebx ;restore exception number (#PF) pop ebx ;restore exception number (#PF)
ret ret
; xchg bx, bx
; add esp,12 ;clear in stack: locals(.err_addr) + #PF + ret_to_caller
; restore_ring3_context
; iretd
.user_space: .user_space:
test eax, PG_MAP test eax, PG_MAP
jnz .err_access ;Страница присутствует jnz .err_access ;Страница присутствует
@ -669,9 +664,8 @@ end if
; access denied? this may be a result of copy-on-write protection for DLL ; access denied? this may be a result of copy-on-write protection for DLL
; check list of HDLLs ; check list of HDLLs
and ebx, not 0xFFF and ebx, not 0xFFF
mov eax, [CURRENT_TASK] mov eax, [current_process]
shl eax, 8 mov eax, [eax+PROC.dlls_list_ptr]
mov eax, [SLOT_BASE+eax+APPDATA.dlls_list_ptr]
test eax, eax test eax, eax
jz .fail jz .fail
mov esi, [eax+HDLL.fd] mov esi, [eax+HDLL.fd]
@ -904,7 +898,8 @@ proc safe_map_page stdcall, slot:dword, req_access:dword, ofs:dword
push ebx ecx push ebx ecx
mov eax, [slot] mov eax, [slot]
shl eax, 8 shl eax, 8
mov eax, [SLOT_BASE+eax+APPDATA.dlls_list_ptr] mov eax, [SLOT_BASE+eax+APPDATA.process]
mov eax, [eax+PROC.dlls_list_ptr]
test eax, eax test eax, eax
jz .no_hdll jz .no_hdll
mov ecx, [eax+HDLL.fd] mov ecx, [eax+HDLL.fd]

View File

@ -980,9 +980,6 @@ proc new_sys_threads
mov eax, [ebx+APPDATA.process] mov eax, [ebx+APPDATA.process]
mov [edx+APPDATA.process], eax mov [edx+APPDATA.process], eax
mov eax, [ebx+APPDATA.dlls_list_ptr]
mov [edx+APPDATA.dlls_list_ptr], eax
mov eax, [ebx+APPDATA.tls_base] mov eax, [ebx+APPDATA.tls_base]
test eax, eax test eax, eax
jz @F jz @F

View File

@ -105,6 +105,7 @@ struct PROC
heap_base rd 1 ; heap_base rd 1 ;
heap_top rd 1 ; heap_top rd 1 ;
mem_used rd 1 mem_used rd 1
dlls_list_ptr rd 1
pdt_0_phys rd 1 pdt_0_phys rd 1
pdt_1_phys rd 1 pdt_1_phys rd 1
io_map_0 rd 1 io_map_0 rd 1
@ -140,7 +141,7 @@ struct APPDATA
wait_test dd ? ;+96 +++ wait_test dd ? ;+96 +++
wait_param dd ? ;+100 +++ wait_param dd ? ;+100 +++
tls_base dd ? ;+104 tls_base dd ? ;+104
dlls_list_ptr dd ? ;+108 dd ? ;+108
event_filter dd ? ;+112 event_filter dd ? ;+112
draw_bgr_x dd ? ;+116 draw_bgr_x dd ? ;+116
draw_bgr_y dd ? ;+120 draw_bgr_y dd ? ;+120