Commit ecdc898d authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

Use *_END instead of *_LIMIT for linker derived end addresses



The usage of _LIMIT seems odd here, so rename as follows:
  BL_CODE_LIMIT     --> BL_CODE_END
  BL_RO_DATA_LIMIT  --> BL_RO_DATA_END
  BL1_CODE_LIMIT    --> BL1_CODE_END
  BL1_RO_DATA_LIMIT --> BL1_RO_DATA_END

Basically, we want to use _LIMIT and _END properly as follows:
  *_SIZE + *_MAX_SIZE = *_LIMIT
  *_SIZE + *_SIZE     = *_END

The _LIMIT is generally defined by platform_def.h to indicate the
platform-dependent memory constraint.  So, its typical usage is
  ASSERT(. <= BL31_LIMIT, "BL31 image has exceeded its limit.")
in a linker script.

On the other hand, _END is used to indicate the end address of the
compiled image, i.e. we do not know it until the image is linked.

Here, all of these macros belong to the latter, so should be
suffixed with _END.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 44f1c0bd
......@@ -119,22 +119,22 @@
*/
#if SEPARATE_CODE_AND_RODATA
#define BL_CODE_BASE (unsigned long)(&__TEXT_START__)
#define BL_CODE_LIMIT (unsigned long)(&__TEXT_END__)
#define BL_CODE_END (unsigned long)(&__TEXT_END__)
#define BL_RO_DATA_BASE (unsigned long)(&__RODATA_START__)
#define BL_RO_DATA_LIMIT (unsigned long)(&__RODATA_END__)
#define BL_RO_DATA_END (unsigned long)(&__RODATA_END__)
#define BL1_CODE_LIMIT BL_CODE_LIMIT
#define BL1_CODE_END BL_CODE_END
#define BL1_RO_DATA_BASE (unsigned long)(&__RODATA_START__)
#define BL1_RO_DATA_LIMIT round_up(BL1_ROM_END, PAGE_SIZE)
#define BL1_RO_DATA_END round_up(BL1_ROM_END, PAGE_SIZE)
#else
#define BL_CODE_BASE (unsigned long)(&__RO_START__)
#define BL_CODE_LIMIT (unsigned long)(&__RO_END__)
#define BL_CODE_END (unsigned long)(&__RO_END__)
#define BL_RO_DATA_BASE 0
#define BL_RO_DATA_LIMIT 0
#define BL_RO_DATA_END 0
#define BL1_CODE_LIMIT round_up(BL1_ROM_END, PAGE_SIZE)
#define BL1_CODE_END round_up(BL1_ROM_END, PAGE_SIZE)
#define BL1_RO_DATA_BASE 0
#define BL1_RO_DATA_LIMIT 0
#define BL1_RO_DATA_END 0
#endif /* SEPARATE_CODE_AND_RODATA */
#endif /* __COMMON_DEF_H__ */
......@@ -124,9 +124,9 @@ void arm_bl1_plat_arch_setup(void)
arm_setup_page_tables(bl1_tzram_layout.total_base,
bl1_tzram_layout.total_size,
BL_CODE_BASE,
BL1_CODE_LIMIT,
BL1_CODE_END,
BL1_RO_DATA_BASE,
BL1_RO_DATA_LIMIT
BL1_RO_DATA_END
#if USE_COHERENT_MEM
, BL1_COHERENT_RAM_BASE,
BL1_COHERENT_RAM_LIMIT
......
......@@ -238,9 +238,9 @@ void arm_bl2_plat_arch_setup(void)
arm_setup_page_tables(bl2_tzram_layout.total_base,
bl2_tzram_layout.total_size,
BL_CODE_BASE,
BL_CODE_LIMIT,
BL_CODE_END,
BL_RO_DATA_BASE,
BL_RO_DATA_LIMIT
BL_RO_DATA_END
#if USE_COHERENT_MEM
, BL2_COHERENT_RAM_BASE,
BL2_COHERENT_RAM_LIMIT
......
......@@ -95,9 +95,9 @@ void arm_bl2u_plat_arch_setup(void)
arm_setup_page_tables(BL2U_BASE,
BL31_LIMIT,
BL_CODE_BASE,
BL_CODE_LIMIT,
BL_CODE_END,
BL_RO_DATA_BASE,
BL_RO_DATA_LIMIT
BL_RO_DATA_END
#if USE_COHERENT_MEM
,
BL2U_COHERENT_RAM_BASE,
......
......@@ -288,9 +288,9 @@ void arm_bl31_plat_arch_setup(void)
arm_setup_page_tables(BL31_BASE,
BL31_END - BL31_BASE,
BL_CODE_BASE,
BL_CODE_LIMIT,
BL_CODE_END,
BL_RO_DATA_BASE,
BL_RO_DATA_LIMIT
BL_RO_DATA_END
#if USE_COHERENT_MEM
, BL31_COHERENT_RAM_BASE,
BL31_COHERENT_RAM_LIMIT
......
......@@ -202,9 +202,9 @@ void sp_min_plat_arch_setup(void)
arm_setup_page_tables(BL32_BASE,
(BL32_END - BL32_BASE),
BL_CODE_BASE,
BL_CODE_LIMIT,
BL_CODE_END,
BL_RO_DATA_BASE,
BL_RO_DATA_LIMIT
BL_RO_DATA_END
#if USE_COHERENT_MEM
, BL32_COHERENT_RAM_BASE,
BL32_COHERENT_RAM_LIMIT
......
......@@ -91,9 +91,9 @@ void tsp_plat_arch_setup(void)
arm_setup_page_tables(BL32_BASE,
(BL32_END - BL32_BASE),
BL_CODE_BASE,
BL_CODE_LIMIT,
BL_CODE_END,
BL_RO_DATA_BASE,
BL_RO_DATA_LIMIT
BL_RO_DATA_END
#if USE_COHERENT_MEM
, BL32_COHERENT_RAM_BASE,
BL32_COHERENT_RAM_LIMIT
......
......@@ -160,9 +160,9 @@ void bl31_plat_arch_setup(void)
arm_setup_page_tables(BL31_BASE,
BL31_END - BL31_BASE,
BL_CODE_BASE,
BL_CODE_LIMIT,
BL_CODE_END,
BL_RO_DATA_BASE,
BL_RO_DATA_LIMIT,
BL_RO_DATA_END,
BL31_COHERENT_RAM_BASE,
BL31_COHERENT_RAM_LIMIT);
enable_mmu_el3(0);
......
......@@ -81,9 +81,9 @@ void tsp_plat_arch_setup(void)
arm_setup_page_tables(BL32_BASE,
BL32_END - BL32_BASE,
BL_CODE_BASE,
BL_CODE_LIMIT,
BL_CODE_END,
BL_RO_DATA_BASE,
BL_RO_DATA_LIMIT,
BL_RO_DATA_END,
BL32_COHERENT_RAM_BASE,
BL32_COHERENT_RAM_LIMIT
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment