diff options
author | Peter Crosthwaite | 2016-03-04 12:30:21 +0100 |
---|---|---|
committer | Peter Maydell | 2016-03-04 12:30:21 +0100 |
commit | 7ef295ea5b412cbaf82f719ccd49efb51296e841 (patch) | |
tree | da99e5270fcf99285c0b5dfb787c4b304687843a /hw/tricore | |
parent | loader: load_elf(): Add doc comment (diff) | |
download | qemu-7ef295ea5b412cbaf82f719ccd49efb51296e841.tar.gz qemu-7ef295ea5b412cbaf82f719ccd49efb51296e841.tar.xz qemu-7ef295ea5b412cbaf82f719ccd49efb51296e841.zip |
loader: Add data swap option to load-elf
Some CPUs are of an opposite data-endianness to other components in the
system. Sometimes elfs have the data sections layed out with this CPU
data-endianness accounting for when loaded via the CPU, so byte swaps
(relative to other system components) will occur.
The leading example, is ARM's BE32 mode, which is is basically LE with
address manipulation on half-word and byte accesses to access the
hw/byte reversed address. This means that word data is invariant
across LE and BE32. This also means that instructions are still LE.
The expectation is that the elf will be loaded via the CPU in this
endianness scheme, which means the data in the elf is reversed at
compile time.
As QEMU loads via the system memory directly, rather than the CPU, we
need a mechanism to reverse elf data endianness to implement this
possibility.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/tricore')
-rw-r--r-- | hw/tricore/tricore_testboard.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c index 9392571f1f..3cadb6521c 100644 --- a/hw/tricore/tricore_testboard.c +++ b/hw/tricore/tricore_testboard.c @@ -45,7 +45,7 @@ static void tricore_load_kernel(CPUTriCoreState *env) kernel_size = load_elf(tricoretb_binfo.kernel_filename, NULL, NULL, (uint64_t *)&entry, NULL, NULL, 0, - EM_TRICORE, 1); + EM_TRICORE, 1, 0); if (kernel_size <= 0) { error_report("qemu: no kernel file '%s'", tricoretb_binfo.kernel_filename); |