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
diff --git a/plat/fvp/bl1_plat_setup.c b/plat/fvp/bl1_plat_setup.c
index 9d19bb8..8fe4c95 100644
--- a/plat/fvp/bl1_plat_setup.c
+++ b/plat/fvp/bl1_plat_setup.c
@@ -63,9 +63,9 @@
 /* Data structure which holds the extents of the trusted SRAM for BL1*/
 static meminfo bl1_tzram_layout;
 
-meminfo bl1_get_sec_mem_layout(void)
+meminfo *bl1_plat_sec_mem_layout(void)
 {
-	return bl1_tzram_layout;
+	return &bl1_tzram_layout;
 }
 
 /*******************************************************************************
diff --git a/plat/fvp/bl2_plat_setup.c b/plat/fvp/bl2_plat_setup.c
index 7212df1..978cc9b 100644
--- a/plat/fvp/bl2_plat_setup.c
+++ b/plat/fvp/bl2_plat_setup.c
@@ -72,9 +72,9 @@
 __attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE),
 		section("tzfw_coherent_mem")));
 
-meminfo bl2_get_sec_mem_layout(void)
+meminfo *bl2_plat_sec_mem_layout(void)
 {
-	return bl2_tzram_layout;
+	return &bl2_tzram_layout;
 }
 
 /*******************************************************************************
diff --git a/plat/fvp/bl31_plat_setup.c b/plat/fvp/bl31_plat_setup.c
index ab8e378..221b85a 100644
--- a/plat/fvp/bl31_plat_setup.c
+++ b/plat/fvp/bl31_plat_setup.c
@@ -85,9 +85,9 @@
 __attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE),
 		section("tzfw_coherent_mem")));
 
-meminfo bl31_get_sec_mem_layout(void)
+meminfo *bl31_plat_sec_mem_layout(void)
 {
-	return bl31_tzram_layout;
+	return &bl31_tzram_layout;
 }
 
 /*******************************************************************************