aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanh-arm <dan.handley@arm.com>2014-06-16 11:58:21 +0100
committerdanh-arm <dan.handley@arm.com>2014-06-16 11:58:21 +0100
commit3934d1a6cca75237b97d21164c031701ea76a009 (patch)
treecf6dd7bc38369ec8009130a8d7a0c83eb5faa228
parent2966dc2cf5919310fa95c6c12d0d4a7cfab10fdc (diff)
parent63db7ba2931f477ae09811a650825b44a967ea73 (diff)
downloadarm-trusted-firmware-3934d1a6cca75237b97d21164c031701ea76a009.tar.gz
Merge pull request #128 from sandrine-bailleux/sb/make-load_image-ep-optional
Make the entry point argument optional in load_image()
-rw-r--r--common/bl_common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/bl_common.c b/common/bl_common.c
index 3bc314c..4affa76 100644
--- a/common/bl_common.c
+++ b/common/bl_common.c
@@ -175,7 +175,9 @@ unsigned long image_size(const char *image_name)
* given a name, extents of free memory & whether the image should be loaded at
* the bottom or top of the free memory. It updates the memory layout if the
* load is successful. It also updates the image information and the entry point
- * information in the params passed
+ * information in the params passed. The caller might pass a NULL pointer for
+ * the entry point if it is not interested in this information, e.g. because
+ * the image just needs to be loaded in memory but won't ever be executed.
******************************************************************************/
int load_image(meminfo_t *mem_layout,
const char *image_name,
@@ -399,7 +401,8 @@ int load_image(meminfo_t *mem_layout,
image_data->image_base = image_base;
image_data->image_size = image_size;
- entry_point_info->pc = image_base;
+ if (entry_point_info != NULL)
+ entry_point_info->pc = image_base;
/*
* File has been successfully loaded. Update the free memory