[rtems commit] LEON3: clock timer indexing should be consequent

gedare at rtems.org gedare at rtems.org
Thu Mar 29 19:07:23 UTC 2012


Module:    rtems
Branch:    master
Commit:    4fa6be9779eca5718fd314c44610ccdf4c6ff4e7
Changeset: http://git.rtems.org/rtems/commit/?id=4fa6be9779eca5718fd314c44610ccdf4c6ff4e7

Author:    Daniel Hellstrom <daniel at gaisler.com>
Date:      Thu Mar 29 13:52:13 2012 +0200

LEON3: clock timer indexing should be consequent

Signed-off-by: Daniel Hellstrom <daniel at gaisler.com>

---

 c/src/lib/libbsp/sparc/leon3/clock/ckinit.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
index 86a968f..932b8fd 100644
--- a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
+++ b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
@@ -54,7 +54,7 @@ static int clkirq;
       } \
     } while(0)
 #else
-  #define Adjust_clkirq_for_node()
+  #define Adjust_clkirq_for_node() do { clkirq += LEON3_CLOCK_INDEX; } while(0)
 #endif
 
 #define Clock_driver_support_find_timer() \
@@ -102,10 +102,10 @@ uint32_t bsp_clock_nanoseconds_since_last_tick(void)
   if ( !LEON3_Timer_Regs )
     return 0;
 
-  clicks = LEON3_Timer_Regs->timer[0].value;
+  clicks = LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].value;
 
   if ( LEON_Is_interrupt_pending( clkirq ) ) {
-    clicks = LEON3_Timer_Regs->timer[0].value;
+    clicks = LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].value;
     usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
   } else {
     usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);




More information about the vc mailing list