Rev 1344 | Rev 1362 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1344 | Rev 1345 | ||
---|---|---|---|
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: 1344 $ |
60 | $Revision: 1345 $ |
Line 3406... | Line 3406... | ||
3406 | dd sys_sheduler.03 |
3406 | dd sys_sheduler.03 |
3407 | dd sys_sheduler.04 |
3407 | dd sys_sheduler.04 |
3408 | endg |
3408 | endg |
3409 | sys_sheduler: |
3409 | sys_sheduler: |
3410 | ;rewritten by |
3410 | ;rewritten by |
3411 | jmp dword [sheduler+eax*4] |
3411 | ; jmp dword [sheduler+eax*4] |
- | 3412 | jmp dword [sheduler+ebx*4] |
|
3412 | ;.shed_counter: |
3413 | ;.shed_counter: |
3413 | .00: |
3414 | .00: |
3414 | mov eax,[context_counter] |
3415 | mov eax,[context_counter] |
3415 | mov [esp+36],eax |
3416 | mov [esp+32],eax |
3416 | ret |
3417 | ret |
Line 3417... | Line 3418... | ||
3417 | 3418 | ||
3418 | .02: |
3419 | .02: |
3419 | ;.perf_control: |
3420 | ;.perf_control: |
- | 3421 | ; test ebx,ebx |
|
- | 3422 | ; jz modify_pce ;if ecx=0 |
|
- | 3423 | ; dec ebx |
|
- | 3424 | ; jz is_cache_enabled ;if ecx=1 |
|
- | 3425 | ; dec ebx |
|
- | 3426 | ; jz cache_enable ;if ecx=2 |
|
- | 3427 | ; ret |
|
- | 3428 | ;;;;;;;; |
|
3420 | test ebx,ebx |
3429 | test ecx,ecx |
3421 | jz modify_pce ;if ecx=0 |
3430 | jz modify_pce ;if ecx=0 |
3422 | dec ebx |
3431 | dec ecx |
3423 | jz is_cache_enabled ;if ecx=1 |
3432 | jz is_cache_enabled ;if ecx=1 |
3424 | dec ebx |
3433 | dec ecx |
3425 | jz cache_enable ;if ecx=2 |
3434 | jz cache_enable ;if ecx=2 |
- | 3435 | ret |
|
- | 3436 | ||
- | 3437 | ||
3426 | ret |
3438 | |
3427 | .03: |
3439 | .03: |
3428 | ;.rdmsr_instr: |
3440 | ;.rdmsr_instr: |
3429 | ;now counter in ecx |
3441 | ;now counter in ecx |
3430 | ;(edx:eax) esi:edi => edx:esi |
3442 | ;(edx:eax) esi:edi => edx:esi |
3431 | mov eax,esi |
3443 | mov eax,esi |
3432 | ; mov ecx,edx |
3444 | mov ecx,edx |
3433 | rdmsr |
3445 | rdmsr |
3434 | mov [esp+36],eax |
3446 | mov [esp+32],eax |
3435 | mov [esp+24],edx ;ret in ebx? |
3447 | mov [esp+20],edx ;ret in ebx? |
Line 3436... | Line 3448... | ||
3436 | ret |
3448 | ret |
3437 | 3449 | ||
3438 | .04: |
3450 | .04: |
3439 | ;.wrmsr_instr: |
3451 | ;.wrmsr_instr: |
3440 | ;now counter in ecx |
3452 | ;now counter in ecx |
3441 | ;(edx:eax) esi:edi => edx:esi |
3453 | ;(edx:eax) esi:edi => edx:esi |
3442 | ; Fast Call MSR can't be destroy |
3454 | ; Fast Call MSR can't be destroy |
3443 | ; ® MSR_AMD_EFER ¬®¦® ¨§¬¥ïâì, â.ª. ¢ í⮬ ॣ¨áâॠ«¨è |
3455 | ; ® MSR_AMD_EFER ¬®¦® ¨§¬¥ïâì, â.ª. ¢ í⮬ ॣ¨áâॠ«¨è |
3444 | ; ¢ª«îç îâáï/¢ëª«îç îâáï à áè¨à¥ë¥ ¢®§¬®¦®á⨠|
3456 | ; ¢ª«îç îâáï/¢ëª«îç îâáï à áè¨à¥ë¥ ¢®§¬®¦®á⨠|
3445 | cmp ecx,MSR_SYSENTER_CS |
3457 | cmp edx,MSR_SYSENTER_CS |
3446 | je @f |
3458 | je @f |
3447 | cmp ecx,MSR_SYSENTER_ESP |
3459 | cmp edx,MSR_SYSENTER_ESP |
3448 | je @f |
3460 | je @f |
3449 | cmp ecx,MSR_SYSENTER_EIP |
3461 | cmp edx,MSR_SYSENTER_EIP |
3450 | je @f |
3462 | je @f |
Line 3451... | Line 3463... | ||
3451 | cmp ecx,MSR_AMD_STAR |
3463 | cmp edx,MSR_AMD_STAR |
3452 | je @f |
3464 | je @f |
3453 | 3465 | ||
3454 | mov eax,esi |
3466 | mov eax,esi |
3455 | ; mov ecx,edx |
3467 | mov ecx,edx |
3456 | wrmsr |
3468 | wrmsr |
3457 | ; mov [esp + 32], eax |
3469 | ; mov [esp + 32], eax |
Line 3475... | Line 3487... | ||
3475 | is_cache_enabled: |
3487 | is_cache_enabled: |
3476 | mov eax,cr0 |
3488 | mov eax,cr0 |
3477 | mov ebx,eax |
3489 | mov ebx,eax |
3478 | and eax,01100000000000000000000000000000b |
3490 | and eax,01100000000000000000000000000000b |
3479 | jz cache_disabled |
3491 | jz cache_disabled |
3480 | mov [esp+36],ebx |
3492 | mov [esp+32],ebx |
3481 | cache_disabled: |
3493 | cache_disabled: |
3482 | mov dword [esp+36],eax ;0 |
3494 | mov dword [esp+32],eax ;0 |
3483 | ret |
3495 | ret |
Line 3484... | Line 3496... | ||
3484 | 3496 | ||
3485 | modify_pce: |
3497 | modify_pce: |
3486 | mov eax,cr4 |
3498 | mov eax,cr4 |
3487 | ; mov ebx,0 |
3499 | ; mov ebx,0 |
3488 | ; or bx,100000000b ;pce |
3500 | ; or bx,100000000b ;pce |
3489 | ; xor eax,ebx ;invert pce |
3501 | ; xor eax,ebx ;invert pce |
3490 | bts eax,8 ;pce=cr4[8] |
3502 | bts eax,8 ;pce=cr4[8] |
3491 | mov cr4,eax |
3503 | mov cr4,eax |
3492 | mov [esp+36],eax |
3504 | mov [esp+32],eax |
3493 | ret |
3505 | ret |
Line 3494... | Line 3506... | ||
3494 | ;--------------------------------------------------------------------------------------------- |
3506 | ;--------------------------------------------------------------------------------------------- |