diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2012-06-18 13:11:21 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2012-06-18 13:11:21 -0400 |
commit | 9e0304e388ef0e7495b279ce737c24ad56d20b5d (patch) | |
tree | 5f87d2506ff5a1abb823e003c078b5682c593a58 | |
parent | 485802a6c524e62b5924849dd727ddbb1497cc71 (diff) |
arch/tile: big-endian: properly bswap instruction bundles when backtracing
Instruction bundles are always little-endian, even when running in
big-endian mode. I missed this internal bug fix when cherry-picking
the big-endian code to return to the community.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
-rw-r--r-- | arch/tile/kernel/backtrace.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/tile/kernel/backtrace.c b/arch/tile/kernel/backtrace.c index 9092ce8aa6b4..f8b74ca83b92 100644 --- a/arch/tile/kernel/backtrace.c +++ b/arch/tile/kernel/backtrace.c @@ -14,6 +14,7 @@ #include <linux/kernel.h> #include <linux/string.h> +#include <asm/byteorder.h> #include <asm/backtrace.h> #include <asm/tile-desc.h> #include <arch/abi.h> @@ -336,8 +337,12 @@ static void find_caller_pc_and_caller_sp(CallerLocation *location, bytes_to_prefetch / sizeof(tile_bundle_bits); } - /* Decode the next bundle. */ - bundle.bits = prefetched_bundles[next_bundle++]; + /* + * Decode the next bundle. + * TILE always stores instruction bundles in little-endian + * mode, even when the chip is running in big-endian mode. + */ + bundle.bits = le64_to_cpu(prefetched_bundles[next_bundle++]); bundle.num_insns = parse_insn_tile(bundle.bits, pc, bundle.insns); num_info_ops = bt_get_info_ops(&bundle, info_operands); |