aboutsummaryrefslogtreecommitdiff
path: root/meta-bigendian
diff options
context:
space:
mode:
authorTaras Kondratiuk <taras.kondratiuk@linaro.org>2013-10-04 15:26:31 +0300
committerTaras Kondratiuk <taras.kondratiuk@linaro.org>2014-01-11 02:12:37 +0200
commit5859c139200d474679a6ec07d46596ff55eb0a8e (patch)
tree52d55c0be746266568f2dea795d9f0a52b0c6546 /meta-bigendian
parentbf62ffc415502c1f18b3d0a03a9166d35288cfcb (diff)
downloadmeta-linaro-5859c139200d474679a6ec07d46596ff55eb0a8e.tar.gz
meta-bigendian: kexec-tools: arm: Fix endianness in crashdump header
Change-Id: Ic0ae08a66e91c7855c521d95ea831183b5ef73a8 Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Diffstat (limited to 'meta-bigendian')
-rw-r--r--meta-bigendian/recipes-kernel/kexec/kexec-tools/arm-Fix-endianness-in-crashdump-header.patch45
-rw-r--r--meta-bigendian/recipes-kernel/kexec/kexec-tools_2.0.4.bbappend3
2 files changed, 48 insertions, 0 deletions
diff --git a/meta-bigendian/recipes-kernel/kexec/kexec-tools/arm-Fix-endianness-in-crashdump-header.patch b/meta-bigendian/recipes-kernel/kexec/kexec-tools/arm-Fix-endianness-in-crashdump-header.patch
new file mode 100644
index 00000000..e9cb46fb
--- /dev/null
+++ b/meta-bigendian/recipes-kernel/kexec/kexec-tools/arm-Fix-endianness-in-crashdump-header.patch
@@ -0,0 +1,45 @@
+From 0ead5372ca72493844111b256567b6c8e5e9d9be Mon Sep 17 00:00:00 2001
+From: Taras Kondratiuk <taras.kondratiuk@linaro.org>
+Date: Thu, 3 Oct 2013 18:09:31 +0300
+Subject: [PATCH] kexec: arm: Fix endianness in crashdump header
+
+Currently little-endian ELFDATA is hard-coded in crashdump header.
+This lead to a wrong header format if crashdump is generated on BE system.
+
+Set native endianness into ELFDATA field.
+
+Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
+---
+ kexec/arch/arm/crashdump-arm.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
+index 01973b1..0cd6935 100644
+--- a/kexec/arch/arm/crashdump-arm.c
++++ b/kexec/arch/arm/crashdump-arm.c
+@@ -31,6 +31,13 @@
+ #include "../../crashdump.h"
+ #include "crashdump-arm.h"
+
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++#define ELFDATANATIVE ELFDATA2LSB
++#elif __BYTE_ORDER == __BIG_ENDIAN
++#define ELFDATANATIVE ELFDATA2MSB
++#else
++#error "Unknown machine endian"
++#endif
+
+ /*
+ * Used to save various memory ranges/regions needed for the captured
+@@ -47,7 +54,7 @@ static struct memory_range crash_reserved_mem;
+
+ static struct crash_elf_info elf_info = {
+ .class = ELFCLASS32,
+- .data = ELFDATA2LSB,
++ .data = ELFDATANATIVE,
+ .machine = EM_ARM,
+ .page_offset = PAGE_OFFSET,
+ };
+--
+1.7.9.5
+
diff --git a/meta-bigendian/recipes-kernel/kexec/kexec-tools_2.0.4.bbappend b/meta-bigendian/recipes-kernel/kexec/kexec-tools_2.0.4.bbappend
new file mode 100644
index 00000000..8c25d259
--- /dev/null
+++ b/meta-bigendian/recipes-kernel/kexec/kexec-tools_2.0.4.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://arm-Fix-endianness-in-crashdump-header.patch"