diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-23 07:29:47 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-01-27 08:09:05 +0100 |
commit | 2145853b009e939dfbe14869b710133f50500a26 (patch) | |
tree | cb4504a3f442a83ea508a03b31aa8379b42790ed /c/src/lib/libbsp/sparc | |
parent | bsps/arm: Fix broken switch statement (diff) | |
download | rtems-2145853b009e939dfbe14869b710133f50500a26.tar.bz2 |
score: Fix simple timecounter support
Close #2502.
Diffstat (limited to 'c/src/lib/libbsp/sparc')
-rw-r--r-- | c/src/lib/libbsp/sparc/erc32/clock/ckinit.c | 10 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/leon2/clock/ckinit.c | 13 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/leon3/clock/ckinit.c | 31 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c | 15 |
4 files changed, 42 insertions, 27 deletions
diff --git a/c/src/lib/libbsp/sparc/erc32/clock/ckinit.c b/c/src/lib/libbsp/sparc/erc32/clock/ckinit.c index 46f99a5e7d..f2d493e73d 100644 --- a/c/src/lib/libbsp/sparc/erc32/clock/ckinit.c +++ b/c/src/lib/libbsp/sparc/erc32/clock/ckinit.c @@ -36,8 +36,6 @@ */ #define CLOCK_VECTOR ERC32_TRAP_TYPE( ERC32_INTERRUPT_REAL_TIME_CLOCK ) -#define Clock_driver_support_at_tick() - #define Clock_driver_support_install_isr( _new, _old ) \ do { \ _old = set_vector( _new, CLOCK_VECTOR, 1 ); \ @@ -66,11 +64,17 @@ static uint32_t erc32_tc_get_timecount( struct timecounter *tc ) ); } +static void erc32_tc_at_tick( rtems_timecounter_simple *tc ) +{ + /* Nothing to do */ +} + static void erc32_tc_tick( void ) { rtems_timecounter_simple_downcounter_tick( &erc32_tc, - erc32_tc_get + erc32_tc_get, + erc32_tc_at_tick ); } diff --git a/c/src/lib/libbsp/sparc/leon2/clock/ckinit.c b/c/src/lib/libbsp/sparc/leon2/clock/ckinit.c index 3dd68e080a..6c2cf98ce2 100644 --- a/c/src/lib/libbsp/sparc/leon2/clock/ckinit.c +++ b/c/src/lib/libbsp/sparc/leon2/clock/ckinit.c @@ -51,9 +51,18 @@ static uint32_t leon2_tc_get_timecount( struct timecounter *tc ) ); } +static void leon2_tc_at_tick( rtems_timecounter_simple *tc ) +{ + /* Nothing to do */ +} + static void leon2_tc_tick( void ) { - rtems_timecounter_simple_downcounter_tick( &leon2_tc, leon2_tc_get ); + rtems_timecounter_simple_downcounter_tick( + &leon2_tc, + leon2_tc_get, + leon2_tc_at_tick + ); } /* @@ -62,8 +71,6 @@ static void leon2_tc_tick( void ) #define CLOCK_VECTOR LEON_TRAP_TYPE( LEON_INTERRUPT_TIMER1 ) -#define Clock_driver_support_at_tick() - #define Clock_driver_support_install_isr( _new, _old ) \ do { \ _old = set_vector( _new, CLOCK_VECTOR, 1 ); \ diff --git a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c index b82b457866..5d645dcd36 100644 --- a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c +++ b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c @@ -69,15 +69,6 @@ static uint32_t leon3_tc_get_timecount_irqmp(struct timecounter *tc) return LEON3_IrqCtrl_Regs->timestamp[0].counter; } -static void leon3_tc_tick(void) -{ - if (leon3_tc_use_irqmp) { - rtems_timecounter_tick(); - } else { - rtems_timecounter_simple_downcounter_tick(&leon3_tc, leon3_tc_get); - } -} - static void leon3_clock_profiling_interrupt_delay(void) { #ifdef RTEMS_PROFILING @@ -111,10 +102,24 @@ static void leon3_clock_profiling_interrupt_delay(void) #endif } -#define Clock_driver_support_at_tick() \ - do { \ - leon3_clock_profiling_interrupt_delay(); \ - } while (0) +static void leon3_tc_at_tick( rtems_timecounter_simple *tc ) +{ + leon3_clock_profiling_interrupt_delay(); +} + +static void leon3_tc_tick(void) +{ + if (leon3_tc_use_irqmp) { + leon3_clock_profiling_interrupt_delay(); + rtems_timecounter_tick(); + } else { + rtems_timecounter_simple_downcounter_tick( + &leon3_tc, + leon3_tc_get, + leon3_tc_at_tick + ); + } +} #define Adjust_clkirq_for_node() do { clkirq += LEON3_CLOCK_INDEX; } while(0) diff --git a/c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c b/c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c index b29f140a02..58e95d1e64 100644 --- a/c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c +++ b/c/src/lib/libbsp/sparc/shared/timer/tlib_ckinit.c @@ -29,7 +29,6 @@ #undef CLOCK_DRIVER_ISRS_PER_TICK #undef CLOCK_DRIVER_USE_FAST_IDLE */ -#define Clock_driver_support_at_tick() /* * Number of Clock ticks since initialization @@ -87,11 +86,17 @@ static uint32_t tlib_tc_get_timecount(struct timecounter *tc) ); } +static void tlib_tc_at_tick(rtems_timecounter_simple *tc) +{ + /* Nothing to do? */ +} + static void tlib_tc_tick(void) { rtems_timecounter_simple_downcounter_tick( &tlib_tc, - tlib_tc_get + tlib_tc_get, + tlib_tc_at_tick ); } @@ -130,16 +135,10 @@ void Clock_isr(void *arg_unused) } while ( _Thread_Executing == _Thread_Idle && _Thread_Heir == _Thread_Executing); - Clock_driver_support_at_tick(); return; #else - /* - * Add custom handling at every tick from bsp.h - */ - Clock_driver_support_at_tick(); - #ifdef CLOCK_DRIVER_ISRS_PER_TICK /* * The driver is multiple ISRs per clock tick. |