linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Alistair Francis <alistair.francis@wdc.com>,
	linux-riscv-bounces@lists.infradead.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] riscv/include/uapi: Define a custom __SIGINFO struct for RV32
Date: Tue, 9 Jul 2019 15:55:18 -0700	[thread overview]
Message-ID: <CAKmqyKMx8JqGw7uhUO5pDkgyRDCixv6TXPCZUSHrAu8efZNBRQ@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a36CXf+HGgL=nNYzc-1Qhh=tu6to0opwYjO4fO5KDxUDA@mail.gmail.com>

On Thu, Jul 4, 2019 at 1:34 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Thu, Jul 4, 2019 at 12:18 AM Alistair Francis <alistair23@gmail.com> wrote:
> > On Wed, Jul 3, 2019 at 12:47 PM Arnd Bergmann <arnd@arndb.de> wrote:
> > > On Wed, Jul 3, 2019 at 8:45 PM Alistair Francis <alistair23@gmail.com> wrote:
> > > > What I don't understand though is how that impacted this struct, it
> > > > doesn't use clock_t at all, everything in the struct is an int or
> > > > void*.
> > >
> > > si_utime/si_stime in siginfo are clock_t.
> >
> > But they are further down the struct. I just assumed that GCC would
> > align those as required, I guess it aligns the start of the struct to
> > match some 64-bit members which seems strange.
>
> These are the regular struct alignment rules. Essentially you would
> get something like
>
> struct s {
>     int a;
>     int b;
>     int c;
>     union {
>          int d;
>          long long e;
>    };
>    int f;
> };
>
> Since 'e' has 8 byte alignment, the same is true for the union,
> and putting the union in a struct also requires the same alignment
> for the struct itself, so now you get padding after 'c' and 'f'.

Now that I think about it more it does make sense. Thanks for the help
with this and all the glibc stuff.

I have a new patch set that seems to work on RV32 and RV64. I'm now
hitting issues with syscalls that glibc doesn't use but other projects
do like io_getevents in OpenSSL.

Alistair

>
>        Arnd

      reply	other threads:[~2019-07-09 22:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03  0:18 [PATCH 0/2] RISC-V: Handle the siginfo_t offset problem Alistair Francis
2019-07-03  0:18 ` [PATCH 1/2] uapi/asm-generic: Allow defining a custom __SIGINFO struct Alistair Francis
2019-07-03  8:31   ` Arnd Bergmann
2019-07-03  0:18 ` [PATCH 2/2] riscv/include/uapi: Define a custom __SIGINFO struct for RV32 Alistair Francis
2019-07-03  8:40   ` Arnd Bergmann
2019-07-03 18:42     ` Alistair Francis
2019-07-03 19:47       ` Arnd Bergmann
2019-07-03 22:15         ` Alistair Francis
2019-07-04  8:34           ` Arnd Bergmann
2019-07-09 22:55             ` Alistair Francis [this message]

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=CAKmqyKMx8JqGw7uhUO5pDkgyRDCixv6TXPCZUSHrAu8efZNBRQ@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv-bounces@lists.infradead.org \
    /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 NNTP newsgroup(s).