This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] PowerPC - Add a faster way to read the Time Base register
- From: "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 14 Feb 2012 11:45:35 -0600
- Subject: Re: [PATCH] PowerPC - Add a faster way to read the Time Base register
- References: <1329233454-15224-1-git-send-email-tuliom@linux.vnet.ibm.com>
On Tue, Feb 14, 2012 at 9:30 AM, Tulio Magno Quites Machado Filho
<tuliom@linux.vnet.ibm.com> wrote:
...
> diff --git a/sysdeps/unix/sysv/linux/powerpc/test-gettimebase.c b/sysdeps/unix/sysv/linux/powerpc/test-gettimebase.c
> new file mode 100644
> index 0000000..cb18aab
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/powerpc/test-gettimebase.c
> @@ -0,0 +1,35 @@
> +/* Copyright (C) 2012 Free Software Foundation, Inc.
> + Â This file is part of the GNU C Library.
> + Â Contributed by Tulio Magno Quites Machado <tuliom@linux.vnet.ibm.com>, 2012.
> +
> + Â The GNU C Library is free software; you can redistribute it and/or
> + Â modify it under the terms of the GNU Lesser General Public
> + Â License as published by the Free Software Foundation; either
> + Â version 2.1 of the License, or (at your option) any later version.
> +
> + Â The GNU C Library is distributed in the hope that it will be useful,
> + Â but WITHOUT ANY WARRANTY; without even the implied warranty of
> + Â MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ÂSee the GNU
> + Â Lesser General Public License for more details.
> +
> + Â You should have received a copy of the GNU Lesser General Public
> + Â License along with the GNU C Library; if not, write to the Free
> + Â Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
> + Â 02111-1307 USA. Â*/
> +
> +/* Test if __PPC_GETTIMEBASE() is compatible with the current processor */
> +
> +#include <stdio.h>
> +
> +#include <sys/user.h>
> +
> +static int
> +do_test(void)
> +{
> + Â__ppc_timebase tb = __PPC_GETTIMEBASE();
> + Âprintf("Time Base = %llx\n", tb);
> + Âreturn 0;
> +}
> +
> +#define TEST_FUNCTION do_test ()
> +#include "../test-skeleton.c"
Given a closer look:
You need a space between __PPC_GETTIMEBASE and the parenthesis.
Likewise, you need a space between printf and the parenthesis.
Ryan