From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Fleming Subject: Re: [PATCH v4 2/4] efi: Allow bitness-agnostic protocol calls Date: Sat, 12 Nov 2016 09:02:55 +0000 Message-ID: <20161112090255.GH8845@codeblueprint.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Lukas Wunner Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andreas Noever , Peter Jones , Ard Biesheuvel List-Id: linux-efi@vger.kernel.org On Mon, 07 Nov, at 11:09:00AM, Lukas Wunner wrote: > We already have a macro to invoke boot services which on x86 adapts > automatically to the bitness of the EFI firmware: efi_call_early(). > > The macro allows sharing of functions across arches and bitness variants > as long as those functions only call boot services. However in practice > functions in the EFI stub contain a mix of boot services calls and > protocol calls. > > Add an efi_call_proto() macro for bitness-agnostic protocol calls to > allow sharing more code across arches as well as deduplicating 32 bit > and 64 bit code paths. > > On x86, implement it using a new efi_table_attr() macro for bitness- > agnostic table lookups. Refactor efi_call_early() to make use of the > same macro. (The resulting object code remains identical.) > > Cc: Matt Fleming > Cc: Ard Biesheuvel > Signed-off-by: Lukas Wunner > --- > arch/arm/include/asm/efi.h | 3 +++ > arch/arm64/include/asm/efi.h | 3 +++ > arch/x86/include/asm/efi.h | 16 +++++++++++----- > 3 files changed, 17 insertions(+), 5 deletions(-) Neat!