]> git.baikalelectronics.ru Git - kernel.git/commit
remoteproc: Add elf helpers to access elf64 and elf32 fields
authorClement Leger <cleger@kalray.eu>
Mon, 2 Mar 2020 09:38:58 +0000 (10:38 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Thu, 26 Mar 2020 05:29:39 +0000 (22:29 -0700)
commit3744443f145c7ed7091851650a21eb5dd442ec56
tree6a783656269a22d2ec1382ac0f98ead2158d5c53
parent3851c152854f408e1078436e6fdb5b4a4fae16c4
remoteproc: Add elf helpers to access elf64 and elf32 fields

elf32 and elf64 mainly differ by their types. In order to avoid
copy/pasting the whole loader code, generate static inline functions
which will access values according to the elf class. It allows to
keep a common loader basis.
In order to accommodate both elf types sizes, the maximum size for a
elf header member is chosen using the maximum value of the field for
both elf class.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Clement Leger <cleger@kalray.eu>
Link: https://lore.kernel.org/r/20200302093902.27849-5-cleger@kalray.eu
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/remoteproc_elf_helpers.h [new file with mode: 0644]