public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Waterman <andrew@sifive.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Zong Li <zong.li@sifive.com>, Florian Weimer <fw@deneb.enyo.de>,
	libc-alpha@sourceware.org, Joseph Myers <joseph@codesourcery.com>
Subject: Re: [PATCH 1/1] riscv: Get cache information through sysconf
Date: Tue, 27 Oct 2020 01:32:29 -0700	[thread overview]
Message-ID: <CA++6G0DxaL38_B6Hdg2fekdPTZv-G-ZtQNkY+1MfFoWy0SGR4Q@mail.gmail.com> (raw)
In-Reply-To: <87lffscbrq.fsf@igel.home>

On Tue, Oct 27, 2020 at 1:29 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Okt 27 2020, Zong Li wrote:
>
> > diff --git a/sysdeps/unix/sysv/linux/riscv/sysconf.c
> > b/sysdeps/unix/sysv/linux/riscv/sysconf.c
> > index e73095528c..22ac4f8d19 100644
> > --- a/sysdeps/unix/sysv/linux/riscv/sysconf.c
> > +++ b/sysdeps/unix/sysv/linux/riscv/sysconf.c
> > @@ -24,19 +24,34 @@ static long int linux_sysconf (int name);
> >  static inline long int
> >  sysconf_get_cache_associativity (unsigned long type)
> >  {
> > -  return (__getauxval (type) & 0xffff0000) >> 16;
> > +  unsigned long int val = __getauxval (type);
> > +
> > +  if (errno == ENOENT)
> > +    return -1;
> > +  else
> > +    return (val & 0xffff0000) >> 16;
>
> You need to clear errno before calling __getauxval.

Err, what Andreas said.

>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."

  reply	other threads:[~2020-10-27  8:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26  7:24 Zong Li
2020-10-26  8:26 ` Florian Weimer
2020-10-27  6:05   ` Zong Li
2020-10-27  7:27     ` Florian Weimer
2020-10-27  7:46       ` Zong Li
2020-10-27  8:13         ` Andrew Waterman
2020-10-27  8:50           ` Zong Li
2020-10-27  9:44             ` Florian Weimer
2020-10-27 10:09               ` Zong Li
2020-10-27 10:15                 ` Florian Weimer
2020-10-29  3:36                   ` Zong Li
2020-10-29  8:52                     ` Florian Weimer
2020-10-29  9:56                       ` Andreas Schwab
2020-10-29 17:11                         ` Zong Li
2020-10-29 17:07                       ` Zong Li
2020-10-29  9:31                     ` Andreas Schwab
2020-10-29 17:08                       ` Zong Li
2020-10-27  8:29         ` Andreas Schwab
2020-10-27  8:32           ` Andrew Waterman [this message]
2020-10-27  8:52             ` Zong Li
2020-10-27  9:54               ` Zong Li
2020-11-06  4:57 ` Palmer Dabbelt
2020-11-10  6:25   ` Zong Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA++6G0DxaL38_B6Hdg2fekdPTZv-G-ZtQNkY+1MfFoWy0SGR4Q@mail.gmail.com \
    --to=andrew@sifive.com \
    --cc=fw@deneb.enyo.de \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@linux-m68k.org \
    --cc=zong.li@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).