sys function 68 is without shift registers call

git-svn-id: svn://kolibrios.org@1345 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2010-01-02 05:49:10 +00:00
parent 22dfbb516f
commit 58d22770cb
4 changed files with 81 additions and 69 deletions

View File

@ -333,24 +333,24 @@ proc srv_handler stdcall, ioctl:dword
endp endp
; param ; param
; ebx= io_control ; ecx= io_control
; ;
; retval ; retval
; eax= error code ; eax= error code
align 4 align 4
srv_handlerEx: srv_handlerEx:
cmp ebx, OS_BASE cmp ecx, OS_BASE
jae .fail jae .fail
mov eax, [ebx+handle] mov eax, [ecx+handle]
cmp [eax+SRV.magic], ' SRV' cmp [eax+SRV.magic], ' SRV'
jne .fail jne .fail
cmp [eax+SRV.size], SRV.sizeof cmp [eax+SRV.size], SRV.sizeof
jne .fail jne .fail
stdcall [eax+SRV.srv_proc], ebx stdcall [eax+SRV.srv_proc], ecx
ret ret
.fail: .fail:
or eax, -1 or eax, -1

View File

@ -1133,67 +1133,68 @@ f68call:
endg endg
align 4 align 4
f68: f68:
cmp eax,4 cmp ebx,4
jle sys_sheduler jle sys_sheduler
cmp eax, 11 cmp ebx, 11
jb .fail jb .fail
cmp eax, 25 cmp ebx, 25
ja .fail ja .fail
jmp dword [f68call+eax*4-11*4] jmp dword [f68call+ebx*4-11*4]
.11: .11:
call init_heap call init_heap
mov [esp+36], eax mov [esp+32], eax
ret ret
.12: .12:
stdcall user_alloc, ebx stdcall user_alloc, ecx
mov [esp+36], eax mov [esp+32], eax
ret ret
.13: .13:
stdcall user_free, ebx stdcall user_free, ecx
mov [esp+36], eax mov [esp+32], eax
ret ret
.14: .14:
cmp ebx, OS_BASE cmp ecx, OS_BASE
jae .fail jae .fail
mov edi,ebx mov edi,ecx
call get_event_ex call get_event_ex
mov [esp+36], eax mov [esp+32], eax
ret ret
.16: .16:
test ebx, ebx test ecx, ecx
jz .fail jz .fail
cmp ebx, OS_BASE cmp ecx, OS_BASE
jae .fail jae .fail
stdcall get_service, ebx stdcall get_service, ecx
mov [esp+36], eax mov [esp+32], eax
ret ret
.17: .17:
call srv_handlerEx ;ebx call srv_handlerEx ;ecx
mov [esp+36], eax mov [esp+32], eax
ret ret
.19: .19:
cmp ebx, OS_BASE cmp ecx, OS_BASE
jae .fail jae .fail
stdcall load_library, ebx stdcall load_library, ecx
mov [esp+36], eax mov [esp+32], eax
ret ret
.20: .20:
mov eax, ecx mov eax, edx
call user_realloc mov ebx, ecx
mov [esp+36], eax call user_realloc ;in: eax = pointer, ebx = new size
mov [esp+32], eax
ret ret
.21: .21:
cmp ebx, OS_BASE
jae .fail
cmp ecx, OS_BASE cmp ecx, OS_BASE
jae .fail jae .fail
mov edi, ecx cmp ebx, OS_BASE
stdcall load_PE, ebx jae .fail
mov edi, edx
stdcall load_PE, ecx
mov esi, eax mov esi, eax
test eax, eax test eax, eax
jz @F jz @F
@ -1208,45 +1209,45 @@ f68:
mov [eax+SRV.entry], esi mov [eax+SRV.entry], esi
@@: @@:
mov [esp+36], eax mov [esp+32], eax
ret ret
.22: .22:
cmp ebx, OS_BASE cmp ecx, OS_BASE
jae .fail jae .fail
stdcall shmem_open, ebx, ecx, edx stdcall shmem_open, ecx, edx, esi
mov [esp+28], edx mov [esp+24], edx
mov [esp+36], eax mov [esp+32], eax
ret ret
.23: .23:
cmp ebx, OS_BASE cmp ecx, OS_BASE
jae .fail jae .fail
stdcall shmem_close, ebx stdcall shmem_close, ecx
mov [esp+36], eax mov [esp+32], eax
ret ret
.24: .24:
mov eax, [current_slot] mov eax, [current_slot]
xchg ebx, [eax+APPDATA.exc_handler] xchg ecx, [eax+APPDATA.exc_handler]
xchg ecx, [eax+APPDATA.except_mask] xchg edx, [eax+APPDATA.except_mask]
mov [esp+36], ebx ; reg_eax+8 mov [esp+32], ecx ; reg_eax+8
mov [esp+24], ecx ; reg_ebx+8 mov [esp+20], edx ; reg_ebx+8
ret ret
.25: .25:
cmp ebx,32 cmp ecx,32
jae .fail jae .fail
mov eax, [current_slot] mov eax, [current_slot]
btr [eax+APPDATA.except_mask],ebx btr [eax+APPDATA.except_mask],ecx
setc byte[esp+36] setc byte[esp+32]
jecxz @f jecxz @f
bts [eax+APPDATA.except_mask],ebx bts [eax+APPDATA.except_mask],ecx
@@: @@:
ret ret
.fail: .fail:
xor eax, eax xor eax, eax
mov [esp+36], eax mov [esp+32], eax
ret ret
align 4 align 4

