Changeset ed46b47 in rtems for c/src/lib/libbsp/powerpc/support


Ignore:
Timestamp:
Dec 21, 1999, 8:29:40 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
2116e33
Parents:
56018097
Message:

Moved PPC_Set_decrementer() and PPC_Get_timebase_register() to
old_exception_processing tree.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/support/new_exception_processing/cpu.h

    r56018097 red46b47  
    939939  (((value&0xff) << 8) | ((value >> 8)&0xff))
    940940
    941 /*
    942  *  Routines to access the decrementer register
    943  */
    944 
    945 #define PPC_Set_decrementer( _clicks ) \
    946   do { \
    947     asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
    948   } while (0)
    949 
    950 /*
    951  *  Routines to access the time base register
    952  */
    953 
    954 static inline unsigned64 PPC_Get_timebase_register( void )
    955 {
    956   unsigned32 tbr_low;
    957   unsigned32 tbr_high;
    958   unsigned32 tbr_high_old;
    959   unsigned64 tbr;
    960 
    961   do {
    962     asm volatile( "mftbu %0" : "=r" (tbr_high_old));
    963     asm volatile( "mftb  %0" : "=r" (tbr_low));
    964     asm volatile( "mftbu %0" : "=r" (tbr_high));
    965   } while ( tbr_high_old != tbr_high );
    966 
    967   tbr = tbr_high;
    968   tbr <<= 32;
    969   tbr |= tbr_low;
    970   return tbr;
    971 }
    972 
    973941#endif /* ndef ASM */
    974942
Note: See TracChangeset for help on using the changeset viewer.