Changeset c984fb3 in rtems
- Timestamp:
- 05/22/04 15:14:31 (19 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 96e5865
- Parents:
- 138aa38
- Location:
- c/src/lib/libcpu/powerpc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libcpu/powerpc/ChangeLog
r138aa38 rc984fb3 1 2004-05-22 Till Strauman <strauman@slac.stanford.edu> 2 3 PR 619/bsps 4 * mpc6xx/clock/c_clock.c: The PPC decrementer must be reloaded on each 5 clock tick. Currently, this is done by just reloading a fixed value. 6 The attached patch takes into account the time that elapsed since the 7 decrementer crossed zero in order to adjust the value to be 8 re-loaded. Without the patch, the effective system clock cycle is 9 increased by the exception handler latency. 10 1 11 2004-04-13 Ralf Corsepius <ralf_corsepius@rtems.org> 2 12 -
c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c
r138aa38 rc984fb3 74 74 * 75 75 */ 76 76 77 void clockIsr() 77 78 { 79 int decr; 78 80 /* 79 81 * The driver has seen another tick. 80 82 */ 81 82 PPC_Set_decrementer( Clock_Decrementer_value);83 84 85 86 87 88 89 90 rtems_clock_tick();83 do { 84 asm volatile ("mfdec %0; add %0, %0, %1; mtdec %0":"=r"(decr):"r"(Clock_Decrementer_value)); 85 86 Clock_driver_ticks += 1; 87 88 /* 89 * Real Time Clock counter/timer is set to automatically reload. 90 */ 91 rtems_clock_tick(); 92 } while ( decr < 0 ); 91 93 } 92 94 … … 145 147 (rtems_configuration_get_microseconds_per_tick()/1000); 146 148 149 /* set the decrementer now, prior to installing the handler 150 * so no interrupts will happen in a while. 151 */ 152 PPC_Set_decrementer( (unsigned)-1 ); 153 154 /* if a decrementer exception was pending, it is cleared by 155 * executing the default (nop) handler at this point; 156 * The next exception will then be taken by our clock handler. 157 * Clock handler installation initializes the decrementer to 158 * the correct value. 159 */ 160 147 161 if (!BSP_connect_clock_handler ()) { 148 162 printk("Unable to initialize system clock\n"); … … 191 205 else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) 192 206 { 193 if (!BSP_connect_clock_handler ()) { 194 printk("Error installing clock interrupt handler!\n"); 195 rtems_fatal_error_occurred(1); 196 } 207 Clock_initialize(major, minor, 0); 197 208 } 198 209 done:
Note: See TracChangeset
for help on using the changeset viewer.