From patchwork Fri Nov 2 06:53:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 150015 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1725418ljp; Thu, 1 Nov 2018 23:53:52 -0700 (PDT) X-Google-Smtp-Source: AJdET5cKVpWkQSxTNfaZXySYvDuxH6g+23Z87cHxpE9oJocaJMiENDOMFyldz+5/HSVkZK2+R8Z+ X-Received: by 2002:a17:902:7c94:: with SMTP id y20-v6mr10530251pll.218.1541141632561; Thu, 01 Nov 2018 23:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541141632; cv=none; d=google.com; s=arc-20160816; b=KpSP5w75ur9n+bucOENS7+jDDan8p1yScqIiWJDOm8FGbqzZlWpYhB3xW61ugxlNVA BnHs6RXvUNOfLQP4RrGixFleD+k7gB4wAye/Vo8d18E22D7tLUaOA6GjyYGcPZ580rtf Bk6+WEN/GHjeXXIMmRyFMyd8Ta550g2r7dYp8UayhIRTydnTTwcF5f9/xhieARaI+yhC RH199vzOu5hFkKsfoOOzv5CxBvkHtRn++lkxJcKfS6cBmhZeN1Q3XRvHfj3Qq2yPwvDC 1ylym3y18QvXHMA2gpfIORIiIEXgL3+FT6qWNksSwWIbVAZpQgcRqHLdLE4VaIz2qn66 nWPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=bKpZQlJG2zFQs8hqxhUvLFUOuQ3yli53HBA7ZBDj/pI=; b=KHjVqXPbmUxFvVwRs4IG1l/9k9hEswd8pnrsHiYJNzRQ4IeBiR6vX5nZJUVtGjCyMn ddxchZ84BP4JpEFj63gr+1j579DCJ3MLEunXPMoiiHM5Tz4qQ36crNuqxWdtcgIOonf8 V0pr/TnQPBnSBx7I2kcrJWAz0QJ2km6JsY5Tx08WrE+Qr1zv0cS0mu/6U4yu+uZvRUbG dxJwb19kgJQ25e9n6eFio00UFo00ZXrEeJJ2k5vOJx/kkRHtHuV8DqmHwJJ3kt3nCDrZ OuVvd/i055gG8YOmtRmq5kIP9tWvEecWbwA//p/SIoWPQ3pOYO/ZPIMexqkoAzaf7iu5 xYnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MkEcfFXQ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id l8-v6si9148995pgi.263.2018.11.01.23.53.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 23:53:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MkEcfFXQ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BD6E32118A5A7; Thu, 1 Nov 2018 23:53:48 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=sumit.garg@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 15C732116822C for ; Thu, 1 Nov 2018 23:53:46 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id f78-v6so584556pfe.1 for ; Thu, 01 Nov 2018 23:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=deYGIjUF8yTTAmxR7NAK8Gjx/rrxvPXIIUuuB8OwbVs=; b=MkEcfFXQqo2h3dGX2XQOCXH4SKbDfMl8zQqPHijbc/I4aZ7lVcQzNowNM9uP1vfZuB W1YaRgQkyIqrMSdTSloSOcwvNN3ZvfNSSp99upkxPZOUc4EJELCD+Kp019udGcH60E+0 FIx3l9uHaefqh4N6UfZIberGbXgHUgi7mc2fA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=deYGIjUF8yTTAmxR7NAK8Gjx/rrxvPXIIUuuB8OwbVs=; b=FtQysAVzD8pEVTobPZWKUoRaAbH1Q0TrycNqTBR2EfjG4ACQWee7+YWxcKVob1Yi6o NpcRdphX4bpTGJCaaN4kK+epH+C9CFUMPnYDjuqfKnqSoj9ybNLQh6erbK4wKFW5NZdW rJN2BjRFJvp0vXPLIZ3I3wayk9KjvtMEiQTm8eemNgNoqU3H8V/8IYWN6cOYp0RfW7ct 693eGJcQ9MuGtqCVuK/IKGFT9EJYNYsi4nVTGHzNlidZD9DOdxebAA6TvlqS3naVY/VM MEigCQRUlIb1Npe8Q1lqcPzkouIHT+iAzU0UgKk+T4KFX0BaAOB6AZ5bJPtWPABP+tXA 1m1Q== X-Gm-Message-State: AGRZ1gI+ILgXC0PToy3JdUE+Cj67UZkdld5ivfJYpQ98LNeOCFhZ3Sfx DDHSC/+lOKMnDbxbKEZm1Q/nJX1d1TI= X-Received: by 2002:a62:5e02:: with SMTP id s2-v6mr11114107pfb.146.1541141625405; Thu, 01 Nov 2018 23:53:45 -0700 (PDT) Received: from localhost.localdomain ([117.252.71.138]) by smtp.gmail.com with ESMTPSA id p64-v6sm32192520pfi.22.2018.11.01.23.53.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Nov 2018 23:53:44 -0700 (PDT) From: Sumit Garg To: edk2-devel@lists.01.org Date: Fri, 2 Nov 2018 12:23:14 +0530 Message-Id: <1541141594-31500-1-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [PATCH v1 1/1] ArmPkg/OpteeLib: Fix compilation issues for ARM (32-bit) X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Correct usage of EFI_PHYSICAL_ADDRESS (always 64-bit) vs. pointers (depending on architecture). Reported-by: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sumit Garg --- ArmPkg/Library/OpteeLib/Optee.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Ard Biesheuvel diff --git a/ArmPkg/Library/OpteeLib/Optee.c b/ArmPkg/Library/OpteeLib/Optee.c index 8ac31cb28266..55dcc7853b59 100644 --- a/ArmPkg/Library/OpteeLib/Optee.c +++ b/ArmPkg/Library/OpteeLib/Optee.c @@ -134,7 +134,7 @@ OpteeInit ( STATIC UINT32 OpteeCallWithArg ( - IN EFI_PHYSICAL_ADDRESS PhysicalArg + IN UINT64 PhysicalArg ) { ARM_SMC_ARGS ArmSmcArgs; @@ -213,7 +213,7 @@ OpteeOpenSession ( MessageArg->NumParams = 2; - if (OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg)) { + if (OpteeCallWithArg ((UINTN)MessageArg)) { MessageArg->Return = OPTEE_ERROR_COMMUNICATION; MessageArg->ReturnOrigin = OPTEE_ORIGIN_COMMUNICATION; } @@ -246,7 +246,7 @@ OpteeCloseSession ( MessageArg->Command = OPTEE_MESSAGE_COMMAND_CLOSE_SESSION; MessageArg->Session = Session; - OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg); + OpteeCallWithArg ((UINTN)MessageArg); return EFI_SUCCESS; } @@ -304,7 +304,7 @@ OpteeToMessageParam ( CopyMem ( (VOID *)ParamSharedMemoryAddress, - (VOID *)InParam->Union.Memory.BufferAddress, + (VOID *)(UINTN)InParam->Union.Memory.BufferAddress, InParam->Union.Memory.Size ); MessageParam->Union.Memory.BufferAddress = (UINT64)ParamSharedMemoryAddress; @@ -368,8 +368,8 @@ OpteeFromMessageParam ( } CopyMem ( - (VOID *)OutParam->Union.Memory.BufferAddress, - (VOID *)MessageParam->Union.Memory.BufferAddress, + (VOID *)(UINTN)OutParam->Union.Memory.BufferAddress, + (VOID *)(UINTN)MessageParam->Union.Memory.BufferAddress, MessageParam->Union.Memory.Size ); OutParam->Union.Memory.Size = MessageParam->Union.Memory.Size; @@ -417,7 +417,7 @@ OpteeInvokeFunction ( MessageArg->NumParams = OPTEE_MAX_CALL_PARAMS; - if (OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg)) { + if (OpteeCallWithArg ((UINTN)MessageArg)) { MessageArg->Return = OPTEE_ERROR_COMMUNICATION; MessageArg->ReturnOrigin = OPTEE_ORIGIN_COMMUNICATION; }