diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-02-28 16:37:22 +0000 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-02-28 16:37:22 +0000 |
commit | 458dc17aa5485e90ede863a753c0bef2edb5dba7 (patch) | |
tree | b98f60fd264d2bd7f7081eb5ed3fc79f22d8c511 | |
parent | 7c7d1a486005c3742d4da1a65ab1f0c153906cb2 (diff) |
Replace magic numbers in linkerscripts by PAGE_SIZE
This way it is easier to understand the code and it is still valid even
if the page size changes.
Change-Id: I731ad0aa99a012eae4990ea95f507661a35ab818
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
-rw-r--r-- | framework/tftf.ld.S | 7 | ||||
-rw-r--r-- | fwu/ns_bl1u/ns_bl1u.ld.S | 7 | ||||
-rw-r--r-- | fwu/ns_bl2u/ns_bl2u.ld.S | 7 |
3 files changed, 12 insertions, 9 deletions
diff --git a/framework/tftf.ld.S b/framework/tftf.ld.S index 50d98aa..cf97e83 100644 --- a/framework/tftf.ld.S +++ b/framework/tftf.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,6 +29,7 @@ */ #include <platform_def.h> +#include <xlat_tables.h> OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_ARCH(PLATFORM_LINKER_ARCH) @@ -97,7 +98,7 @@ SECTIONS * are not mixed with normal data. This is required to set up the correct * memory attributes for the coherent data page tables. */ - coherent_ram (NOLOAD) : ALIGN(4096) { + coherent_ram (NOLOAD) : ALIGN(PAGE_SIZE) { __COHERENT_RAM_START__ = .; *(tftf_coherent_stacks) *(tftf_coherent_mem) @@ -107,7 +108,7 @@ SECTIONS * as device memory. No other unexpected data must creep in. * Ensure the rest of the current memory page is unused. */ - . = NEXT(4096); + . = NEXT(PAGE_SIZE); __COHERENT_RAM_END__ = .; } >RAM diff --git a/fwu/ns_bl1u/ns_bl1u.ld.S b/fwu/ns_bl1u/ns_bl1u.ld.S index 4f53eb4..b464fe9 100644 --- a/fwu/ns_bl1u/ns_bl1u.ld.S +++ b/fwu/ns_bl1u/ns_bl1u.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,6 +29,7 @@ */ #include <platform_def.h> +#include <xlat_tables.h> OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_ARCH(PLATFORM_LINKER_ARCH) @@ -42,7 +43,7 @@ MEMORY { SECTIONS { . = NS_BL1U_RO_BASE; - ASSERT(. == ALIGN(4096), + ASSERT(. == ALIGN(PAGE_SIZE), "NS_BL1U_RO_BASE address is not aligned on a page boundary.") ro . : { @@ -59,7 +60,7 @@ SECTIONS * Its VMA must be page-aligned as it marks the first read/write page. */ . = NS_BL1U_RW_BASE; - ASSERT(. == ALIGN(4096), + ASSERT(. == ALIGN(PAGE_SIZE), "NS_BL1U_RW_BASE address is not aligned on a page boundary.") .data . : ALIGN(16) { __DATA_RAM_START__ = .; diff --git a/fwu/ns_bl2u/ns_bl2u.ld.S b/fwu/ns_bl2u/ns_bl2u.ld.S index a45c418..cd6d0cb 100644 --- a/fwu/ns_bl2u/ns_bl2u.ld.S +++ b/fwu/ns_bl2u/ns_bl2u.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,6 +29,7 @@ */ #include <platform_def.h> +#include <xlat_tables.h> OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_ARCH(PLATFORM_LINKER_ARCH) @@ -41,7 +42,7 @@ MEMORY { SECTIONS { . = NS_BL2U_BASE; - ASSERT(. == ALIGN(4096), + ASSERT(. == ALIGN(PAGE_SIZE), "NS_BL2U_BASE address is not aligned on a page boundary.") ro . : { @@ -56,7 +57,7 @@ SECTIONS * read-only, executable. No RW data from the next section must * creep in. Ensure the rest of the current memory page is unused. */ - . = NEXT(4096); /* Aligned to the size of a 4KB */ + . = NEXT(PAGE_SIZE); /* Aligned to the size of a page */ __RO_END__ = .; } >RAM __RO_SIZE__ = __RO_END__ - __RO_START__; |