[PATCH v2 1/6] sysv/linux: Rename alpha functions to be alpha specific

Alistair Francis alistair23@gmail.com
Tue Feb 11 18:10:00 GMT 2020


On Tue, Feb 11, 2020 at 9:56 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Tue, Feb 11, 2020 at 8:23 AM Zack Weinberg <zackw@panix.com> wrote:
> >
> > On Tue, Feb 11, 2020 at 11:06 AM Alistair Francis <alistair23@gmail.com> wrote:
> > >
> > > On Tue, Feb 11, 2020 at 6:39 AM Zack Weinberg <zackw@panix.com> wrote:
> > > >
> > > > On Tue, Feb 11, 2020 at 8:25 AM Adhemerval Zanella
> > > > <adhemerval.zanella@linaro.org> wrote:
> > > > > On 10/02/2020 22:10, Zack Weinberg wrote:
> > > > > >
> > > > > > This doesn't address any of my concerns.  It should not be necessary
> > > > > > to duplicate an *internal header* full of functions whose operation
> > > > > > is, or ought to be, completely generic, just because the exposed API
> > > > > > is different on Alpha.
> > > > >
> > > > > The 32-bit timeval struct are alpha specific in a sense that no other
> > > > > 64-bit architectures have 32 time_t.
> > > > >
> > > > > We could certainly make it generic and add even more internally
> > > > > pre-processor magic to fit alpha code in generic definitions, but I
> > > > > think it is really a worthless complication.  It is a legacy API,
> > > > > and it is highly unlikely that any other port will use such code.
> > > >
> > > > I think we're talking past each other.  This patch is about
> > > > tv32-compat.h.  tv32-compat.h contains conversion functions between
> > > > e.g. struct timeval with 32-bit time_t and struct timeval with 64-bit
> > > > time_t.  I still don't see any reason why these conversion functions
> > >
> > > The generic patches added by this series convert between a 64-bit
> > > time_t and a wordsize time_t. Alpha is different in that it converts
> > > between a 64-bit time_t and a 32-bit time_t on a 64-bit arch.
> >
> > Yes, I understand that, but the definition of the 32-bit-time_t struct
> > timeval is
> >
> >   struct __timeval32 {
> >      __time32_t tv_sec;
> >      __suseconds_t tv_usec;
> >   };
>
> This is what the Alpha specific calls use.
>
> The generic one uses (the name is confusing, I thought I had changed it)
>
> struct __timeval32
> {
>   long tv_sec;         /* Seconds.  */
>   long tv_usec;        /* Microseconds.  */
> };

I have changed the name of this struct to __timeval_long, hopefully
that fixes some of the confusion. The name was left over from v1.

Alistair

>
> This is because, as I mentioned earlier, that the kernel expects the
> time to be the wordsize, regardless of the time_t size (except for
> Alpha).
>
> Using long types means that we can do the same thing for 32-bit and
> 64-bit architectures.
>
> My v1 patchset had a specific 32-bit only version (which didn't apply
> to 64-bit arches) but this didn't work with ARM, see the discussion
> here: https://patchwork.ozlabs.org/patch/1232973/
>
> Alistair
>
> >
> > either way, isn't it?  So the conversion functions shouldn't care?
> >
> > (If that's not what the definition of the 32-bit-time_t struct timeval
> > is, then I would like to know why, in *excruciating* detail.)
> >
> > zw



More information about the Libc-alpha mailing list