diff options
| author | Bryan O'Donoghue <[email protected]> | 2018-03-13 16:50:31 +0000 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2018-03-19 16:14:24 -0400 |
| commit | f79443684b60beb7cb281fc0becb6b69aa0a1a4a (patch) | |
| tree | b850cf38c779756954571eaf0df57b23956f1eba /include | |
| parent | f25006b96e9f6b9b8688ec8e4bc8a87dc1f1479d (diff) | |
optee: Add optee_image_get_entry_point()
Add a helper function for extracting the least significant 32 bits from the
OPTEE entry point address, which will be good enough to load OPTEE binaries
up to (2^32)-1 bytes.
We may need to extend this out later on but for now (2^32)-1 should be
fine.
Signed-off-by: Bryan O'Donoghue <[email protected]>
Cc: Harinarayan Bhatta <[email protected]>
Cc: Andrew F. Davis <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Kever Yang <[email protected]>
Cc: Philipp Tomsich <[email protected]>
Cc: Peng Fan <[email protected]>
Tested-by: Peng Fan <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/tee/optee.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/tee/optee.h b/include/tee/optee.h index 8943afb4390..eb328d3cc65 100644 --- a/include/tee/optee.h +++ b/include/tee/optee.h @@ -29,6 +29,13 @@ struct optee_header { uint32_t paged_size; }; +static inline uint32_t optee_image_get_entry_point(const image_header_t *hdr) +{ + struct optee_header *optee_hdr = (struct optee_header *)(hdr + 1); + + return optee_hdr->init_load_addr_lo; +} + #if defined(CONFIG_OPTEE) int optee_verify_image(struct optee_header *hdr, unsigned long tzdram_start, unsigned long tzdram_len, unsigned long image_len); |
