This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv2] PowerPC - Add a faster way to read the Time Base register
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org, ryan dot arnold at gmail dot com, rth at twiddle dot net
- Date: Wed, 22 Feb 2012 14:32:02 -0500
- Subject: Re: [PATCHv2] PowerPC - Add a faster way to read the Time Base register
- Authentication-results: mr.google.com; spf=pass (google.com: domain of patofiero@gmail.com designates 10.236.77.102 as permitted sender) smtp.mail=patofiero@gmail.com; dkim=pass header.i=patofiero@gmail.com
- References: <20120215195109.GB3592@linux.vnet.ibm.com><1329932962-8962-1-git-send-email-tuliom@linux.vnet.ibm.com>
On Wed, Feb 22, 2012 at 12:49 PM, Tulio Magno Quites Machado Filho
<tuliom@linux.vnet.ibm.com> wrote:
> Add function __ppc_get_timebase() to directly read the Time Base register.
> This is required for applications that measure time at high frequencies
> with high precision that can't afford a syscall.
>
> 2012-02-17 ?Tulio Magno Quites Machado Filho ?<tuliom@linux.vnet.ibm.com>
>
> ? ? ? ?* sysdeps/unix/sysv/linux/powerpc/sys/user.h (__ppc_get_timebase): New
> ? ? ? ?function definition.
> ? ? ? ?* sysdeps/unix/sysv/linux/powerpc/Makefile (tests): Add
> ? ? ? ?test-gettimebase.
> ? ? ? ?* sysdeps/unix/sysv/linux/powerpc/test-gettimebase.c: Test for
> ? ? ? ?__ppc_get_timebase() to catch future ISA opcode/insn changes.
I have nothing to say about the code itself, and I understand the
reason for wanting these kinds of snippets in user.h on glibc since
all users can use them immediately.
However, I guess my question is as follows, and please stop me if I'm
completely wrong, wouldn't it be better to add this kind of routine to
the Power ABI and export it via a different header?
ARM seems to have worked hard to add all sorts of useful routines to
their ABI via the set of __aeabi_* functions. Users can now rely on
them to do real things.
In the grand continuity of good and bad code: is this patch just a
temporary solution?
Cheers,
Carlos.