It rewritten previously versions (1267,1271)

git-svn-id: svn://kolibrios.org@1273 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2009-11-15 19:29:43 +00:00
parent 7d889b7ff0
commit 4d85919e64

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; Copyright (C) KolibriOS team 2004-2009. All rights reserved.
;; PROGRAMMING: ;; PROGRAMMING:
;; Ivan Poddubny ;; Ivan Poddubny
;; Marat Zakiyanov (Mario79) ;; Marat Zakiyanov (Mario79)
@ -18,6 +18,7 @@
;; Johnny_B ;; Johnny_B
;; SPraid (simba) ;; SPraid (simba)
;; Hidnplayr ;; Hidnplayr
;; Alexey Teplov (<Lrz>)
;; ;;
;; Data in this file was originally part of MenuetOS project which is ;; Data in this file was originally part of MenuetOS project which is
;; distributed under the terms of GNU GPL. It is modified and redistributed as ;; distributed under the terms of GNU GPL. It is modified and redistributed as
@ -1084,55 +1085,42 @@ reserve_irqs_ports:
mov byte [irq_owner+4*14],al ;1 ; ide I mov byte [irq_owner+4*14],al ;1 ; ide I
mov byte [irq_owner+4*15],al ;1 ; ide II mov byte [irq_owner+4*15],al ;1 ; ide II
pop eax pop eax
; RESERVE PORTS
; mov edi,1 ; 0x00-0x2d
push dword 4
pop dword [RESERVED_PORTS] ;,edi
; shl edi,4
push dword 1
pop dword [RESERVED_PORTS+16+0] ;,dword 1
push dword 0
pop dword [RESERVED_PORTS+16+4] ;,dword 0x0
push dword 0x2d
pop dword [RESERVED_PORTS+16+8] ;,dword 0x2d
; inc dword [RESERVED_PORTS] ; 0x30-0x4d ; RESERVE PORTS
; mov edi,[RESERVED_PORTS] push 4
; shl edi,4 pop dword [RESERVED_PORTS] ;,edi
push dword 1
push 1
pop dword [RESERVED_PORTS+16+0] ;,dword 1
and dword [RESERVED_PORTS+16+4],0 ;,dword 0x0
mov dword [RESERVED_PORTS+16+8],0x2d ;,dword 0x2d
push 1
pop dword [RESERVED_PORTS+32+0] ;,dword 1 pop dword [RESERVED_PORTS+32+0] ;,dword 1
push dword 0x30 push 0x30
pop dword [RESERVED_PORTS+32+4] ;,dword 0x30 pop dword [RESERVED_PORTS+32+4] ;,dword 0x30
push dword 0x4d push 0x4d
pop dword [RESERVED_PORTS+32+8] ;,dword 0x4d pop dword [RESERVED_PORTS+32+8] ;,dword 0x4d
; inc dword [RESERVED_PORTS] ; 0x50-0xdf push 1
; mov edi,[RESERVED_PORTS]
; shl edi,4
push dword 1
pop dword [RESERVED_PORTS+48+0] ;,dword 1 pop dword [RESERVED_PORTS+48+0] ;,dword 1
push dword 0x50 push 0x50
pop dword [RESERVED_PORTS+48+4] ;,dword 0x50 pop dword [RESERVED_PORTS+48+4] ;,dword 0x50
push dword 0xdf mov dword [RESERVED_PORTS+48+8],0xdf ;,dword 0xdf
pop dword [RESERVED_PORTS+48+8] ;,dword 0xdf
; inc dword [RESERVED_PORTS] ; 0xe5-0xff push 1
; mov edi,[RESERVED_PORTS]
; shl edi,4
push dword 1
pop dword [RESERVED_PORTS+64+0] ;,dword 1 pop dword [RESERVED_PORTS+64+0] ;,dword 1
push dword 0xe5
pop dword [RESERVED_PORTS+64+4] ;,dword 0xe5
push 0xff
pop dword [RESERVED_PORTS+64+8] ;,dword 0xff
; popad mov dword [RESERVED_PORTS+64+4],0xe5 ;,dword 0xe5
mov dword [RESERVED_PORTS+64+8],0xff ;,dword 0xff
ret ret
setirqreadports: setirqreadports:
mov [irq12read+0],dword 0x60 + 0x01000000 ; read port 0x60 , byte mov [irq12read+0],dword 0x60 + 0x01000000 ; read port 0x60 , byte
mov [irq12read+4],dword 0 ; end of port list and dword [irq12read+4],0 ; end of port list
; mov [irq12read+4],dword 0 ; end of port list
;mov [irq04read+0],dword 0x3f8 + 0x01000000 ; read port 0x3f8 , byte ;mov [irq04read+0],dword 0x3f8 + 0x01000000 ; read port 0x3f8 , byte
;mov [irq04read+4],dword 0 ; end of port list ;mov [irq04read+4],dword 0 ; end of port list
;mov [irq03read+0],dword 0x2f8 + 0x01000000 ; read port 0x2f8 , byte ;mov [irq03read+0],dword 0x2f8 + 0x01000000 ; read port 0x2f8 , byte
@ -3380,54 +3368,38 @@ endg
;3 - rdmsr. Counter in edx. (edx:eax) [esi:edi, edx] => [edx:esi, ecx]. Ret in ebx:eax. Block. ok. ;3 - rdmsr. Counter in edx. (edx:eax) [esi:edi, edx] => [edx:esi, ecx]. Ret in ebx:eax. Block. ok.
;4 - wrmsr. Counter in edx. (edx:eax) [esi:edi, edx] => [edx:esi, ecx]. Ret in ebx:eax. Block. ok. ;4 - wrmsr. Counter in edx. (edx:eax) [esi:edi, edx] => [edx:esi, ecx]. Ret in ebx:eax. Block. ok.
;--------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------
sys_sheduler: ;noname & halyavin sys_sheduler:
cmp eax,0 ; old sys_sheduler ;noname & halyavin
je shed_counter ; cmp eax,0
cmp eax,2 ; je shed_counter
je perf_control ; cmp eax,2
cmp eax,3 ; je perf_control
je rdmsr_instr ; cmp eax,3
cmp eax,4 ; je rdmsr_instr
je wrmsr_instr ; cmp eax,4
cmp eax,1 ; je wrmsr_instr
jne not_supported ; cmp eax,1
call change_task ;delay,0 ; jne not_supported
ret ; call change_task ;delay,0
shed_counter:
mov eax,[context_counter]
mov [esp+36],eax
not_supported:
ret
perf_control:
inc eax ;now eax=3
cmp ebx,eax
je cache_disable
dec eax
cmp ebx,eax
je cache_enable
dec eax
cmp ebx,eax
je is_cache_enabled
dec eax
cmp ebx,eax
je modify_pce
ret
rdmsr_instr: ;rewritten by <Lrz> 15.11.2009
;now counter in ecx test eax,eax
;(edx:eax) esi:edi => edx:esi jz .shed_counter ;eax=0
mov eax,esi dec eax
rdmsr jz change_task ;eax=1
mov [esp+36],eax dec eax
mov [esp+24],edx ;ret in ebx? jz .perf_control ;eax=2
ret dec eax
jz .rdmsr_instr ;eax=3
wrmsr_instr: dec eax
jnz @f
;wrmsr_instr ;eax=4
;.wrmsr_instr:
;now counter in ecx ;now counter in ecx
;(edx:eax) esi:edi => edx:esi ;(edx:eax) esi:edi => edx:esi
; Fast Call MSR can't be destroy ; Fast Call MSR can't be destroy
; Íî MSR_AMD_EFER ìîæíî èçìåíÿòü, ò.ê. â ýòîì ðåãèñòðå ëèø ; <20>® MSR_AMD_EFER ¬®¦­® ¨§¬¥­ïâì, â.ª. ¢ í⮬ ॣ¨áâॠ«¨è
; âêëþ÷àþòñÿ/âûêëþ÷àþòñÿ ðàñøèðåííûå âîçìîæíîñòè ; ¢ª«îç îâáï/¢ëª«îç îâáï à áè¨à¥­­ë¥ ¢®§¬®¦­®áâ¨
cmp ecx, MSR_SYSENTER_CS cmp ecx, MSR_SYSENTER_CS
je @f je @f
cmp ecx, MSR_SYSENTER_ESP cmp ecx, MSR_SYSENTER_ESP
@ -3444,6 +3416,35 @@ wrmsr_instr:
@@: @@:
ret ret
.shed_counter:
mov eax,[context_counter]
mov [esp+36],eax
ret
.perf_control:
; inc eax ;now eax=3
add eax,3 ;restore eax=3
cmp ebx,eax
je cache_disable
dec eax
cmp ebx,eax
je cache_enable
dec eax
cmp ebx,eax
je is_cache_enabled
dec eax
cmp ebx,eax
je modify_pce
ret
.rdmsr_instr:
;now counter in ecx
;(edx:eax) esi:edi => edx:esi
mov eax,esi
rdmsr
mov [esp+36],eax
mov [esp+24],edx ;ret in ebx?
ret
cache_disable: cache_disable:
mov eax,cr0 mov eax,cr0
or eax,01100000000000000000000000000000b or eax,01100000000000000000000000000000b