summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/powerpc
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2005-02-15 14:38:07 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2005-02-15 14:38:07 +0000
commit069292c65843ac4cd0bbd1594232292e8fe30e53 (patch)
treef4890c79601c21715b45b08d1f79416271ab5290 /cpukit/score/cpu/powerpc
parent(PPC_Set_decrementer): Remove. (diff)
downloadrtems-069292c65843ac4cd0bbd1594232292e8fe30e53.tar.bz2
(PPC_Set_decrementer, PPC_Get_decrementer): New.
Diffstat (limited to 'cpukit/score/cpu/powerpc')
-rw-r--r--cpukit/score/cpu/powerpc/rtems/score/cpu.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h
index 3c561c0ae1..25ad5d627e 100644
--- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h
@@ -115,7 +115,7 @@ static inline uint32_t CPU_swap_u32(
#endif /* ASM */
-#ifndef /* ASM */
+#ifndef ASM
/*
* Simple spin delay in microsecond units for device drivers.
* This is very dependent on the clock speed of the target.
@@ -145,5 +145,20 @@ static inline uint32_t CPU_swap_u32(
#endif /* ASM */
+#ifndef ASM
+/*
+ * Routines to access the decrementer register
+ */
+
+#define PPC_Set_decrementer( _clicks ) \
+ do { \
+ asm volatile( "mtdec %0" : : "r" ((_clicks)) ); \
+ } while (0)
+
+#define PPC_Get_decrementer( _clicks ) \
+ asm volatile( "mfdec %0" : "=r" (_clicks) )
+
+#endif /* ASM */
+
#endif /* _RTEMS_SCORE_CPU_H */