⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer.cod

📁 Ep93XX TionProV2 BSP
💻 COD
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 13.10.4237 

	TTL	C:\WINCE500\PLATFORM\Ep93xx\Src\Kernel\Hal\Common\.\timer.c
	CODE32

  00000			 AREA	 |.drectve|, DRECTVE
	DCB	"-defaultlib:coredll.lib "
	DCB	"-defaultlib:corelibc.lib "

	EXPORT	|PerfCountValueSinceTick| [ DATA ]

  00000			 AREA	 |.data|, DATA
	 COMMON	|fInterruptFlag|, 0x4


  00000			 AREA	 |.bss|, NOINIT
|PerfCountValueSinceTick| % 0x4
	EXPORT	|CPUEnterIdle|
	IMPORT	|INTERRUPTS_ON|
; File c:\wince500\platform\ep93xx\src\kernel\hal\common\timer.c

  00000			 AREA	 |.text| { |CPUEnterIdle| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$CPUEnterIdle|, PDATA, SELECTION=5, ASSOC=|.text| { |CPUEnterIdle| } ; comdat associative
|$T14406| DCD	|$L14405|
	DCD	0x40000b01
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |CPUEnterIdle| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |CPUEnterIdle| PROC

; 50   : {

  00000		 |$L14405|
  00000	e92d4010	 stmdb       sp!, {r4, lr}
  00004		 |$M14403|

; 51   : //    volatile ULONG ulTemp;
; 52   :     fInterruptFlag = FALSE;

  00004	e59f401c	 ldr         r4, [pc, #0x1C]
  00008	e3a03000	 mov         r3, #0
  0000c	e5843000	 str         r3, [r4]

; 53   : //    ulTemp = *CSC_STBY;
; 54   : 	
; 55   : //	EnterStandbyMode( );
; 56   : 
; 57   :     INTERRUPTS_ON();

  00010	eb000000	 bl          INTERRUPTS_ON
  00014		 |$L14331|

; 58   :     while (!fInterruptFlag) 

  00014	e5943000	 ldr         r3, [r4]
  00018	e3530000	 cmp         r3, #0
  0001c	0afffffc	 beq         |$L14331|

; 59   :     {
; 60   :         // Just sit here. Any interrupt will bump us out.
; 61   :         //
; 62   :         // Execute halt command here.
; 63   :         //
; 64   :     }
; 65   : }

  00020	e8bd4010	 ldmia       sp!, {r4, lr}
  00024	e12fff1e	 bx          lr
  00028		 |$L14408|
  00028	00000000	 DCD         |fInterruptFlag|
  0002c		 |$M14404|

			 ENDP  ; |CPUEnterIdle|

	EXPORT	|CPUGetSysTimerCountMax|

  00000			 AREA	 |.text| { |CPUGetSysTimerCountMax| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$CPUGetSysTimerCountMax|, PDATA, SELECTION=5, ASSOC=|.text| { |CPUGetSysTimerCountMax| } ; comdat associative
|$T14417| DCD	|$L14416|
	DCD	0x40000300
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |CPUGetSysTimerCountMax| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |CPUGetSysTimerCountMax| PROC

; 74   : {

  00000		 |$L14416|
  00000		 |$M14414|

; 75   :     if (dwIdleMSecRequested > IDLE_MAX_MS) 

  00000	e3500080	 cmp         r0, #0x80

; 76   :     {
; 77   :         //
; 78   :         // Our timer isn't capable of idling more than IDLE_MAX_MS milliseconds. 
; 79   :         // We'll have to break the sleep time into reasonable chunks.
; 80   :         //
; 81   :         return IDLE_MAX_MS;

  00004	83a00080	 movhi       r0, #0x80

; 82   :     }
; 83   :     
; 84   :     return dwIdleMSecRequested;
; 85   : }

  00008	e12fff1e	 bx          lr
  0000c		 |$M14415|

			 ENDP  ; |CPUGetSysTimerCountMax|

	EXPORT	|SetSysTimerInterval|

  00000			 AREA	 |.text| { |SetSysTimerInterval| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$SetSysTimerInterval|, PDATA, SELECTION=5, ASSOC=|.text| { |SetSysTimerInterval| } ; comdat associative
|$T14425| DCD	|$L14424|
	DCD	0x40000a00
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |SetSysTimerInterval| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |SetSysTimerInterval| PROC

; 94   : {

  00000		 |$L14424|
  00000		 |$M14422|

; 95   :     // Program the new timer value
; 96   :     //
; 97   : 
; 98   :     *TIM_TIMER1CONTROL  = TIMERCONTROL_CLKSEL | TIMERCONTROL_MODE ;
; 99   :     *TIM_TIMER1LOAD     = dwTicks;

  00000	e59f201c	 ldr         r2, [pc, #0x1C]
  00004	e3a0320b	 mov         r3, #0xB, 4
  00008	e3a01048	 mov         r1, #0x48
  0000c	e3833881	 orr         r3, r3, #0x81, 16
  00010	e5821000	 str         r1, [r2]
  00014	e5830000	 str         r0, [r3]

; 100  :     *TIM_TIMER1CONTROL  = TIMERCONTROL_CLKSEL | TIMERCONTROL_MODE | 
; 101  :                           TIMERCONTROL_ENABLE;

  00018	e3a030c8	 mov         r3, #0xC8
  0001c	e5823000	 str         r3, [r2]

; 102  : 
; 103  : 
; 104  : //	RETAILMSG(1, (TEXT("%d\r\n"),dwCount));
; 105  : }

  00020	e12fff1e	 bx          lr
  00024		 |$L14427|
  00024	b0810008	 DCD         0xb0810008
  00028		 |$M14423|

			 ENDP  ; |SetSysTimerInterval|

	EXPORT	|CPUSetSysTimerCount|

  00000			 AREA	 |.text| { |CPUSetSysTimerCount| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$CPUSetSysTimerCount|, PDATA, SELECTION=5, ASSOC=|.text| { |CPUSetSysTimerCount| } ; comdat associative
|$T14434| DCD	|$L14433|
	DCD	0x40000c00
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |CPUSetSysTimerCount| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |CPUSetSysTimerCount| PROC

; 115  : {

  00000		 |$L14433|
  00000		 |$M14431|

; 116  :     DWORD dwTicks;
; 117  : 
; 118  :     //   
; 119  :     // Determine the number of ticks required for the number of milliseconds 
; 120  :     // requested 
; 121  :     //
; 122  :     dwTicks = dwIdleMSec * RESCHED_INCREMENT;
; 123  :     
; 124  :     //
; 125  :     // Program the new timer value
; 126  :     //
; 127  :     *TIM_TIMER1CONTROL  = TIMERCONTROL_CLKSEL | TIMERCONTROL_MODE ;
; 128  :     *TIM_TIMER1LOAD    = dwTicks;

  00000	e59f2024	 ldr         r2, [pc, #0x24]
  00004	e0603380	 rsb         r3, r0, r0, lsl #7
  00008	e3a0120b	 mov         r1, #0xB, 4
  0000c	e3a00048	 mov         r0, #0x48
  00010	e3811881	 orr         r1, r1, #0x81, 16
  00014	e1a03103	 mov         r3, r3, lsl #2
  00018	e5820000	 str         r0, [r2]
  0001c	e5813000	 str         r3, [r1]

; 129  :     *TIM_TIMER1CONTROL  = TIMERCONTROL_CLKSEL | TIMERCONTROL_MODE | 
; 130  :                           TIMERCONTROL_ENABLE;

  00020	e3a030c8	 mov         r3, #0xC8
  00024	e5823000	 str         r3, [r2]

; 131  : }

  00028	e12fff1e	 bx          lr
  0002c		 |$L14436|
  0002c	b0810008	 DCD         0xb0810008
  00030		 |$M14432|

			 ENDP  ; |CPUSetSysTimerCount|

	EXPORT	|CPUClearSysTimerIRQ|

  00000			 AREA	 |.text| { |CPUClearSysTimerIRQ| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$CPUClearSysTimerIRQ|, PDATA, SELECTION=5, ASSOC=|.text| { |CPUClearSysTimerIRQ| } ; comdat associative
|$T14445| DCD	|$L14444|
	DCD	0x40000900
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |CPUClearSysTimerIRQ| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |CPUClearSysTimerIRQ| PROC

; 142  : {

  00000		 |$L14444|
  00000		 |$M14442|

; 143  :     BOOL    bReturnValue;
; 144  : 
; 145  :     bReturnValue = (*VIC1_RAWINTR & INT1_TIMER1);

  00000	e59f3018	 ldr         r3, [pc, #0x18]
  00004	e5933000	 ldr         r3, [r3]
  00008	e2130010	 ands        r0, r3, #0x10

; 146  :     if(bReturnValue)
; 147  :     {
; 148  :         *TIM_TIMER1CLEAR = 0;

  0000c	159f3008	 ldrne       r3, [pc, #8]
  00010	13a02000	 movne       r2, #0
  00014	15832000	 strne       r2, [r3]

; 149  :     }
; 150  : 
; 151  :     //
; 152  :     // Return if an interrupt was pending.
; 153  :     //
; 154  :     return(bReturnValue);
; 155  : }

  00018	e12fff1e	 bx          lr
  0001c		 |$L14447|
  0001c	b081000c	 DCD         0xb081000c
  00020	b00b0008	 DCD         0xb00b0008
  00024		 |$M14443|

			 ENDP  ; |CPUClearSysTimerIRQ|

	EXPORT	|PerfCountFreq|

  00000			 AREA	 |.text| { |PerfCountFreq| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$PerfCountFreq|, PDATA, SELECTION=5, ASSOC=|.text| { |PerfCountFreq| } ; comdat associative
|$T14455| DCD	|$L14454|
	DCD	0x40000300
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |PerfCountFreq| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |PerfCountFreq| PROC

; 165  : {

  00000		 |$L14454|
  00000		 |$M14452|

; 166  :     //
; 167  :     // Need to change this to the 1 us debug timer.
; 168  :     //
; 169  :     return OEM_CLOCK_FREQ;

  00000	e3a0091f	 mov         r0, #0x1F, 18
  00004	e3800f8d	 orr         r0, r0, #0x8D, 30

; 170  : }

  00008	e12fff1e	 bx          lr
  0000c		 |$M14453|

			 ENDP  ; |PerfCountFreq|

	EXPORT	|PerfCountSinceTick|
	IMPORT	|dwReschedIncrement|

  00000			 AREA	 |.text| { |PerfCountSinceTick| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$PerfCountSinceTick|, PDATA, SELECTION=5, ASSOC=|.text| { |PerfCountSinceTick| } ; comdat associative
|$T14465| DCD	|$L14464|
	DCD	0x40000c00
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |PerfCountSinceTick| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |PerfCountSinceTick| PROC

; 179  : {

  00000		 |$L14464|
  00000		 |$M14462|

; 180  : //    DWORD intstatus = (*VIC1_RAWINTR | INT1_TIMER1);
; 181  :     DWORD dwCount;
; 182  :     
; 183  :     // if an interrupt is pending we have gone past the count limit
; 184  :     /*if(intstatus ) 
; 185  :     {
; 186  :         //
; 187  :         // We don't really know how long we are overdue, so just return one 
; 188  :         // tick's worth of counts
; 189  :         //
; 190  :         dwCount = dwReschedIncrement;
; 191  :     } 
; 192  :     else */
; 193  :     {
; 194  :         //
; 195  :         // Timer counts down, so calculate the number of ticks elapsed.
; 196  :         //
; 197  :         dwCount = dwReschedIncrement - *TIM_TIMER1VALUE;

  00000	e59f3024	 ldr         r3, [pc, #0x24]
  00004	e59f201c	 ldr         r2, [pc, #0x1C]

; 198  :     }
; 199  :     
; 200  :     return dwCount + PerfCountValueSinceTick;

  00008	e59f1014	 ldr         r1, [pc, #0x14]
  0000c	e5930000	 ldr         r0, [r3]
  00010	e5923000	 ldr         r3, [r2]
  00014	e5912000	 ldr         r2, [r1]
  00018	e0403003	 sub         r3, r0, r3
  0001c	e0820003	 add         r0, r2, r3

; 201  : }

  00020	e12fff1e	 bx          lr
  00024		 |$L14467|
  00024	00000000	 DCD         |PerfCountValueSinceTick|
  00028	b0810004	 DCD         0xb0810004
  0002c	00000000	 DCD         |dwReschedIncrement|
  00030		 |$M14463|

			 ENDP  ; |PerfCountSinceTick|

	EXPORT	|InitClock|

  00000			 AREA	 |.text| { |InitClock| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$InitClock|, PDATA, SELECTION=5, ASSOC=|.text| { |InitClock| } ; comdat associative
|$T14473| DCD	|$L14472|
	DCD	0x40001300
; Function compile flags: /Ogsy

  00000			 AREA	 |.text| { |InitClock| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |InitClock| PROC

; 210  : {

  00000		 |$L14472|
  00000		 |$M14470|

; 211  :     //
; 212  :     // Initialize and start scheduler timer. Initialize the clock to
; 213  :     // 508Khz, Perodic mode.
; 214  :     //
; 215  : 
; 216  :     dwReschedIncrement =RESCHED_INCREMENT;

  00000	e59f3040	 ldr         r3, [pc, #0x40]

; 217  : 
; 218  :     *TIM_TIMER1LOAD    = dwReschedIncrement; //508*RESCHED_PERIOD;//dwReschedIncrement;

  00004	e3a00f7f	 mov         r0, #0x7F, 30
  00008	e3a0220b	 mov         r2, #0xB, 4

; 219  :     *TIM_TIMER1CONTROL = TIMERCONTROL_CLKSEL | TIMERCONTROL_MODE | 
; 220  :                          TIMERCONTROL_ENABLE;

  0000c	e5830000	 str         r0, [r3]
  00010	e59f102c	 ldr         r1, [pc, #0x2C]
  00014	e3a03f7f	 mov         r3, #0x7F, 30
  00018	e3822881	 orr         r2, r2, #0x81, 16
  0001c	e5823000	 str         r3, [r2]
  00020	e3a030c8	 mov         r3, #0xC8
  00024	e5813000	 str         r3, [r1]

; 221  : 
; 222  : //    *TIM_TIMER3CONTROL = TIMERCONTROL_CLKSEL  |
; 223  : //                         TIMERCONTROL_ENABLE;
; 224  : 
; 225  :     *TIM_DEBUGVALUEHIGH = 0;

  00028	e59f3010	 ldr         r3, [pc, #0x10]
  0002c	e3a02000	 mov         r2, #0
  00030	e5832000	 str         r2, [r3]

; 226  :     *TIM_DEBUGVALUEHIGH = DEBUGVALUEHIGH_ENABLE;

  00034	e3a02c01	 mov         r2, #1, 24
  00038	e5832000	 str         r2, [r3]

; 227  : }

  0003c	e12fff1e	 bx          lr
  00040		 |$L14475|
  00040	b0810064	 DCD         0xb0810064
  00044	b0810008	 DCD         0xb0810008
  00048	00000000	 DCD         |dwReschedIncrement|
  0004c		 |$M14471|

			 ENDP  ; |InitClock|

	END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -