Rev 1063 | Rev 1071 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1063 | Rev 1067 | ||
---|---|---|---|
Line 54... | Line 54... | ||
54 | ;; |
54 | ;; |
55 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
55 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 56... | Line 56... | ||
56 | 56 | ||
Line 57... | Line 57... | ||
57 | include 'macros.inc' |
57 | include 'macros.inc' |
Line 58... | Line 58... | ||
58 | 58 | ||
Line 59... | Line 59... | ||
59 | $Revision: 1063 $ |
59 | $Revision: 1067 $ |
Line 1011... | Line 1011... | ||
1011 | ; ; |
1011 | ; ; |
1012 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1012 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 1013... | Line 1013... | ||
1013 | 1013 | ||
1014 | checkidle: |
1014 | checkidle: |
1015 | pushad |
- | |
1016 | mov ebx,[timer_ticks] |
1015 | pushad |
1017 | call change_task |
1016 | call change_task |
1018 | jmp idle_loop_entry |
1017 | jmp idle_loop_entry |
1019 | idle_loop: |
1018 | idle_loop: |
1020 | cmp ebx,[timer_ticks] |
1019 | cmp eax,[idlemem] ; eax == [timer_ticks] |
1021 | jne idle_exit |
1020 | jne idle_exit |
1022 | rdtsc ;call _rdtsc |
1021 | rdtsc ;call _rdtsc |
1023 | mov ecx,eax |
1022 | mov ecx,eax |
1024 | hlt |
1023 | hlt |
1025 | rdtsc ;call _rdtsc |
1024 | rdtsc ;call _rdtsc |
1026 | sub eax,ecx |
1025 | sub eax,ecx |
1027 | add [idleuse],eax |
1026 | add [idleuse],eax |
- | 1027 | idle_loop_entry: |
|
1028 | idle_loop_entry: |
1028 | mov eax,[timer_ticks] ; eax = [timer_ticks] |
1029 | cmp [check_idle_semaphore],0 |
1029 | cmp [check_idle_semaphore],0 |
1030 | je idle_loop |
1030 | je idle_loop |
1031 | dec [check_idle_semaphore] |
1031 | dec [check_idle_semaphore] |
- | 1032 | idle_exit: |
|
1032 | idle_exit: |
1033 | mov [idlemem],eax ; eax == [timer_ticks] |
1033 | popad |
1034 | popad |
Line 1034... | Line 1035... | ||
1034 | ret |
1035 | ret |
- | 1036 | ||
1035 | 1037 | uglobal |
|
1036 | uglobal |
1038 | idlemem dd 0x0 |
1037 | idleuse dd 0x0 |
1039 | idleuse dd 0x0 |
1038 | idleusesec dd 0x0 |
1040 | idleusesec dd 0x0 |