diff mbox

[edk2,4/9] EmbeddedPkg/GdbDebugAgent: fix VOID* cast of incorrect size

Message ID 1477330907-13733-5-git-send-email-ard.biesheuvel@linaro.org
State Superseded
Headers show

Commit Message

Ard Biesheuvel Oct. 24, 2016, 5:41 p.m. UTC
The result of PcdGet64() can only be cast to VOID* on 64-bit platforms,
so add an intermediate UINTN cast to make this code build again on 32 bit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Laszlo Ersek Oct. 25, 2016, 12:16 p.m. UTC | #1
On 10/24/16 19:41, Ard Biesheuvel wrote:
> The result of PcdGet64() can only be cast to VOID* on 64-bit platforms,

> so add an intermediate UINTN cast to make this code build again on 32 bit.

> 

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c b/EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c

> index 8226c80ab466..a43ff95d03a3 100644

> --- a/EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c

> +++ b/EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c

> @@ -657,7 +657,7 @@ InitializeDebugAgent (

>    *(UINTN *) (((UINT8 *)VectorBase) + Offset) = (UINTN)AsmCommonExceptionEntry;

>  

>    // Flush Caches since we updated executable stuff

> -  InvalidateInstructionCacheRange ((VOID *)PcdGet64(PcdCpuVectorBaseAddress), Length);

> +  InvalidateInstructionCacheRange ((VOID *)(UINTN)PcdGet64(PcdCpuVectorBaseAddress), Length);

>  

>    // setup a timer so gdb can break in via ctrl-c

>    DebugAgentTimerIntialize ();

> 


Reviewed-by: Laszlo Ersek <lersek@redhat.com>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c b/EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c
index 8226c80ab466..a43ff95d03a3 100644
--- a/EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c
+++ b/EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c
@@ -657,7 +657,7 @@  InitializeDebugAgent (
   *(UINTN *) (((UINT8 *)VectorBase) + Offset) = (UINTN)AsmCommonExceptionEntry;
 
   // Flush Caches since we updated executable stuff
-  InvalidateInstructionCacheRange ((VOID *)PcdGet64(PcdCpuVectorBaseAddress), Length);
+  InvalidateInstructionCacheRange ((VOID *)(UINTN)PcdGet64(PcdCpuVectorBaseAddress), Length);
 
   // setup a timer so gdb can break in via ctrl-c
   DebugAgentTimerIntialize ();