From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Date: Tue, 12 Jun 2018 21:12:47 +0200 Subject: [U-Boot] [PATCH v2 03/13] x86: Change __kernel_size_t conditionals to use compiler provided defines In-Reply-To: <1528817785-20208-4-git-send-email-bmeng.cn@gmail.com> References: <1528817785-20208-1-git-send-email-bmeng.cn@gmail.com> <1528817785-20208-4-git-send-email-bmeng.cn@gmail.com> Message-ID: <47602b88-e49d-244e-9e43-0da2917cec72@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12.06.18 17:36, Bin Meng wrote: > Since commit bb0bb91cf0aa ("efi_stub: Use efi_uintn_t"), EFI x86 > 64-bit payload does not work anymore. The call to GetMemoryMap() > in efi_stub.c fails with return code EFI_INVALID_PARAMETER. Since > the payload itself is still 32-bit U-Boot, efi_uintn_t gets wrongly > interpreted as int, but it should actually be long in a 64-bit EFI > environment. > > This changes the x86 __kernel_size_t conditionals to use compiler > provided defines instead. That way we always adhere to the build > environment we're in and the definitions adjust automatically. > > Fixes: bb0bb91cf0aa ("efi_stub: Use efi_uintn_t") > Signed-off-by: Bin Meng Reviewed-by: Alexander Graf Alex > > --- > > Changes in v2: > - new patch to "change __kernel_size_t conditionals to use compiler > provided defines" > > arch/x86/include/asm/posix_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h > index 717f6cb..a19f1a0 100644 > --- a/arch/x86/include/asm/posix_types.h > +++ b/arch/x86/include/asm/posix_types.h > @@ -16,7 +16,7 @@ typedef int __kernel_pid_t; > typedef unsigned short __kernel_ipc_pid_t; > typedef unsigned short __kernel_uid_t; > typedef unsigned short __kernel_gid_t; > -#if CONFIG_IS_ENABLED(X86_64) > +#if defined __x86_64__ > typedef unsigned long __kernel_size_t; > typedef long __kernel_ssize_t; > #else >