summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/fadump-internal.h
diff options
context:
space:
mode:
authorHari Bathini <hbathini@linux.ibm.com>2019-09-11 17:48:14 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2019-09-13 17:04:41 +0300
commit0226e55275e569126882a7befe0b1a1c9bd270aa (patch)
treeb1d7add3ce605cf4352350cbdbdd8a077587ee10 /arch/powerpc/include/asm/fadump-internal.h
parent72aa651795f0e9f48bfdb2b2dd0b3e6900351d2a (diff)
downloadlinux-0226e55275e569126882a7befe0b1a1c9bd270aa.tar.xz
powerpc/fadump: move rtas specific definitions to platform code
Currently, FADump is only supported on pSeries but that is going to change soon with FADump support being added on PowerNV platform. So, move rtas specific definitions to platform code to allow FADump to have multiple platforms support. Signed-off-by: Hari Bathini <hbathini@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/156821328494.5656.16219929140866195511.stgit@hbathini.in.ibm.com
Diffstat (limited to 'arch/powerpc/include/asm/fadump-internal.h')
-rw-r--r--arch/powerpc/include/asm/fadump-internal.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/fadump-internal.h b/arch/powerpc/include/asm/fadump-internal.h
index e004c89570b0..f8097510e03f 100644
--- a/arch/powerpc/include/asm/fadump-internal.h
+++ b/arch/powerpc/include/asm/fadump-internal.h
@@ -43,7 +43,25 @@
#define FADUMP_UNREGISTER 2
#define FADUMP_INVALIDATE 3
-#define FADUMP_CRASH_INFO_MAGIC str_to_u64("FADMPINF")
+/*
+ * Copy the ascii values for first 8 characters from a string into u64
+ * variable at their respective indexes.
+ * e.g.
+ * The string "FADMPINF" will be converted into 0x4641444d50494e46
+ */
+static inline u64 fadump_str_to_u64(const char *str)
+{
+ u64 val = 0;
+ int i;
+
+ for (i = 0; i < sizeof(val); i++)
+ val = (*str) ? (val << 8) | *str++ : val << 8;
+ return val;
+}
+
+#define FADUMP_CPU_UNKNOWN (~((u32)0))
+
+#define FADUMP_CRASH_INFO_MAGIC fadump_str_to_u64("FADMPINF")
/* fadump crash info structure */
struct fadump_crash_info_header {