From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AJdET5fSZmGenY6ZXaaA9KHJ721mbx+bn02qDjGMBGYXc7JJh+CcICeo+krIoHikdFCwrhD2Lf+ZrQ== 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: [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: , X-List-Received-Date: Fri, 02 Nov 2018 06:53:47 -0000 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(-) 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; } -- 2.7.4