blob: 4e23ccf269a7145aeee9a1e8228eb36de79abef1 [file] [log] [blame]
Avaneesh Kumar Dwivediec6d1392017-07-06 21:18:03 +05301/* Copyright (c) 2011-2014, 2017 The Linux Foundation. All rights reserved.
Chris Lew3c8356762016-08-01 15:18:55 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _RAMDUMP_HEADER
14#define _RAMDUMP_HEADER
15
16struct device;
17
18struct ramdump_segment {
Avaneesh Kumar Dwivediec6d1392017-07-06 21:18:03 +053019 char *name;
Chris Lew3c8356762016-08-01 15:18:55 -070020 unsigned long address;
21 void *v_address;
22 unsigned long size;
23};
24
25#ifdef CONFIG_MSM_SUBSYSTEM_RESTART
26extern void *create_ramdump_device(const char *dev_name, struct device *parent);
27extern void destroy_ramdump_device(void *dev);
28extern int do_ramdump(void *handle, struct ramdump_segment *segments,
29 int nsegments);
30extern int do_elf_ramdump(void *handle, struct ramdump_segment *segments,
31 int nsegments);
Avaneesh Kumar Dwivediec6d1392017-07-06 21:18:03 +053032extern int do_minidump(void *handle, struct ramdump_segment *segments,
33 int nsegments);
Chris Lew3c8356762016-08-01 15:18:55 -070034
35#else
36static inline void *create_ramdump_device(const char *dev_name,
37 struct device *parent)
38{
39 return NULL;
40}
41
42static inline void destroy_ramdump_device(void *dev)
43{
44}
45
46static inline int do_ramdump(void *handle, struct ramdump_segment *segments,
47 int nsegments)
48{
49 return -ENODEV;
50}
51
52static inline int do_elf_ramdump(void *handle, struct ramdump_segment *segments,
53 int nsegments)
54{
55 return -ENODEV;
56}
57#endif /* CONFIG_MSM_SUBSYSTEM_RESTART */
58
59#endif