Eric Holmberg | d80315b | 2013-03-15 15:22:01 -0600 | [diff] [blame] | 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 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 Boyd | c1a7261 | 2012-07-05 14:07:35 -0700 | [diff] [blame] | 16 | struct device; |
| 17 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 18 | struct ramdump_segment { |
| 19 | unsigned long address; |
| 20 | unsigned long size; |
| 21 | }; |
| 22 | |
Eric Holmberg | d80315b | 2013-03-15 15:22:01 -0600 | [diff] [blame] | 23 | #ifdef CONFIG_MSM_SUBSYSTEM_RESTART |
Stephen Boyd | c1a7261 | 2012-07-05 14:07:35 -0700 | [diff] [blame] | 24 | void *create_ramdump_device(const char *dev_name, struct device *parent); |
Stephen Boyd | b9fab14 | 2012-06-20 15:33:32 -0700 | [diff] [blame] | 25 | void destroy_ramdump_device(void *dev); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 26 | int do_ramdump(void *handle, struct ramdump_segment *segments, |
| 27 | int nsegments); |
Stephen Boyd | 73bab7f | 2012-11-29 12:41:29 -0800 | [diff] [blame] | 28 | int do_elf_ramdump(void *handle, struct ramdump_segment *segments, |
| 29 | int nsegments); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 30 | |
Eric Holmberg | d80315b | 2013-03-15 15:22:01 -0600 | [diff] [blame] | 31 | #else |
| 32 | static inline void *create_ramdump_device(const char *dev_name, |
| 33 | struct device *parent) |
| 34 | { |
| 35 | return NULL; |
| 36 | } |
| 37 | |
| 38 | static inline void destroy_ramdump_device(void *dev) |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | static inline int do_ramdump(void *handle, struct ramdump_segment *segments, |
| 43 | int nsegments) |
| 44 | { |
| 45 | return -ENODEV; |
| 46 | } |
| 47 | |
| 48 | static 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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 55 | #endif |