From 58d22770cb285a1d86a23986a7ba4f1ab16534a3 Mon Sep 17 00:00:00 2001 From: "Alexey Teplov (" Date: Sat, 2 Jan 2010 05:49:10 +0000 Subject: [PATCH] sys function 68 is without shift registers call git-svn-id: svn://kolibrios.org@1345 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/dll.inc | 8 +-- kernel/trunk/core/memory.inc | 93 ++++++++++++++++++----------------- kernel/trunk/core/syscall.inc | 5 +- kernel/trunk/kernel.asm | 44 +++++++++++------ 4 files changed, 81 insertions(+), 69 deletions(-) diff --git a/kernel/trunk/core/dll.inc b/kernel/trunk/core/dll.inc index 9dcef5934f..870f5ee3fa 100644 --- a/kernel/trunk/core/dll.inc +++ b/kernel/trunk/core/dll.inc @@ -333,24 +333,24 @@ proc srv_handler stdcall, ioctl:dword endp ; param -; ebx= io_control +; ecx= io_control ; ; retval ; eax= error code align 4 srv_handlerEx: - cmp ebx, OS_BASE + cmp ecx, OS_BASE jae .fail - mov eax, [ebx+handle] + mov eax, [ecx+handle] cmp [eax+SRV.magic], ' SRV' jne .fail cmp [eax+SRV.size], SRV.sizeof jne .fail - stdcall [eax+SRV.srv_proc], ebx + stdcall [eax+SRV.srv_proc], ecx ret .fail: or eax, -1 diff --git a/kernel/trunk/core/memory.inc b/kernel/trunk/core/memory.inc index 64133c122b..6e8ed44ee2 100644 --- a/kernel/trunk/core/memory.inc +++ b/kernel/trunk/core/memory.inc @@ -1133,67 +1133,68 @@ f68call: endg align 4 f68: - cmp eax,4 + cmp ebx,4 jle sys_sheduler - cmp eax, 11 + cmp ebx, 11 jb .fail - cmp eax, 25 + cmp ebx, 25 ja .fail - jmp dword [f68call+eax*4-11*4] + jmp dword [f68call+ebx*4-11*4] .11: call init_heap - mov [esp+36], eax + mov [esp+32], eax ret .12: - stdcall user_alloc, ebx - mov [esp+36], eax + stdcall user_alloc, ecx + mov [esp+32], eax ret .13: - stdcall user_free, ebx - mov [esp+36], eax + stdcall user_free, ecx + mov [esp+32], eax ret .14: - cmp ebx, OS_BASE + cmp ecx, OS_BASE jae .fail - mov edi,ebx + mov edi,ecx call get_event_ex - mov [esp+36], eax + mov [esp+32], eax ret .16: - test ebx, ebx + test ecx, ecx jz .fail - cmp ebx, OS_BASE + cmp ecx, OS_BASE jae .fail - stdcall get_service, ebx - mov [esp+36], eax + stdcall get_service, ecx + mov [esp+32], eax ret .17: - call srv_handlerEx ;ebx - mov [esp+36], eax + call srv_handlerEx ;ecx + mov [esp+32], eax ret .19: - cmp ebx, OS_BASE + cmp ecx, OS_BASE jae .fail - stdcall load_library, ebx - mov [esp+36], eax + stdcall load_library, ecx + mov [esp+32], eax ret .20: - mov eax, ecx - call user_realloc - mov [esp+36], eax + mov eax, edx + mov ebx, ecx + call user_realloc ;in: eax = pointer, ebx = new size + mov [esp+32], eax ret .21: - cmp ebx, OS_BASE - jae .fail - cmp ecx, OS_BASE jae .fail - mov edi, ecx - stdcall load_PE, ebx + cmp ebx, OS_BASE + jae .fail + + mov edi, edx + stdcall load_PE, ecx mov esi, eax test eax, eax jz @F @@ -1208,45 +1209,45 @@ f68: mov [eax+SRV.entry], esi @@: - mov [esp+36], eax + mov [esp+32], eax ret .22: - cmp ebx, OS_BASE + cmp ecx, OS_BASE jae .fail - stdcall shmem_open, ebx, ecx, edx - mov [esp+28], edx - mov [esp+36], eax + stdcall shmem_open, ecx, edx, esi + mov [esp+24], edx + mov [esp+32], eax ret .23: - cmp ebx, OS_BASE + cmp ecx, OS_BASE jae .fail - stdcall shmem_close, ebx - mov [esp+36], eax + stdcall shmem_close, ecx + mov [esp+32], eax ret .24: mov eax, [current_slot] - xchg ebx, [eax+APPDATA.exc_handler] - xchg ecx, [eax+APPDATA.except_mask] - mov [esp+36], ebx ; reg_eax+8 - mov [esp+24], ecx ; reg_ebx+8 + xchg ecx, [eax+APPDATA.exc_handler] + xchg edx, [eax+APPDATA.except_mask] + mov [esp+32], ecx ; reg_eax+8 + mov [esp+20], edx ; reg_ebx+8 ret .25: - cmp ebx,32 + cmp ecx,32 jae .fail mov eax, [current_slot] - btr [eax+APPDATA.except_mask],ebx - setc byte[esp+36] + btr [eax+APPDATA.except_mask],ecx + setc byte[esp+32] jecxz @f - bts [eax+APPDATA.except_mask],ebx + bts [eax+APPDATA.except_mask],ecx @@: ret .fail: xor eax, eax - mov [esp+36], eax + mov [esp+32], eax ret align 4 diff --git a/kernel/trunk/core/syscall.inc b/kernel/trunk/core/syscall.inc index d4c6611fd5..a2fa191453 100644 --- a/kernel/trunk/core/syscall.inc +++ b/kernel/trunk/core/syscall.inc @@ -20,7 +20,6 @@ cross_order: call dword [servetable+edi*4] ret - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; SYSENTER ENTRY ;; @@ -171,7 +170,7 @@ iglobal dd syscall_putimage_palette; 65-PutImagePalette dd sys_process_def ; 66-Process definitions - keyboard dd sys_window_move ; 67-Window move or resize - dd f68 ; 68-Some internal services + dd 0 ; 68-Some internal services dd 0 ; 69-Debug dd file_system_lfn ; 70-Common file system interface, version 2 ; dd 0 ; 71-Window settings @@ -250,7 +249,7 @@ iglobal dd cross_order ; 65-PutImagePalette dd cross_order ; 66-Process definitions - keyboard dd cross_order ; 67-Window move or resize - dd cross_order ; 68-Some internal services + dd f68 ; 68-Some internal services dd sys_debug_services ; 69-Debug dd cross_order ; 70-Common file system interface, version 2 dd syscall_windowsettings ; 71-Window settings diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 100a822380..6d463d96ed 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -3408,31 +3408,43 @@ sheduler: endg sys_sheduler: ;rewritten by 29.12.2009 - jmp dword [sheduler+eax*4] +; jmp dword [sheduler+eax*4] + jmp dword [sheduler+ebx*4] ;.shed_counter: .00: mov eax,[context_counter] - mov [esp+36],eax + mov [esp+32],eax ret .02: ;.perf_control: - test ebx,ebx +; test ebx,ebx +; jz modify_pce ;if ecx=0 +; dec ebx +; jz is_cache_enabled ;if ecx=1 +; dec ebx +; jz cache_enable ;if ecx=2 +; ret +;;;;;;;; + test ecx,ecx jz modify_pce ;if ecx=0 - dec ebx + dec ecx jz is_cache_enabled ;if ecx=1 - dec ebx + dec ecx jz cache_enable ;if ecx=2 ret + + + .03: ;.rdmsr_instr: ;now counter in ecx ;(edx:eax) esi:edi => edx:esi mov eax,esi -; mov ecx,edx + mov ecx,edx rdmsr - mov [esp+36],eax - mov [esp+24],edx ;ret in ebx? + mov [esp+32],eax + mov [esp+20],edx ;ret in ebx? ret .04: @@ -3442,17 +3454,17 @@ sys_sheduler: ; Fast Call MSR can't be destroy ; Но MSR_AMD_EFER можно изменять, т.к. в этом регистре лиш ; включаются/выключаются расширенные возможности - cmp ecx,MSR_SYSENTER_CS + cmp edx,MSR_SYSENTER_CS je @f - cmp ecx,MSR_SYSENTER_ESP + cmp edx,MSR_SYSENTER_ESP je @f - cmp ecx,MSR_SYSENTER_EIP + cmp edx,MSR_SYSENTER_EIP je @f - cmp ecx,MSR_AMD_STAR + cmp edx,MSR_AMD_STAR je @f mov eax,esi -; mov ecx,edx + mov ecx,edx wrmsr ; mov [esp + 32], eax ; mov [esp + 20], edx ;ret in ebx? @@ -3477,9 +3489,9 @@ is_cache_enabled: mov ebx,eax and eax,01100000000000000000000000000000b jz cache_disabled - mov [esp+36],ebx + mov [esp+32],ebx cache_disabled: - mov dword [esp+36],eax ;0 + mov dword [esp+32],eax ;0 ret modify_pce: @@ -3489,7 +3501,7 @@ modify_pce: ; xor eax,ebx ;invert pce bts eax,8 ;pce=cr4[8] mov cr4,eax - mov [esp+36],eax + mov [esp+32],eax ret ;---------------------------------------------------------------------------------------------