aboutsummaryrefslogtreecommitdiffstats
path: root/include/common/bl_common.h
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2014-06-24 14:02:34 +0100
committerSandrine Bailleux <sandrine.bailleux@arm.com>2014-07-01 10:59:43 +0100
commit8f55dfb4ba1a7c2cb5af355ff614923b6000864d (patch)
tree6b8f1b4958222304da14dffb482ae39e51d47c27 /include/common/bl_common.h
parent5e0f9bde13c4b10fd7545f47cb75046fcd94d16f (diff)
downloadplatform_external_arm-trusted-firmware-8f55dfb4ba1a7c2cb5af355ff614923b6000864d.tar.gz
platform_external_arm-trusted-firmware-8f55dfb4ba1a7c2cb5af355ff614923b6000864d.tar.bz2
platform_external_arm-trusted-firmware-8f55dfb4ba1a7c2cb5af355ff614923b6000864d.zip
Remove concept of top/bottom image loading
This concept is no longer required since we now support loading of images at fixed addresses only. The image loader now automatically detects the position of the image inside the current memory layout and updates the layout such that memory fragmentation is minimised. The 'attr' field of the meminfo data structure, which used to hold the bottom/top loading information, has been removed. Also the 'next' field has been removed as it wasn't used anywhere. The 'init_bl2_mem_layout()' function has been moved out of common code and put in BL1-specific code. It has also been renamed into 'bl1_init_bl2_mem_layout'. Fixes ARM-software/tf-issues#109 Change-Id: I3f54642ce7b763d5ee3b047ad0ab59eabbcf916d
Diffstat (limited to 'include/common/bl_common.h')
-rw-r--r--include/common/bl_common.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/include/common/bl_common.h b/include/common/bl_common.h
index f5e2a9a24..154c0f49d 100644
--- a/include/common/bl_common.h
+++ b/include/common/bl_common.h
@@ -38,15 +38,11 @@
#define DOWN 0
/*******************************************************************************
- * Constants for loading images. When BLx wants to load BLy, it looks at a
- * meminfo structure to find the extents of free memory. Then depending upon
- * how it has been configured, it can either load BLy at the top or bottom of
- * the free memory. These constants indicate the choice.
- * TODO: Make this configurable while building the trusted firmware.
- ******************************************************************************/
-#define TOP_LOAD 0x1
-#define BOT_LOAD !TOP_LOAD
-#define LOAD_MASK (1 << 0)
+ * Constants to identify the location of a memory region in a given memory
+ * layout.
+******************************************************************************/
+#define TOP 0x1
+#define BOTTOM !TOP
/******************************************************************************
* Opcode passed in x0 to tell next EL that we want to run an image.
@@ -97,18 +93,17 @@
#include <cdefs.h> /* For __dead2 */
#include <cassert.h>
#include <stdint.h>
+#include <stddef.h>
/*******************************************************************************
* Structure used for telling the next BL how much of a particular type of
* memory is available for its use and how much is already used.
******************************************************************************/
typedef struct meminfo {
- unsigned long total_base;
- long total_size;
- unsigned long free_base;
- long free_size;
- unsigned long attr;
- unsigned long next;
+ uint64_t total_base;
+ size_t total_size;
+ uint64_t free_base;
+ size_t free_size;
} meminfo_t;
typedef struct aapcs64_params {
@@ -209,14 +204,16 @@ CASSERT(sizeof(unsigned long) ==
unsigned long page_align(unsigned long, unsigned);
void change_security_state(unsigned int);
unsigned long image_size(const char *);
-int load_image(meminfo_t *,
- const char *,
- unsigned int,
- unsigned long,
- image_info_t *,
- entry_point_info_t *);
+int load_image(meminfo_t *mem_layout,
+ const char *image_name,
+ uint64_t image_base,
+ image_info_t *image_data,
+ entry_point_info_t *entry_point_info);
extern const char build_message[];
+void reserve_mem(uint64_t *free_base, size_t *free_size,
+ uint64_t addr, size_t size);
+
#endif /*__ASSEMBLY__*/
#endif /* __BL_COMMON_H__ */