This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH 3/3] Add cache info for powerpc64
- From: Richard Henderson <rth at twiddle dot net>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Cc: Benjamin Herrenschmidt <benh at kernel dot crashing dot org>, Steven Munroe <sjmunroe at us dot ibm dot com>
- Date: Fri, 9 Jun 2017 13:07:15 -0700
- Subject: Re: [PATCH 3/3] Add cache info for powerpc64
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
On 06/09/2017 06:12 AM, Tulio Magno Quites Machado Filho wrote:
Richard Henderson <email@example.com> writes:
The actual cache info was added for 4.11, but have a guess at the
L1 linesizes using info provided by older kernels.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysconf.c: New file.
There is already a patch reviewed and approved here:
+auxv2sysconf (unsigned long type)
+ long rc;
+ rc = getauxval (type);
+ if (rc == 0)
+ __set_errno (EINVAL);
+ rc = -1;
+ return rc;
Setting EINVAL is wrong. That would imply that the _SC_* name supplied by the
caller is invalid somehow.
The return value should be 0 when the cache parameter is unknown, and -1 only
when it is known that the cache level does not exist.
You should be using __getauxval to match the hidden_proto...
But this patch is blocked because it depends on another patch that's waiting
... defined here. But this second patch does look right.