[PATCH] powerpc: Add gpr1 and fpu save/restore functions

Timothy Pearson tpearson at raptorengineering.com
Tue Feb 13 04:09:38 AEDT 2024



----- Original Message -----
> From: "Segher Boessenkool" <segher at kernel.crashing.org>
> To: "Timothy Pearson" <tpearson at raptorengineering.com>
> Cc: "linuxppc-dev" <linuxppc-dev at lists.ozlabs.org>
> Sent: Monday, February 12, 2024 11:02:07 AM
> Subject: Re: [PATCH] powerpc: Add gpr1 and fpu save/restore functions

> On Mon, Feb 12, 2024 at 10:41:18AM -0600, Timothy Pearson wrote:
>> Implement gpr1 and fpu save/restore functions per the ABI v2 documentation.
> 
> There is no "ABI v2".  This is the ELFv2 ABI, it is a name, it is not a
> version 2 of anything (in fact, it is version 1 everywhere).

Apologies, I wasn't precise on the name.

> The same functions are needed and used in other ABIs, too.
> 
> But, why do this patch?  You just need
> 
> +LIBGCC         := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
> 
> +libs-y += $(LIBGCC)
> 
> and nothing more.  It is required for proper functioning of GCC to link
> with the libgcc support library.

There is existing code in the kernel right now to provide support functions for gpr0 and altivec save/restore.  I don't know the full story here, but at some point in the kernel's history it seems to have been decided to provide the helper functions in lieu of linking libgcc directly.  If this is incorrect, then I need to know that so I can rework the patch to enable libcc and remove the existing support functions.

Is there anyone on-list that knows more of the history and decision-making that went into the current state of the kernel here?

Thanks!


More information about the Linuxppc-dev mailing list