aboutsummaryrefslogtreecommitdiff
path: root/lib/xlat_tables_v2
diff options
context:
space:
mode:
authorDaniel Boulby <daniel.boulby@arm.com>2018-08-28 17:44:48 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-03 11:47:30 +0100
commit79621f0038b789de23ecc8891024f7cf6aa65999 (patch)
tree055170085d77aa0149974d3df8f69c0ee63008d1 /lib/xlat_tables_v2
parenta4277cda5c7f57a7205f4c29edbb488d518c29b5 (diff)
downloadtrusted-firmware-a-79621f0038b789de23ecc8891024f7cf6aa65999.tar.gz
xlat: Change check in mmap_add and mmap_add_ctx()
Depending on the build flags it is possible that some of the memory regions mapped in page table setup could have a size of 0. In this case we simply want to do nothing but still wish to map the other regions in the array. Therefore we cannot only use size == 0 as the termination logic for the loop. Since an attributes field with value 0 means that the region is device memory, read only, secure and executable. Device memory can't be executable, so this combination should never be used and it is safe to use as a terminator value. Therefore by changing the termination logic to use attributes instead of size we prevent terminating the loop when we don't intend to. Change-Id: I92fc7f689ab08543497be6be4896dace2ed7b66a Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Diffstat (limited to 'lib/xlat_tables_v2')
-rw-r--r--lib/xlat_tables_v2/xlat_tables_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/xlat_tables_v2/xlat_tables_core.c b/lib/xlat_tables_v2/xlat_tables_core.c
index 003718e760..d9837ff82e 100644
--- a/lib/xlat_tables_v2/xlat_tables_core.c
+++ b/lib/xlat_tables_v2/xlat_tables_core.c
@@ -815,7 +815,7 @@ void mmap_add_ctx(xlat_ctx_t *ctx, const mmap_region_t *mm)
{
const mmap_region_t *mm_cursor = mm;
- while (mm_cursor->size != 0U) {
+ while (mm_cursor->attr != 0U) {
mmap_add_region_ctx(ctx, mm_cursor);
mm_cursor++;
}