glibc 2.16, released in June, includes this gem: a __ppc_get_timebase() function, which gives Linux applications a convenient way to access PowerPC’s low-overhead time counter. The special timebase register has always been directly accessible from userspace, but previously developers would need to go re-type assembly language out of the PowerPC architecture manuals in order to use it.

Another example of the toolchain providing helpful convenience functions came way back with gcc 4.1, which implemented an architecture-neutral set of atomic memory access functions. In the bad old days before that, programmers who needed atomic memory operations had to translate load-link/store-conditional instructions from the PowerPC architecture manual into gcc inline assembly.

Of course, this new glibc function returns only “ticks”, not time, so applications won’t have a convenient way to relate that to time until __ppc_get_timebase_freq() arrives in the next version of glibc…

One Response to “PowerPC timebase support in glibc 2.16”

  1. Kudos to Ryan Arnold and Tulio Magno Quites Machado Filho, who I’d imagine had to do a lot of arguing to add such a feature. :)

Sorry, the comment form is closed at this time.

© 2000 - 2011 penguinppc.org Suffusion theme by Sayontan Sinha