summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrasad Kummari <prasad.kummari@amd.com>2023-10-30 14:12:14 +0530
committerPrasad Kummari <prasad.kummari@amd.com>2023-10-30 16:24:03 +0530
commitbfe82cff6f6ab8e557e7ad7db8eae573f1fb02f3 (patch)
tree9f4354c91a386d02a757eff7f0c6366e19a5977a
parent58f00553d6dd53d727341747eb55387f43c04a13 (diff)
fix(versal): type cast addresses to fix integer overflow
Typecast the base and size arguments for build time as unsigned integers and the limit derived from these two as an unsigned long to prevent size integer overflow issues during the build. Signed-off-by: Prasad Kummari <prasad.kummari@amd.com> Change-Id: Iefc148e0091e8c8a4ca505691036c79528a558a4
-rw-r--r--plat/xilinx/versal/include/platform_def.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/plat/xilinx/versal/include/platform_def.h b/plat/xilinx/versal/include/platform_def.h
index 4c02402f7..286a706c4 100644
--- a/plat/xilinx/versal/include/platform_def.h
+++ b/plat/xilinx/versal/include/platform_def.h
@@ -35,10 +35,10 @@
# define BL31_BASE U(0xfffe0000)
# define BL31_LIMIT U(0x100000000)
#else
-# define BL31_BASE (VERSAL_ATF_MEM_BASE)
-# define BL31_LIMIT (VERSAL_ATF_MEM_BASE + VERSAL_ATF_MEM_SIZE)
+# define BL31_BASE U(VERSAL_ATF_MEM_BASE)
+# define BL31_LIMIT U(VERSAL_ATF_MEM_BASE + VERSAL_ATF_MEM_SIZE)
# ifdef VERSAL_ATF_MEM_PROGBITS_SIZE
-# define BL31_PROGBITS_LIMIT (VERSAL_ATF_MEM_BASE + VERSAL_ATF_MEM_PROGBITS_SIZE)
+# define BL31_PROGBITS_LIMIT U(VERSAL_ATF_MEM_BASE + VERSAL_ATF_MEM_PROGBITS_SIZE)
# endif
#endif
@@ -49,8 +49,8 @@
# define BL32_BASE U(0x60000000)
# define BL32_LIMIT U(0x80000000)
#else
-# define BL32_BASE (VERSAL_BL32_MEM_BASE)
-# define BL32_LIMIT (VERSAL_BL32_MEM_BASE + VERSAL_BL32_MEM_SIZE)
+# define BL32_BASE U(VERSAL_BL32_MEM_BASE)
+# define BL32_LIMIT U(VERSAL_BL32_MEM_BASE + VERSAL_BL32_MEM_SIZE)
#endif
/*******************************************************************************
@@ -59,7 +59,7 @@
#ifndef PRELOADED_BL33_BASE
# define PLAT_ARM_NS_IMAGE_BASE U(0x8000000)
#else
-# define PLAT_ARM_NS_IMAGE_BASE PRELOADED_BL33_BASE
+# define PLAT_ARM_NS_IMAGE_BASE U(PRELOADED_BL33_BASE)
#endif
/*******************************************************************************