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-19 08:36:14 +0100 |
commit | 76ac1ee3bba2a20ded7ea12394af0a633be25ff9 (patch) | |
tree | 802c0a592b72ce017bb0e739f138d1877b9475ab /cpukit/score/src/kern_tc.c | |
parent | taskcreate.c: Add method name to comment to be clearer (diff) | |
download | rtems-76ac1ee3bba2a20ded7ea12394af0a633be25ff9.tar.bz2 |
score: Fix simple timecounter support
Update #2502.
Diffstat (limited to 'cpukit/score/src/kern_tc.c')
-rw-r--r-- | cpukit/score/src/kern_tc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c index 9533e7726d..16d76a1789 100644 --- a/cpukit/score/src/kern_tc.c +++ b/cpukit/score/src/kern_tc.c @@ -65,7 +65,9 @@ __FBSDID("$FreeBSD r284178 2015-06-09T11:49:56Z$"); #ifdef __rtems__ #include <limits.h> #include <rtems.h> -ISR_LOCK_DEFINE(static, _Timecounter_Lock, "Timecounter"); +ISR_LOCK_DEFINE(, _Timecounter_Lock, "Timecounter") +#define _Timecounter_Release(lock_context) \ + _ISR_lock_Release_and_ISR_enable(&_Timecounter_Lock, lock_context) #define hz rtems_clock_get_ticks_per_second() #define printf(...) #define bcopy(x, y, z) memcpy(y, x, z); @@ -1400,7 +1402,7 @@ tc_windup(void) #ifdef __rtems__ ISR_lock_Context lock_context; - _ISR_lock_ISR_disable_and_acquire(&_Timecounter_Lock, &lock_context); + _Timecounter_Acquire(&lock_context); #endif /* __rtems__ */ /* @@ -1555,7 +1557,7 @@ tc_windup(void) timekeep_push_vdso(); #endif /* __rtems__ */ #ifdef __rtems__ - _ISR_lock_Release_and_ISR_enable(&_Timecounter_Lock, &lock_context); + _Timecounter_Release(&lock_context); #endif /* __rtems__ */ } @@ -1980,14 +1982,12 @@ _Timecounter_Tick(void) } #ifdef __rtems__ void -_Timecounter_Tick_simple(uint32_t delta, uint32_t offset) +_Timecounter_Tick_simple(uint32_t delta, uint32_t offset, + ISR_lock_Context *lock_context) { struct bintime bt; struct timehands *th; uint32_t ogen; - ISR_lock_Context lock_context; - - _ISR_lock_ISR_disable_and_acquire(&_Timecounter_Lock, &lock_context); th = timehands; ogen = th->th_generation; @@ -2014,7 +2014,7 @@ _Timecounter_Tick_simple(uint32_t delta, uint32_t offset) time_second = th->th_microtime.tv_sec; time_uptime = th->th_offset.sec; - _ISR_lock_Release_and_ISR_enable(&_Timecounter_Lock, &lock_context); + _Timecounter_Release(lock_context); _Watchdog_Tick(); } |