ArmPkg/OpteeLib: Fix compilation issues for ARM (32-bit)

Correct usage of EFI_PHYSICAL_ADDRESS (always 64-bit) vs. pointers
(depending on architecture).

Reported-by: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
Sumit Garg 2018-11-02 12:23:14 +05:30 committed by Ard Biesheuvel
parent 6cf3aeaeb1
commit e40f8efb8b
1 changed files with 7 additions and 7 deletions

View File

@ -134,7 +134,7 @@ OpteeInit (
STATIC STATIC
UINT32 UINT32
OpteeCallWithArg ( OpteeCallWithArg (
IN EFI_PHYSICAL_ADDRESS PhysicalArg IN UINT64 PhysicalArg
) )
{ {
ARM_SMC_ARGS ArmSmcArgs; ARM_SMC_ARGS ArmSmcArgs;
@ -213,7 +213,7 @@ OpteeOpenSession (
MessageArg->NumParams = 2; MessageArg->NumParams = 2;
if (OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg)) { if (OpteeCallWithArg ((UINTN)MessageArg)) {
MessageArg->Return = OPTEE_ERROR_COMMUNICATION; MessageArg->Return = OPTEE_ERROR_COMMUNICATION;
MessageArg->ReturnOrigin = OPTEE_ORIGIN_COMMUNICATION; MessageArg->ReturnOrigin = OPTEE_ORIGIN_COMMUNICATION;
} }
@ -246,7 +246,7 @@ OpteeCloseSession (
MessageArg->Command = OPTEE_MESSAGE_COMMAND_CLOSE_SESSION; MessageArg->Command = OPTEE_MESSAGE_COMMAND_CLOSE_SESSION;
MessageArg->Session = Session; MessageArg->Session = Session;
OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg); OpteeCallWithArg ((UINTN)MessageArg);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -304,7 +304,7 @@ OpteeToMessageParam (
CopyMem ( CopyMem (
(VOID *)ParamSharedMemoryAddress, (VOID *)ParamSharedMemoryAddress,
(VOID *)InParam->Union.Memory.BufferAddress, (VOID *)(UINTN)InParam->Union.Memory.BufferAddress,
InParam->Union.Memory.Size InParam->Union.Memory.Size
); );
MessageParam->Union.Memory.BufferAddress = (UINT64)ParamSharedMemoryAddress; MessageParam->Union.Memory.BufferAddress = (UINT64)ParamSharedMemoryAddress;
@ -368,8 +368,8 @@ OpteeFromMessageParam (
} }
CopyMem ( CopyMem (
(VOID *)OutParam->Union.Memory.BufferAddress, (VOID *)(UINTN)OutParam->Union.Memory.BufferAddress,
(VOID *)MessageParam->Union.Memory.BufferAddress, (VOID *)(UINTN)MessageParam->Union.Memory.BufferAddress,
MessageParam->Union.Memory.Size MessageParam->Union.Memory.Size
); );
OutParam->Union.Memory.Size = MessageParam->Union.Memory.Size; OutParam->Union.Memory.Size = MessageParam->Union.Memory.Size;
@ -417,7 +417,7 @@ OpteeInvokeFunction (
MessageArg->NumParams = OPTEE_MAX_CALL_PARAMS; MessageArg->NumParams = OPTEE_MAX_CALL_PARAMS;
if (OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg)) { if (OpteeCallWithArg ((UINTN)MessageArg)) {
MessageArg->Return = OPTEE_ERROR_COMMUNICATION; MessageArg->Return = OPTEE_ERROR_COMMUNICATION;
MessageArg->ReturnOrigin = OPTEE_ORIGIN_COMMUNICATION; MessageArg->ReturnOrigin = OPTEE_ORIGIN_COMMUNICATION;
} }