blob: 3a960a1cc92d502fb6f423625e525686522574af [file] [log] [blame]
Eric Holmbergd80315b2013-03-15 15:22:01 -06001/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -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
Stephen Boydc1a72612012-07-05 14:07:35 -070016struct device;
17
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070018struct ramdump_segment {
19 unsigned long address;
20 unsigned long size;
21};
22
Eric Holmbergd80315b2013-03-15 15:22:01 -060023#ifdef CONFIG_MSM_SUBSYSTEM_RESTART
Stephen Boydc1a72612012-07-05 14:07:35 -070024void *create_ramdump_device(const char *dev_name, struct device *parent);
Stephen Boydb9fab142012-06-20 15:33:32 -070025void destroy_ramdump_device(void *dev);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070026int do_ramdump(void *handle, struct ramdump_segment *segments,
27 int nsegments);
Stephen Boyd73bab7f2012-11-29 12:41:29 -080028int do_elf_ramdump(void *handle, struct ramdump_segment *segments,
29 int nsegments);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070030
Eric Holmbergd80315b2013-03-15 15:22:01 -060031#else
32static inline void *create_ramdump_device(const char *dev_name,
33 struct device *parent)
34{
35 return NULL;
36}
37
38static inline void destroy_ramdump_device(void *dev)
39{
40}
41
42static inline int do_ramdump(void *handle, struct ramdump_segment *segments,
43 int nsegments)
44{
45 return -ENODEV;
46}
47
48static inline int do_elf_ramdump(void *handle, struct ramdump_segment *segments,
49 int nsegments)
50{
51 return -ENODEV;
52}
53#endif /* CONFIG_MSM_SUBSYSTEM_RESTART */
54
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055#endif