From bd1499f1a1a123f5720f8ef4cc60b1782873bd4c Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Fri, 2 Aug 2019 08:56:37 -0700 Subject: [PATCH] qcom: soc: minidump: Add snapshot of minidump.h Add snapshot of minidump.h from msm-4.19 commit (Merge "uapi: Introduce V4L2_FLAG_CVPMETADATA_SKIP flag"). Change-Id: Id2104e23f514f007e757e14d9ee8826e35013c80 Signed-off-by: Elliot Berman --- include/soc/qcom/minidump.h | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 include/soc/qcom/minidump.h diff --git a/include/soc/qcom/minidump.h b/include/soc/qcom/minidump.h new file mode 100644 index 000000000000..b9f375b1f3a0 --- /dev/null +++ b/include/soc/qcom/minidump.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + */ + +#ifndef __MINIDUMP_H +#define __MINIDUMP_H + +#define MAX_NAME_LENGTH 12 +/* md_region - Minidump table entry + * @name: Entry name, Minidump will dump binary with this name. + * @id: Entry ID, used only for SDI dumps. + * @virt_addr: Address of the entry. + * @phys_addr: Physical address of the entry to dump. + * @size: Number of byte to dump from @address location + * it should be 4 byte aligned. + */ +struct md_region { + char name[MAX_NAME_LENGTH]; + u32 id; + u64 virt_addr; + u64 phys_addr; + u64 size; +}; + +/* Register an entry in Minidump table + * Returns: + * Zero: on successful addition + * Negetive error number on failures + */ +#if IS_ENABLED(CONFIG_QCOM_MINIDUMP) +extern int msm_minidump_add_region(const struct md_region *entry); +extern bool msm_minidump_enabled(void); +extern void dump_stack_minidump(u64 sp); +#else +static inline int msm_minidump_add_region(const struct md_region *entry) +{ + /* Return quietly, if minidump is not supported */ + return 0; +} +static inline bool msm_minidump_enabled(void) { return false; } +static inline void dump_stack_minidump(u64 sp) {} +#endif +#endif