Changeset 84757b5 in mainline


Ignore:
Timestamp:
2006-12-13T14:17:37Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f19d77a
Parents:
449dc1ed
Message:

get_cycle() for PPC32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/include/cycle.h

    r449dc1ed r84757b5  
    3838static inline uint64_t get_cycle(void)
    3939{
    40         return 0;
     40        uint32_t lower;
     41        uint32_t upper;
     42        uint32_t upper2;
     43       
     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        );
     55       
     56        return ((uint64_t) upper << 32) + (uint64_t) lower;
    4157}
    4258
Note: See TracChangeset for help on using the changeset viewer.