summaryrefslogtreecommitdiff
path: root/include/remoteproc.h
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2019-09-04 16:01:28 +0530
committerTom Rini <trini@konsulko.com>2019-10-11 10:07:34 -0400
commit14d963d1b51fc7a57b8d561588f163d7cae8ed81 (patch)
treedefff9e9b73fe3343a136bb7d2e62b7e9738a5c6 /include/remoteproc.h
parentc08eb936263c67312cb55c354277f9dc3433b194 (diff)
remoteproc: elf_loader: Always check the validity of the image before loading
rproc_elf32_load_image() rely on user to send a valid address for elf loading. Instead do a sanity check on the address passed by user. This will help all rproc elf users to not call sanity_check explicitly before calling elf_loading. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>
Diffstat (limited to 'include/remoteproc.h')
-rw-r--r--include/remoteproc.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/remoteproc.h b/include/remoteproc.h
index dbff1ce3cf..1ef88be7f7 100644
--- a/include/remoteproc.h
+++ b/include/remoteproc.h
@@ -218,9 +218,10 @@ int rproc_elf32_sanity_check(ulong addr, ulong size);
* rproc_elf32_load_image() - load an ELF32 image
* @dev: device loading the ELF32 image
* @addr: valid ELF32 image address
+ * @size: size of the image
* @return 0 if the image is successfully loaded, else appropriate error value.
*/
-int rproc_elf32_load_image(struct udevice *dev, unsigned long addr);
+int rproc_elf32_load_image(struct udevice *dev, unsigned long addr, ulong size);
#else
static inline int rproc_init(void) { return -ENOSYS; }
static inline int rproc_dev_init(int id) { return -ENOSYS; }
@@ -234,7 +235,8 @@ static inline int rproc_is_running(int id) { return -ENOSYS; }
static inline int rproc_elf32_sanity_check(ulong addr,
ulong size) { return -ENOSYS; }
static inline int rproc_elf32_load_image(struct udevice *dev,
- unsigned long addr) { return -ENOSYS; }
+ unsigned long addr, ulong size)
+{ return -ENOSYS; }
#endif
#endif /* _RPROC_H_ */