This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 1/6] sysv/linux: Rename alpha functions to be alpha specific
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.
That is why Adhemerval is saying we would need some preprocessor magic
to ensure that for Alpha we always convert to/from a 32-bit time_t on
a 64-bit arch.
> need to be different on Alpha than they are on the 32-bit
> architectures.
My understanding is that Alpha is a 64-bit architecture (correct me if
I'm wrong, that's just from Wikipedia). The generic patches convert
time_t to the architectures wordsize before passing it to the kernel
(either 32-bit or 64-bit) while Alpha is different here.
>
> Alpha is unusual in that certain legacy code paths need to call these
> conversion functions, but *what the functions do* should be identical
> to what they do on 32-bit architectures. There should be no need for
> preprocessor magic or anything.
Yes, they are the same as the 32-bit architectures, but not the 64-bit
architectures. Everything else in this patch is generic for both
32-bit and 64-bit (except for Alpha).
Alistair
>
> zw