[rtems commit] powerpc: Fix _CPU_Counter_read() for MPC860

Sebastian Huber sebh at rtems.org
Mon Sep 17 06:58:49 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Sep 14 13:20:05 2018 +0200

powerpc: Fix _CPU_Counter_read() for MPC860

The mpc860 is a RTEMS-specific multilib define, see GCC
"gcc/config/rs6000/rtems.h".

---

 cpukit/score/cpu/powerpc/include/rtems/score/cpu.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h
index a2a1135..beacc28 100644
--- a/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h
@@ -745,6 +745,8 @@ static inline CPU_Counter_ticks _CPU_Counter_read( void )
 #if defined(__PPC_CPU_E6500__)
   /* Use Alternate Time Base */
   __asm__ volatile( "mfspr %0, 526" : "=r" (value) );
+#elif defined(mpc860)
+  __asm__ volatile( "mftb %0" : "=r" (value) );
 #else
   __asm__ volatile( "mfspr %0, 268" : "=r" (value) );
 #endif



More information about the vc mailing list