📄 idle.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.4237
TTL C:\WINCE500\PLATFORM\Ep93xx\Src\Kernel\Hal\Common\.\idle.c
CODE32
00000 AREA |.drectve|, DRECTVE
DCB "-defaultlib:coredll.lib "
DCB "-defaultlib:corelibc.lib "
EXPORT |CurTicks| [ DATA ]
00000 AREA |.bss|, NOINIT
|CurTicks| % 0x8
EXPORT |OEMIdle|
IMPORT |CPUEnterIdle|
IMPORT |PerfCountSinceTick|
IMPORT |curridlehigh|
IMPORT |curridlelow|
IMPORT |CurMSec|
IMPORT |dwReschedTime|
; File c:\wince500\platform\ep93xx\src\kernel\hal\common\idle.c
00000 AREA |.text| { |OEMIdle| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$OEMIdle|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMIdle| } ; comdat associative
|$T14491| DCD |$L14490|
DCD 0x40002a01
; Function compile flags: /Ogsy
00000 AREA |.text| { |OEMIdle| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMIdle| PROC
; 89 : {
00000 |$L14490|
00000 e92d40f0 stmdb sp!, {r4 - r7, lr}
00004 |$M14488|
; 90 : UINT32 baseMSec ;
; 91 : ULARGE_INTEGER idle;
; 92 : UINT32 idleMSec;
; 93 :
; 94 : INT32 usedCounts, idleCounts;
; 95 :
; 96 : // Get current system timer counter
; 97 : baseMSec = CurMSec;
00004 e59f5098 ldr r5, [pc, #0x98]
; 98 :
; 99 : idleMSec = dwReschedTime - baseMSec;
00008 e59f6090 ldr r6, [pc, #0x90]
0000c e5952000 ldr r2, [r5]
00010 e5963000 ldr r3, [r6]
00014 e0434002 sub r4, r3, r2
; 100 :
; 101 : // Idle time has expired - we need to return
; 102 : if ((INT32)idleMSec <= 0) return;
00018 e3540000 cmp r4, #0
0001c da00001a ble |$L14358|
; 103 :
; 104 : // Find how many hi-res ticks was already used
; 105 : usedCounts = PerfCountSinceTick();
00020 eb000000 bl PerfCountSinceTick
00024 e1a07000 mov r7, r0
; 106 :
; 107 : /* usedMSec=usedCounts/OEM_COUNT_1MS;
; 108 : if ( idleMSec + usedMSec > IDLE_MAX_MS)
; 109 : {
; 110 : idleMSec=IDLE_MAX_MS-usedMSec;
; 111 : }*/
; 112 :
; 113 : // We should wait this time
; 114 : idleCounts = OEM_COUNT_1MS * idleMSec;
00028 e0643384 rsb r3, r4, r4, lsl #7
; 115 :
; 116 : // Move SoC/CPU to idle mode
; 117 : CPUEnterIdle( 0 );
0002c e3a00000 mov r0, #0
00030 e1a04103 mov r4, r3, lsl #2
00034 eb000000 bl CPUEnterIdle
; 118 :
; 119 : if ((int)(CurMSec - dwReschedTime) < 0 ) {
00038 e5952000 ldr r2, [r5]
0003c e5963000 ldr r3, [r6]
00040 e0523003 subs r3, r2, r3
00044 5a000001 bpl |$L14367|
; 120 :
; 121 : idleCounts = PerfCountSinceTick();
00048 eb000000 bl PerfCountSinceTick
0004c e1a04000 mov r4, r0
00050 |$L14367|
; 122 : }
; 123 :
; 124 : // Get real idle value. If result is negative we didn't idle at all.
; 125 : idleCounts -= usedCounts;
; 126 : if (idleCounts < 0) idleCounts = 0;
; 127 :
; 128 : // Update idle counters
; 129 : idle.LowPart = curridlelow;
; 130 : idle.HighPart = curridlehigh;
; 131 : idle.QuadPart += idleCounts/OEM_COUNT_1MS;
00050 e59f3044 ldr r3, [pc, #0x44]
00054 e0545007 subs r5, r4, r7
00058 43a05000 movmi r5, #0
0005c e0c3e395 smull lr, r3, r5, r3
00060 e59f4030 ldr r4, [pc, #0x30]
00064 e59f0028 ldr r0, [pc, #0x28]
00068 e0833005 add r3, r3, r5
0006c e5942000 ldr r2, [r4]
00070 e1a03443 mov r3, r3, asr #8
00074 e5901000 ldr r1, [r0]
00078 e0833fa3 add r3, r3, r3, lsr #31
0007c e0922003 adds r2, r2, r3
00080 e0a13fc3 adc r3, r1, r3, asr #31
; 132 : curridlelow = idle.LowPart;
; 133 : curridlehigh = idle.HighPart;
00084 e5803000 str r3, [r0]
00088 e5842000 str r2, [r4]
0008c |$L14358|
; 134 : }
0008c e8bd40f0 ldmia sp!, {r4 - r7, lr}
00090 e12fff1e bx lr
00094 |$L14493|
00094 00000000 DCD |curridlehigh|
00098 00000000 DCD |curridlelow|
0009c 81020409 DCD 0x81020409
000a0 00000000 DCD |dwReschedTime|
000a4 00000000 DCD |CurMSec|
000a8 |$M14489|
ENDP ; |OEMIdle|
EXPORT |SC_GetTickCount|
IMPORT |__rt_udiv64by64|
00000 AREA |.text| { |SC_GetTickCount| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$SC_GetTickCount|, PDATA, SELECTION=5, ASSOC=|.text| { |SC_GetTickCount| } ; comdat associative
|$T14503| DCD |$L14502|
DCD 0x40000e01
; Function compile flags: /Ogsy
00000 AREA |.text| { |SC_GetTickCount| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |SC_GetTickCount| PROC
; 143 : {
00000 |$L14502|
00000 e52de004 str lr, [sp, #-4]!
00004 |$M14500|
; 144 : DWORD dwCount;
; 145 : dwCount=(DWORD)(CurTicks.QuadPart/983);
00004 e59f1028 ldr r1, [pc, #0x28]
00008 e3a02ff5 mov r2, #0xF5, 30
0000c e3822003 orr r2, r2, #3
00010 e5910000 ldr r0, [r1]
00014 e5911004 ldr r1, [r1, #4]
00018 e3a03000 mov r3, #0
0001c eb000000 bl __rt_udiv64by64
; 146 :
; 147 : CurMSec=dwCount;
00020 e59f3008 ldr r3, [pc, #8]
00024 e5830000 str r0, [r3]
; 148 :
; 149 : return dwCount;
; 150 :
; 151 : /*
; 152 : #if (RESCHED_PERIOD==1)
; 153 :
; 154 : // RETAILMSG(1,(L"SC_COUNT %d\r\n",CurMSec));
; 155 : return CurMSec;
; 156 : #else
; 157 : UINT32 count;
; 158 : INT32 offset;
; 159 :
; 160 : // System timer tick period exceeds 1 ms.
; 161 : //
; 162 : // This code adjusts the accuracy of the returned value to the nearest
; 163 : // MSec when the system tick exceeds 1 ms. The following code checks if
; 164 : // a system timer interrupt occurred between reading the CurMSec value
; 165 : // and the call to fetch the HiResTicksSinceSysTick. If so, the value of
; 166 : // CurMSec and Offset is re-read, with the certainty that a system timer
; 167 : // interrupt will not occur again.
; 168 : do {
; 169 : count = CurMSec;
; 170 : offset = PerfCountSinceTick();
; 171 : }
; 172 : while (count != CurMSec);
; 173 :
; 174 : // Adjust the MSec value with the contribution from HiRes counter.
; 175 : count += offset/OEM_COUNT_1MS;
; 176 :
; 177 : return count;
; 178 : #endif
; 179 : */
; 180 : }
00028 e49de004 ldr lr, [sp], #4
0002c e12fff1e bx lr
00030 |$L14505|
00030 00000000 DCD |CurMSec|
00034 00000000 DCD |CurTicks|
00038 |$M14501|
ENDP ; |SC_GetTickCount|
EXPORT |??_C@_1BM@FCDOICL@?$AAO?$AAE?$AAM?$AAP?$AAo?$AAw?$AAe?$AAr?$AAO?$AAf?$AAf?$AA?$AN?$AA?6?$AA?$AA@| [ DATA ] ; `string'
EXPORT |OEMPowerOff|
IMPORT |gdwInterruptMask1|
IMPORT |gdwInterruptMask2|
IMPORT |gdwInterruptWakeMask1|
IMPORT |gdwInterruptWakeMask2|
IMPORT |gfResumeFlag|
IMPORT |dwTimeValueWhenSuspend|
IMPORT |NKDbgPrintfW|
IMPORT |INTERRUPTS_ON|
IMPORT |INTERRUPTS_OFF|
IMPORT |EnterStandbyMode|
IMPORT |gulCS8950KitlUsed|
00000 AREA |.text| { |OEMPowerOff| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$OEMPowerOff|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMPowerOff| } ; comdat associative
|$T14516| DCD |$L14515|
DCD 0x40009102
00000 AREA |.rdata| { |??_C@_1BM@FCDOICL@?$AAO?$AAE?$AAM?$AAP?$AAo?$AAw?$AAe?$AAr?$AAO?$AAf?$AAf?$AA?$AN?$AA?6?$AA?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_1BM@FCDOICL@?$AAO?$AAE?$AAM?$AAP?$AAo?$AAw?$AAe?$AAr?$AAO?$AAf?$AAf?$AA?$AN?$AA?6?$AA?$AA@| DCB "O"
DCB 0x0, "E", 0x0, "M", 0x0, "P", 0x0, "o", 0x0, "w", 0x0, "e"
DCB 0x0, "r", 0x0, "O", 0x0, "f", 0x0, "f", 0x0, 0xd, 0x0, 0xa
DCB 0x0, 0x0, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |OEMPowerOff| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMPowerOff| PROC
; 189 : {
00000 |$L14515|
00000 e92d4ff0 stmdb sp!, {r4 - r11, lr}
00004 e24dd004 sub sp, sp, #4
00008 |$M14513|
; 190 : // volatile ULONG ulTemp;
; 191 : ULONG ulCscPwrCnt, ulCscDevCfg;
; 192 :
; 193 : //
; 194 : // Print out the current clock rates to the debug port.
; 195 : //
; 196 : NKDbgPrintfW( L"OEMPowerOff\r\n" );
00008 e59f0230 ldr r0, [pc, #0x230]
0000c eb000000 bl NKDbgPrintfW
; 197 :
; 198 : INTERRUPTS_OFF();
00010 eb000000 bl INTERRUPTS_OFF
; 199 :
; 200 : //
; 201 : // Replace the interrupt mask with the wake event interrupt mask. These
; 202 : // will be the only interrupts that can wake us from suspend.
; 203 : //
; 204 : *VIC1_INTCLEAR = 0xFFFFFFFF;
; 205 : *VIC2_INTCLEAR = 0xFFFFFFFF;
; 206 :
; 207 : *VIC1_INTENABLE = gdwInterruptWakeMask1 | INT1_TIMER1;
00014 e59f21e0 ldr r2, [pc, #0x1E0]
00018 e3e01000 mvn r1, #0
0001c e59f3218 ldr r3, [pc, #0x218]
00020 e5821000 str r1, [r2]
00024 e59f21c8 ldr r2, [pc, #0x1C8]
00028 e3e01000 mvn r1, #0
; 208 : *VIC2_INTENABLE = gdwInterruptWakeMask2;
; 209 :
; 210 : //
; 211 : // Check to see if there is a kitl connection. If so then
; 212 : // keep the clocks on.
; 213 : //
; 214 : if(!gulCS8950KitlUsed)
0002c e59fa204 ldr r10, [pc, #0x204]
00030 e5821000 str r1, [r2]
00034 e5933000 ldr r3, [r3]
00038 e59f11b0 ldr r1, [pc, #0x1B0]
0003c e59f21f0 ldr r2, [pc, #0x1F0]
00040 e3833010 orr r3, r3, #0x10
00044 e5813000 str r3, [r1]
00048 e5923000 ldr r3, [r2]
0004c e59f2194 ldr r2, [pc, #0x194]
00050 e59f81d8 ldr r8, [pc, #0x1D8]
00054 e59f91d0 ldr r9, [pc, #0x1D0]
00058 e5823000 str r3, [r2]
0005c e59a3000 ldr r3, [r10]
00060 e59f41c0 ldr r4, [pc, #0x1C0]
00064 e59fb1b8 ldr r11, [pc, #0x1B8]
00068 e59f1194 ldr r1, [pc, #0x194]
0006c e59f0194 ldr r0, [pc, #0x194]
00070 e3530000 cmp r3, #0
00074 e3a0e0aa mov lr, #0xAA
00078 e3a02000 mov r2, #0
0007c 1a000018 bne |$L14509|
; 215 : {
; 216 : //
; 217 : // Power down the system clocks here.
; 218 : //
; 219 : ulCscPwrCnt = *CSC_PWRCNT;
00080 e5987000 ldr r7, [r8]
; 220 : ulCscDevCfg = *CSC_DEVCFG;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -