From patchwork Mon May 11 07:35:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 48225 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DC2D82121F for ; Mon, 11 May 2015 07:36:27 +0000 (UTC) Received: by lbbrr5 with SMTP id rr5sf36367607lbb.3 for ; Mon, 11 May 2015 00:36:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:reply-to:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=HR+X9Th7M1IcPwduKb/sGMLcaOgQN1Llpt4O5rtYEHc=; b=WidW9C8ud91VCNDlsncyYvMGCJvMIWACMo3czxtSlqoBpyOeQKgk6h7SsMNHVNvJYe BWCTgdrkgvctdnjNjbf3WxRd8UwHueNokpI9YRa1c1t0s4zCr/O7WoZm9KdTxyDMIVE3 WsjthOxVEOFCF/eskXVdMxz57IUfzdv6OzpTk6pC471RCXmxX3EaKwwJ9SLok4n1GW2H jKuSP+juXAyfy6PTTYtTQXLcn0k730/Qa1YRKo3SGeXxcK0jeaw+YUGRQtuZ81FnRUWu mVZ+im+L1alJnjuAzCnJGYnYKriq/FZqWpX6VPM4D24GphrVLPpWMtvU3H4XcPTmqlwP G6Xw== X-Gm-Message-State: ALoCoQkXTzYj5VF86pYwbWvqLpG0lwOscwT6j+3PjYePWwjI9s06F+H2dEyuQQsE8GFwXriugpCl X-Received: by 10.112.26.5 with SMTP id h5mr6734855lbg.4.1431329786777; Mon, 11 May 2015 00:36:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.180.202 with SMTP id dq10ls605524lac.109.gmail; Mon, 11 May 2015 00:36:26 -0700 (PDT) X-Received: by 10.112.42.233 with SMTP id r9mr7281719lbl.58.1431329786628; Mon, 11 May 2015 00:36:26 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id jq16si7902217lab.7.2015.05.11.00.36.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 00:36:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbzk7 with SMTP id zk7so87896430lbb.0 for ; Mon, 11 May 2015 00:36:26 -0700 (PDT) X-Received: by 10.112.182.4 with SMTP id ea4mr7233686lbc.35.1431329786522; Mon, 11 May 2015 00:36:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1353000lbb; Mon, 11 May 2015 00:36:25 -0700 (PDT) X-Received: by 10.42.76.146 with SMTP id e18mr9755277ick.42.1431329784987; Mon, 11 May 2015 00:36:24 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id j25si8947785ioo.37.2015.05.11.00.36.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 00:36:24 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YriG5-0000dC-RC; Mon, 11 May 2015 07:36:13 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YriG4-0000d4-KJ for edk2-devel@lists.sourceforge.net; Mon, 11 May 2015 07:36:12 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.212.171 as permitted sender) client-ip=209.85.212.171; envelope-from=ard.biesheuvel@linaro.org; helo=mail-wi0-f171.google.com; Received: from mail-wi0-f171.google.com ([209.85.212.171]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YriG3-0004hl-Lw for edk2-devel@lists.sourceforge.net; Mon, 11 May 2015 07:36:12 +0000 Received: by widdi4 with SMTP id di4so94094845wid.0 for ; Mon, 11 May 2015 00:36:05 -0700 (PDT) X-Received: by 10.194.48.101 with SMTP id k5mr17450216wjn.79.1431329765638; Mon, 11 May 2015 00:36:05 -0700 (PDT) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id d14sm21392551wjn.30.2015.05.11.00.36.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 00:36:04 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, olivier.martin@arm.com Date: Mon, 11 May 2015 09:35:58 +0200 Message-Id: <1431329758-17507-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record 0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1YriG3-0004hl-Lw Subject: [edk2] [PATCH] ArmPkg: update BdsLib to updated definition of EFI_LOAD_OPTION X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Since there is now a formal definition of EFI_LOAD_OPTION, we can no longer typedef it as a UINT8*. So update the code to use the common definition, which is not a pointer type, hence the additional changes to the C code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- Hello Olivier, This fixes the currently broken build for me. Regards, Ard. ArmPkg/Include/Library/BdsLib.h | 4 +--- ArmPkg/Library/BdsLib/BdsLoadOption.c | 8 ++++---- ArmPlatformPkg/Bds/BootOption.c | 6 +++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ArmPkg/Include/Library/BdsLib.h b/ArmPkg/Include/Library/BdsLib.h index eb7f8f293fb1..c6416db8ae79 100644 --- a/ArmPkg/Include/Library/BdsLib.h +++ b/ArmPkg/Include/Library/BdsLib.h @@ -15,14 +15,12 @@ #ifndef __BDS_ENTRY_H__ #define __BDS_ENTRY_H__ -typedef UINT8* EFI_LOAD_OPTION; - /** This is defined by the UEFI specs, don't change it **/ typedef struct { UINT16 LoadOptionIndex; - EFI_LOAD_OPTION LoadOption; + EFI_LOAD_OPTION *LoadOption; UINTN LoadOptionSize; UINT32 Attributes; diff --git a/ArmPkg/Library/BdsLib/BdsLoadOption.c b/ArmPkg/Library/BdsLib/BdsLoadOption.c index be5ed41980a3..a87e7a0ff62c 100644 --- a/ArmPkg/Library/BdsLib/BdsLoadOption.c +++ b/ArmPkg/Library/BdsLib/BdsLoadOption.c @@ -16,7 +16,7 @@ EFI_STATUS BootOptionParseLoadOption ( - IN EFI_LOAD_OPTION EfiLoadOption, + IN EFI_LOAD_OPTION *EfiLoadOption, IN UINTN EfiLoadOptionSize, IN OUT BDS_LOAD_OPTION **BdsLoadOption ) @@ -73,7 +73,7 @@ BootOptionFromLoadOptionVariable ( ) { EFI_STATUS Status; - EFI_LOAD_OPTION EfiLoadOption; + EFI_LOAD_OPTION *EfiLoadOption; UINTN EfiLoadOptionSize; Status = GetGlobalEnvironmentVariable (BootVariableName, NULL, &EfiLoadOptionSize, (VOID**)&EfiLoadOption); @@ -141,12 +141,12 @@ BootOptionToLoadOptionVariable ( // Allocate the memory for the EFI Load Option BdsLoadOption->LoadOptionSize = sizeof(UINT32) + sizeof(UINT16) + DescriptionSize + BdsLoadOption->FilePathListLength + BdsLoadOption->OptionalDataSize; - BdsLoadOption->LoadOption = (EFI_LOAD_OPTION)AllocateZeroPool (BdsLoadOption->LoadOptionSize); + BdsLoadOption->LoadOption = (EFI_LOAD_OPTION *)AllocateZeroPool (BdsLoadOption->LoadOptionSize); if (BdsLoadOption->LoadOption == NULL) { return EFI_OUT_OF_RESOURCES; } - EfiLoadOptionPtr = BdsLoadOption->LoadOption; + EfiLoadOptionPtr = (UINT8 *) BdsLoadOption->LoadOption; // // Populate the EFI Load Option and BDS Boot Option structures diff --git a/ArmPlatformPkg/Bds/BootOption.c b/ArmPlatformPkg/Bds/BootOption.c index 889040e3b63a..bb218f82aaf4 100644 --- a/ArmPlatformPkg/Bds/BootOption.c +++ b/ArmPlatformPkg/Bds/BootOption.c @@ -141,7 +141,7 @@ BootOptionSetFields ( IN UINTN OptionalDataSize ) { - EFI_LOAD_OPTION EfiLoadOption; + EFI_LOAD_OPTION *EfiLoadOption; UINTN EfiLoadOptionSize; UINTN BootDescriptionSize; UINT16 FilePathListLength; @@ -168,8 +168,8 @@ BootOptionSetFields ( // Allocate the memory for the EFI Load Option EfiLoadOptionSize = sizeof(UINT32) + sizeof(UINT16) + BootDescriptionSize + FilePathListLength + OptionalDataSize; - EfiLoadOption = (EFI_LOAD_OPTION)AllocatePool(EfiLoadOptionSize); - EfiLoadOptionPtr = EfiLoadOption; + EfiLoadOption = (EFI_LOAD_OPTION *)AllocatePool(EfiLoadOptionSize); + EfiLoadOptionPtr = (UINT8 *)EfiLoadOption; // // Populate the EFI Load Option and BDS Boot Option structures