From 4bf79afb665bfd9b71c49088afaf655b82186522 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 16 Mar 2016 10:28:03 +0100 Subject: timecounter: Avoid invalid memcpy() In uni-processor configurations we have only one timehand. Do not issue a memcpy() with equal source and destination. --- cpukit/score/src/kern_tc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cpukit/score/src/kern_tc.c') diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c index 316a16f05b..bd6ab045b1 100644 --- a/cpukit/score/src/kern_tc.c +++ b/cpukit/score/src/kern_tc.c @@ -1411,10 +1411,16 @@ tc_windup(void) * the contents, the generation must be zero. */ tho = timehands; +#if defined(RTEMS_SMP) th = tho->th_next; +#else + th = tho; +#endif ogen = th->th_generation; tc_setgen(th, 0); +#if defined(RTEMS_SMP) bcopy(tho, th, offsetof(struct timehands, th_generation)); +#endif /* * Capture a timecounter delta on the current timecounter and if @@ -1552,7 +1558,9 @@ tc_windup(void) } #endif +#if defined(RTEMS_SMP) timehands = th; +#endif #ifndef __rtems__ timekeep_push_vdso(); #endif /* __rtems__ */ -- cgit v1.2.3