View File

@ -20,7 +20,6 @@ cross_order:
call dword [servetable+edi*4] call dword [servetable+edi*4]
ret ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; SYSENTER ENTRY ;; ;; SYSENTER ENTRY ;;
@ -171,7 +170,7 @@ iglobal
dd syscall_putimage_palette; 65-PutImagePalette dd syscall_putimage_palette; 65-PutImagePalette
dd sys_process_def ; 66-Process definitions - keyboard dd sys_process_def ; 66-Process definitions - keyboard
dd sys_window_move ; 67-Window move or resize 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 0 ; 69-Debug
dd file_system_lfn ; 70-Common file system interface, version 2 dd file_system_lfn ; 70-Common file system interface, version 2
; dd 0 ; 71-Window settings ; dd 0 ; 71-Window settings
@ -250,7 +249,7 @@ iglobal
dd cross_order ; 65-PutImagePalette dd cross_order ; 65-PutImagePalette
dd cross_order ; 66-Process definitions - keyboard dd cross_order ; 66-Process definitions - keyboard
dd cross_order ; 67-Window move or resize 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 sys_debug_services ; 69-Debug
dd cross_order ; 70-Common file system interface, version 2 dd cross_order ; 70-Common file system interface, version 2
dd syscall_windowsettings ; 71-Window settings dd syscall_windowsettings ; 71-Window settings

View File

@ -3408,31 +3408,43 @@ sheduler:
endg endg
sys_sheduler: sys_sheduler:
;rewritten by <Lrz> 29.12.2009 ;rewritten by <Lrz> 29.12.2009
jmp dword [sheduler+eax*4] ; jmp dword [sheduler+eax*4]
jmp dword [sheduler+ebx*4]
;.shed_counter: ;.shed_counter:
.00: .00:
mov eax,[context_counter] mov eax,[context_counter]
mov [esp+36],eax mov [esp+32],eax
ret ret
.02: .02:
;.perf_control: ;.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 jz modify_pce ;if ecx=0
dec ebx dec ecx
jz is_cache_enabled ;if ecx=1 jz is_cache_enabled ;if ecx=1
dec ebx dec ecx
jz cache_enable ;if ecx=2 jz cache_enable ;if ecx=2
ret ret
.03: .03:
;.rdmsr_instr: ;.rdmsr_instr:
;now counter in ecx ;now counter in ecx
;(edx:eax) esi:edi => edx:esi ;(edx:eax) esi:edi => edx:esi
mov eax,esi mov eax,esi
; mov ecx,edx mov ecx,edx
rdmsr rdmsr
mov [esp+36],eax mov [esp+32],eax
mov [esp+24],edx ;ret in ebx? mov [esp+20],edx ;ret in ebx?
ret ret
.04: .04:
@ -3442,17 +3454,17 @@ sys_sheduler:
; Fast Call MSR can't be destroy ; Fast Call MSR can't be destroy
; <20>® MSR_AMD_EFER ¬®¦­® ¨§¬¥­ïâì, â.ª. ¢ í⮬ ॣ¨áâॠ«¨è ; <20>® MSR_AMD_EFER ¬®¦­® ¨§¬¥­ïâì, â.ª. ¢ í⮬ ॣ¨áâॠ«¨è
; ¢ª«îç îâáï/¢ëª«îç îâáï à áè¨à¥­­ë¥ ¢®§¬®¦­®á⨠; ¢ª«îç îâáï/¢ëª«îç îâáï à áè¨à¥­­ë¥ ¢®§¬®¦­®áâ¨
cmp ecx,MSR_SYSENTER_CS cmp edx,MSR_SYSENTER_CS
je @f je @f
cmp ecx,MSR_SYSENTER_ESP cmp edx,MSR_SYSENTER_ESP
je @f je @f
cmp ecx,MSR_SYSENTER_EIP cmp edx,MSR_SYSENTER_EIP
je @f je @f
cmp ecx,MSR_AMD_STAR cmp edx,MSR_AMD_STAR
je @f je @f
mov eax,esi mov eax,esi
; mov ecx,edx mov ecx,edx
wrmsr wrmsr
; mov [esp + 32], eax ; mov [esp + 32], eax
; mov [esp + 20], edx ;ret in ebx? ; mov [esp + 20], edx ;ret in ebx?
@ -3477,9 +3489,9 @@ is_cache_enabled:
mov ebx,eax mov ebx,eax
and eax,01100000000000000000000000000000b and eax,01100000000000000000000000000000b
jz cache_disabled jz cache_disabled
mov [esp+36],ebx mov [esp+32],ebx
cache_disabled: cache_disabled:
mov dword [esp+36],eax ;0 mov dword [esp+32],eax ;0
ret ret
modify_pce: modify_pce:
@ -3489,7 +3501,7 @@ modify_pce:
; xor eax,ebx ;invert pce ; xor eax,ebx ;invert pce
bts eax,8 ;pce=cr4[8] bts eax,8 ;pce=cr4[8]
mov cr4,eax mov cr4,eax
mov [esp+36],eax mov [esp+32],eax
ret ret
;--------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------