Changes in kernel/arch/ppc32/include/cycle.h [df4ed85:7a0359b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/include/cycle.h
rdf4ed85 r7a0359b 36 36 #define KERN_ppc32_CYCLE_H_ 37 37 38 static inline uint64_t get_cycle(void) 38 #include <trace.h> 39 40 NO_TRACE static inline uint64_t get_cycle(void) 39 41 { 40 42 uint32_t lower; 41 43 uint32_t upper; 42 uint32_t upper2;44 uint32_t tmp; 43 45 44 asm volatile ( 45 "1: mftbu %0\n" 46 "mftb %1\n" 47 "mftbu %2\n" 48 "cmpw %0, %2\n" 49 "bne- 1b\n" 50 : "=r" (upper), 51 "=r" (lower), 52 "=r" (upper2) 53 :: "cr0" 54 ); 46 do { 47 asm volatile ( 48 "mftbu %[upper]\n" 49 "mftb %[lower]\n" 50 "mftbu %[tmp]\n" 51 : [upper] "=r" (upper), 52 [lower] "=r" (lower), 53 [tmp] "=r" (tmp) 54 ); 55 } while (upper != tmp); 55 56 56 57 return ((uint64_t) upper << 32) + (uint64_t) lower;
Note:
See TracChangeset
for help on using the changeset viewer.