[klibc] [PATCH 3/3] arm64: Introduce arm64 support

Steve Capper steve.capper at linaro.org
Mon Nov 11 06:50:32 PST 2013


On Fri, Nov 08, 2013 at 09:24:06AM -0800, H. Peter Anvin wrote:
> On 11/08/2013 09:12 AM, Steve Capper wrote:
> > +
> > +/*
> > + * x19-x28 are callee saved, also save fp, lr, sp.
> > + * d8-d15 are also callee saved.
> > + */
> > +
> > +struct __jmp_buf {
> > +	uint64_t __gregs[13];
> > +	uint64_t __fpregs[8];
> > +};
> > +
> 
> Since the index of these arrays have no connection with what is stored
> in them, they should be named fields in the structure, not an array.
> 
> Do we need the fpregs saved even though klibc doesn't do fp?
> 

I agree about the named struct, it looks a lot nicer, thanks.

For gcc targetting Aarch64, We can only guarantee that d8-d15 are
left alone when -mgeneral-regs-only is supplied for building klibc
and any software linked against klibc. I would much prefer to
save/restore d8-d15 to avoid potential future headaches.

> > diff --git a/usr/klibc/arch/arm64/pipe.c b/usr/klibc/arch/arm64/pipe.c
> > new file mode 100644
> > index 0000000..f10a69e
> > --- /dev/null
> > +++ b/usr/klibc/arch/arm64/pipe.c
> > @@ -0,0 +1,10 @@
> > +#include <unistd.h>
> > +
> > +#ifndef __NR_pipe
> > +
> > +int pipe(int pipefd[2])
> > +{
> > +	return pipe2(pipefd, 0);
> > +}
> > +
> > +#endif  /* __NR_pipe */
> 
> This is a generic routine, right?  It should be part of the generic
> ersatz functions, no?

Thanks, I've moved pipe to the generic set.

Cheers,
-- 
Steve


More information about the klibc mailing list