summaryrefslogtreecommitdiff
path: root/lib/xlat_tables
diff options
context:
space:
mode:
authorJustin Chadwell <justin.chadwell@arm.com>2019-07-03 14:15:22 +0100
committerJustin Chadwell <justin.chadwell@arm.com>2019-07-12 09:12:19 +0100
commit3e43121ed16996758342aafdc42806ea2a0fe181 (patch)
treea8dcf10c220f1120542143c54abd4d8eb5e2da94 /lib/xlat_tables
parentd3b6df7c3b0db0c5791dd92b66f195a601d69559 (diff)
Update base code to not rely on undefined overflow behaviour
This consists of ensuring that the left operand of each shift is unsigned when the operation might overflow into the sign bit. Change-Id: Iddd6f38139a4c6e500468b4fc48d04e0939f574e Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
Diffstat (limited to 'lib/xlat_tables')
-rw-r--r--lib/xlat_tables/aarch32/nonlpae_tables.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/xlat_tables/aarch32/nonlpae_tables.c b/lib/xlat_tables/aarch32/nonlpae_tables.c
index eca3be3f..e31f9d84 100644
--- a/lib/xlat_tables/aarch32/nonlpae_tables.c
+++ b/lib/xlat_tables/aarch32/nonlpae_tables.c
@@ -122,8 +122,8 @@ CASSERT(PLAT_PHY_ADDR_SPACE_SIZE == (1ULL << 32), invalid_paddr_space_size);
#define DACR_DOMAIN_PERM_CLIENT 0x1
#define DACR_DOMAIN_PERM_MANAGER 0x3
-#define NUM_1MB_IN_4GB (1 << 12)
-#define NUM_4K_IN_1MB (1 << 8)
+#define NUM_1MB_IN_4GB (1U << 12)
+#define NUM_4K_IN_1MB (1U << 8)
#define ONE_MB_SHIFT 20