Chris Lew | 3c835676 | 2016-08-01 15:18:55 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. |
| 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 | |
| 16 | struct device; |
| 17 | |
| 18 | struct ramdump_segment { |
| 19 | unsigned long address; |
| 20 | void *v_address; |
| 21 | unsigned long size; |
| 22 | }; |
| 23 | |
| 24 | #ifdef CONFIG_MSM_SUBSYSTEM_RESTART |
| 25 | extern void *create_ramdump_device(const char *dev_name, struct device *parent); |
| 26 | extern void destroy_ramdump_device(void *dev); |
| 27 | extern int do_ramdump(void *handle, struct ramdump_segment *segments, |
| 28 | int nsegments); |
| 29 | extern int do_elf_ramdump(void *handle, struct ramdump_segment *segments, |
| 30 | int nsegments); |
| 31 | |
| 32 | #else |
| 33 | static inline void *create_ramdump_device(const char *dev_name, |
| 34 | struct device *parent) |
| 35 | { |
| 36 | return NULL; |
| 37 | } |
| 38 | |
| 39 | static inline void destroy_ramdump_device(void *dev) |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | static inline int do_ramdump(void *handle, struct ramdump_segment *segments, |
| 44 | int nsegments) |
| 45 | { |
| 46 | return -ENODEV; |
| 47 | } |
| 48 | |
| 49 | static inline int do_elf_ramdump(void *handle, struct ramdump_segment *segments, |
| 50 | int nsegments) |
| 51 | { |
| 52 | return -ENODEV; |
| 53 | } |
| 54 | #endif /* CONFIG_MSM_SUBSYSTEM_RESTART */ |
| 55 | |
| 56 | #endif |