From 069292c65843ac4cd0bbd1594232292e8fe30e53 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Tue, 15 Feb 2005 14:38:07 +0000 Subject: (PPC_Set_decrementer, PPC_Get_decrementer): New. --- cpukit/score/cpu/powerpc/rtems/score/cpu.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'cpukit/score/cpu/powerpc') 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 */ -- cgit v1.2.3