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)
commit73516a33588cde0bfa4742d857f8849da28bddd2
tree6a783656269a22d2ec1382ac0f98ead2158d5c53
parente4ae4b7d01699d0f3ea61bbef119f2d67e5455c0
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]