Rev 1334 | Rev 1345 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1334 | Rev 1344 | ||
---|---|---|---|
Line 55... | Line 55... | ||
55 | ;; |
55 | ;; |
56 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
56 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 57... | Line 57... | ||
57 | 57 | ||
Line 58... | Line 58... | ||
58 | include 'macros.inc' |
58 | include 'macros.inc' |
Line 59... | Line 59... | ||
59 | 59 | ||
Line 60... | Line 60... | ||
60 | $Revision: 1334 $ |
60 | $Revision: 1344 $ |
Line 3395... | Line 3395... | ||
3395 | ; 3 - disable cache. Ret 0 in eax. Ret nothing. Block. ok. |
3395 | ; 3 - disable cache. Ret 0 in eax. Ret nothing. Block. ok. |
3396 | ;eax |
3396 | ;eax |
3397 | ;3 - rdmsr. Counter in edx. (edx:eax) [esi:edi, edx] => [edx:esi, ecx]. Ret in ebx:eax. Block. ok. |
3397 | ;3 - rdmsr. Counter in edx. (edx:eax) [esi:edi, edx] => [edx:esi, ecx]. Ret in ebx:eax. Block. ok. |
3398 | ;4 - wrmsr. Counter in edx. (edx:eax) [esi:edi, edx] => [edx:esi, ecx]. Ret in ebx:eax. Block. ok. |
3398 | ;4 - wrmsr. Counter in edx. (edx:eax) [esi:edi, edx] => [edx:esi, ecx]. Ret in ebx:eax. Block. ok. |
3399 | ;--------------------------------------------------------------------------------------------- |
3399 | ;--------------------------------------------------------------------------------------------- |
- | 3400 | iglobal |
|
- | 3401 | align 4 |
|
- | 3402 | sheduler: |
|
- | 3403 | dd sys_sheduler.00 |
|
- | 3404 | dd change_task |
|
- | 3405 | dd sys_sheduler.02 |
|
- | 3406 | dd sys_sheduler.03 |
|
- | 3407 | dd sys_sheduler.04 |
|
- | 3408 | endg |
|
3400 | sys_sheduler: |
3409 | sys_sheduler: |
3401 | ; old sys_sheduler ;noname & halyavin |
3410 | ;rewritten by |
3402 | ; cmp eax,0 |
3411 | jmp dword [sheduler+eax*4] |
3403 | ; je shed_counter |
3412 | ;.shed_counter: |
3404 | ; cmp eax,2 |
3413 | .00: |
3405 | ; je perf_control |
3414 | mov eax,[context_counter] |
3406 | ; cmp eax,3 |
- | |
3407 | ; je rdmsr_instr |
- | |
3408 | ; cmp eax,4 |
3415 | mov [esp+36],eax |
3409 | ; je wrmsr_instr |
- | |
3410 | ; cmp eax,1 |
3416 | ret |
3411 | ; jne not_supported |
- | |
3412 | ; call change_task ;delay,0 |
- | |
Line -... | Line 3417... | ||
- | 3417 | ||
3413 | 3418 | .02: |
|
3414 | ;rewritten by |
3419 | ;.perf_control: |
3415 | test eax,eax |
3420 | test ebx,ebx |
3416 | jz .shed_counter ;eax=0 |
3421 | jz modify_pce ;if ecx=0 |
3417 | dec eax |
3422 | dec ebx |
3418 | jz change_task ;eax=1 |
3423 | jz is_cache_enabled ;if ecx=1 |
3419 | dec eax |
3424 | dec ebx |
- | 3425 | jz cache_enable ;if ecx=2 |
|
- | 3426 | ret |
|
- | 3427 | .03: |
|
3420 | jz .perf_control ;eax=2 |
3428 | ;.rdmsr_instr: |
3421 | dec eax |
3429 | ;now counter in ecx |
3422 | jz .rdmsr_instr ;eax=3 |
3430 | ;(edx:eax) esi:edi => edx:esi |
3423 | dec eax |
3431 | mov eax,esi |
- | 3432 | ; mov ecx,edx |
|
3424 | jnz @f |
3433 | rdmsr |
- | 3434 | mov [esp+36],eax |
|
- | 3435 | mov [esp+24],edx ;ret in ebx? |
|
- | 3436 | ret |
|
- | 3437 | ||
3425 | ;wrmsr_instr ;eax=4 |
3438 | .04: |
3426 | ;.wrmsr_instr: |
3439 | ;.wrmsr_instr: |
3427 | ;now counter in ecx |
3440 | ;now counter in ecx |
3428 | ;(edx:eax) esi:edi => edx:esi |
3441 | ;(edx:eax) esi:edi => edx:esi |
3429 | ; Fast Call MSR can't be destroy |
3442 | ; Fast Call MSR can't be destroy |
Line 3437... | Line 3450... | ||
3437 | je @f |
3450 | je @f |
3438 | cmp ecx, MSR_AMD_STAR |
3451 | cmp ecx,MSR_AMD_STAR |
3439 | je @f |
3452 | je @f |
Line 3440... | Line 3453... | ||
3440 | 3453 | ||
- | 3454 | mov eax,esi |
|
3441 | mov eax, esi |
3455 | ; mov ecx,edx |
3442 | wrmsr |
3456 | wrmsr |
3443 | ; mov [esp + 36], eax |
3457 | ; mov [esp + 32], eax |
3444 | ; mov [esp + 24], edx ;ret in ebx? |
3458 | ; mov [esp + 20], edx ;ret in ebx? |
3445 | @@: |
3459 | @@: |
Line 3446... | Line -... | ||
3446 | ret |
- | |
3447 | - | ||
3448 | .shed_counter: |
- | |
3449 | mov eax,[context_counter] |
- | |
3450 | mov [esp+36],eax |
- | |
3451 | ret |
- | |
3452 | .perf_control: |
- | |
3453 | ; inc eax ;now eax=3 |
- | |
3454 | add eax,3 ;restore eax=3 |
- | |
3455 | cmp ebx,eax |
- | |
3456 | je cache_disable |
- | |
3457 | dec eax |
- | |
3458 | cmp ebx,eax |
- | |
3459 | je cache_enable |
- | |
3460 | dec eax |
- | |
3461 | cmp ebx,eax |
- | |
3462 | je is_cache_enabled |
- | |
3463 | dec eax |
- | |
3464 | cmp ebx,eax |
- | |
3465 | je modify_pce |
- | |
3466 | ret |
- | |
3467 | - | ||
3468 | .rdmsr_instr: |
- | |
3469 | ;now counter in ecx |
- | |
3470 | ;(edx:eax) esi:edi => edx:esi |
- | |
3471 | mov eax,esi |
- | |
3472 | rdmsr |
- | |
3473 | mov [esp+36],eax |
- | |
3474 | mov [esp+24],edx ;ret in ebx? |
- | |
3475 | ret |
3460 | ret |
3476 | 3461 | ||
3477 | cache_disable: |
3462 | cache_disable: |
3478 | mov eax,cr0 |
3463 | mov eax,cr0 |
3479 | or eax,01100000000000000000000000000000b |
3464 | or eax,01100000000000000000000000000000b |