Changes in kernel/arch/ppc32/include/cycle.h [7a0359b:df4ed85] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/include/cycle.h
r7a0359b rdf4ed85 36 36 #define KERN_ppc32_CYCLE_H_ 37 37 38 #include <trace.h> 39 40 NO_TRACE static inline uint64_t get_cycle(void) 38 static inline uint64_t get_cycle(void) 41 39 { 42 40 uint32_t lower; 43 41 uint32_t upper; 44 uint32_t tmp;42 uint32_t upper2; 45 43 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); 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 ); 56 55 57 56 return ((uint64_t) upper << 32) + (uint64_t) lower;
Note:
See TracChangeset
for help on using the changeset viewer.