1 #ifndef _ASMPOWERPC_TIME_H_ 2 #define _ASMPOWERPC_TIME_H_ 3 4 #include <libcflat.h> 5 #include <asm/processor.h> 6 #include <asm/reg.h> 7 get_tb(void)8static inline uint64_t get_tb(void) 9 { 10 return mfspr(SPR_TB); 11 } 12 13 extern uint64_t get_clock_us(void); 14 extern uint64_t get_clock_ms(void); 15 extern void delay(uint64_t cycles); 16 extern void udelay(uint64_t us); 17 extern void sleep_tb(uint64_t cycles); 18 extern void usleep(uint64_t us); 19 mdelay(uint64_t ms)20static inline void mdelay(uint64_t ms) 21 { 22 while (ms--) 23 udelay(1000); 24 } 25 msleep(uint64_t ms)26static inline void msleep(uint64_t ms) 27 { 28 usleep(ms * 1000); 29 } 30 31 #endif /* _ASMPOWERPC_TIME_H_ */ 32