diff options
author | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2013-11-28 14:55:58 +0000 |
---|---|---|
committer | Dan Handley <dan.handley@arm.com> | 2013-12-12 16:06:48 +0000 |
commit | ee12f6f7497882fdcc8acc7774c516739296799e (patch) | |
tree | 249e6ef6b93045864d616ee8db1294563ebf783c /bl1/bl1_main.c | |
parent | dc98e5370ac81965ebcc322a279b8aad51258d9a (diff) |
Remove useless copies of meminfo structures
Platform setup code has to reserve some memory for storing the
memory layout information. It is populated in early platform setup
code.
blx_get_sec_mem_layout() functions used to return a copy of this
structure. This patch modifies blx_get_sec_mem_layout() functions
so that they now directly return a pointer to their memory layout
structure. It ensures that the memory layout returned by
blx_get_sec_mem_layout() is always up-to-date and also avoids a
useless copy of the meminfo structure.
Also rename blx_get_sec_mem_layout() to blx_plat_sec_mem_layout()
to make it clear those functions are platform specific.
Change-Id: Ic7a6f9d6b6236b14865ab48a9f5eff545ce56551
Diffstat (limited to 'bl1/bl1_main.c')
-rw-r--r-- | bl1/bl1_main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bl1/bl1_main.c b/bl1/bl1_main.c index ab9fa8ce..5dfb5644 100644 --- a/bl1/bl1_main.c +++ b/bl1/bl1_main.c @@ -50,7 +50,8 @@ void bl1_main(void) unsigned long sctlr_el3 = read_sctlr(); unsigned long bl2_base; unsigned int load_type = TOP_LOAD, spsr; - meminfo bl1_tzram_layout, *bl2_tzram_layout = 0x0; + meminfo *bl1_tzram_layout; + meminfo *bl2_tzram_layout = 0x0; /* * Ensure that MMU/Caches and coherency are turned on @@ -73,8 +74,8 @@ void bl1_main(void) * Find out how much free trusted ram remains after BL1 load * & load the BL2 image at its top */ - bl1_tzram_layout = bl1_get_sec_mem_layout(); - bl2_base = load_image(&bl1_tzram_layout, + bl1_tzram_layout = bl1_plat_sec_mem_layout(); + bl2_base = load_image(bl1_tzram_layout, (const char *) BL2_IMAGE_NAME, load_type, BL2_BASE); @@ -85,8 +86,8 @@ void bl1_main(void) * to BL2. BL2 will read the memory layout before using its * memory for other purposes. */ - bl2_tzram_layout = (meminfo *) bl1_tzram_layout.free_base; - init_bl2_mem_layout(&bl1_tzram_layout, + bl2_tzram_layout = (meminfo *) bl1_tzram_layout->free_base; + init_bl2_mem_layout(bl1_tzram_layout, bl2_tzram_layout, load_type, bl2_base); |