From 5647b8ca46ac3424c9da6a51d14ab8622a243e47 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Wed, 8 Jan 2014 22:12:08 +0000 Subject: [PATCH] kolibri-process:use per-process pointers to HDLL structure git-svn-id: svn://kolibrios.org@4433 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/kolibri-process/core/dll.inc | 28 +++++++------------ .../branches/kolibri-process/core/memory.inc | 13 +++------ .../branches/kolibri-process/core/taskman.inc | 3 -- kernel/branches/kolibri-process/kernel32.inc | 3 +- 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/kernel/branches/kolibri-process/core/dll.inc b/kernel/branches/kolibri-process/core/dll.inc index 75fa701610..875adee8ac 100644 --- a/kernel/branches/kolibri-process/core/dll.inc +++ b/kernel/branches/kolibri-process/core/dll.inc @@ -1095,10 +1095,9 @@ proc load_library stdcall, file_name:dword ; ignore timestamp cli - mov esi, [CURRENT_TASK] - shl esi, 8 + mov esi, [current_process] lea edi, [fullname] - mov ebx, [esi+SLOT_BASE+APPDATA.dlls_list_ptr] + mov ebx, [esi+PROC.dlls_list_ptr] test ebx, ebx jz .not_in_process mov esi, [ebx+HDLL.fd] @@ -1458,28 +1457,21 @@ endp ; out: eax = APPDATA.dlls_list_ptr if all is OK, ; NULL if memory allocation failed init_dlls_in_thread: - mov ebx, [current_slot] - mov eax, [ebx+APPDATA.dlls_list_ptr] + mov ebx, [current_process] + mov eax, [ebx+PROC.dlls_list_ptr] test eax, eax jnz .ret - push [ebx+APPDATA.process] + mov eax, 8 - call malloc - pop edx + call malloc ; FIXME test eax, eax jz .ret + mov [eax], eax mov [eax+4], eax - mov ecx, [TASK_COUNT] - mov ebx, SLOT_BASE+256 -.set: - cmp [ebx+APPDATA.process], edx - jnz @f - mov [ebx+APPDATA.dlls_list_ptr], eax -@@: - add ebx, 256 - dec ecx - jnz .set + + mov ebx, [current_process] + mov [ebx+PROC.dlls_list_ptr], eax .ret: ret diff --git a/kernel/branches/kolibri-process/core/memory.inc b/kernel/branches/kolibri-process/core/memory.inc index 23e4ba42c7..78ce295873 100644 --- a/kernel/branches/kolibri-process/core/memory.inc +++ b/kernel/branches/kolibri-process/core/memory.inc @@ -625,11 +625,6 @@ end if pop ebx ;restore exception number (#PF) ret -; xchg bx, bx -; add esp,12 ;clear in stack: locals(.err_addr) + #PF + ret_to_caller -; restore_ring3_context -; iretd - .user_space: test eax, PG_MAP jnz .err_access ;Страница присутствует @@ -669,9 +664,8 @@ end if ; access denied? this may be a result of copy-on-write protection for DLL ; check list of HDLLs and ebx, not 0xFFF - mov eax, [CURRENT_TASK] - shl eax, 8 - mov eax, [SLOT_BASE+eax+APPDATA.dlls_list_ptr] + mov eax, [current_process] + mov eax, [eax+PROC.dlls_list_ptr] test eax, eax jz .fail mov esi, [eax+HDLL.fd] @@ -904,7 +898,8 @@ proc safe_map_page stdcall, slot:dword, req_access:dword, ofs:dword push ebx ecx mov eax, [slot] 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 jz .no_hdll mov ecx, [eax+HDLL.fd] diff --git a/kernel/branches/kolibri-process/core/taskman.inc b/kernel/branches/kolibri-process/core/taskman.inc index 13ed7169fc..492d0e0ef0 100644 --- a/kernel/branches/kolibri-process/core/taskman.inc +++ b/kernel/branches/kolibri-process/core/taskman.inc @@ -980,9 +980,6 @@ proc new_sys_threads mov eax, [ebx+APPDATA.process] 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] test eax, eax jz @F diff --git a/kernel/branches/kolibri-process/kernel32.inc b/kernel/branches/kolibri-process/kernel32.inc index 87d2a3ee44..2e8a717527 100644 --- a/kernel/branches/kolibri-process/kernel32.inc +++ b/kernel/branches/kolibri-process/kernel32.inc @@ -105,6 +105,7 @@ struct PROC heap_base rd 1 ; heap_top rd 1 ; mem_used rd 1 + dlls_list_ptr rd 1 pdt_0_phys rd 1 pdt_1_phys rd 1 io_map_0 rd 1 @@ -140,7 +141,7 @@ struct APPDATA wait_test dd ? ;+96 +++ wait_param dd ? ;+100 +++ tls_base dd ? ;+104 - dlls_list_ptr dd ? ;+108 + dd ? ;+108 event_filter dd ? ;+112 draw_bgr_x dd ? ;+116 draw_bgr_y dd ? ;+120