devcoredump.h 986 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __DEVCOREDUMP_H
  2. #define __DEVCOREDUMP_H
  3. #include <linux/device.h>
  4. #include <linux/module.h>
  5. #include <linux/vmalloc.h>
  6. #ifdef CONFIG_DEV_COREDUMP
  7. void dev_coredumpv(struct device *dev, const void *data, size_t datalen,
  8. gfp_t gfp);
  9. void dev_coredumpm(struct device *dev, struct module *owner,
  10. const void *data, size_t datalen, gfp_t gfp,
  11. ssize_t (*read)(char *buffer, loff_t offset, size_t count,
  12. const void *data, size_t datalen),
  13. void (*free)(const void *data));
  14. #else
  15. static inline void dev_coredumpv(struct device *dev, const void *data,
  16. size_t datalen, gfp_t gfp)
  17. {
  18. vfree(data);
  19. }
  20. static inline void
  21. dev_coredumpm(struct device *dev, struct module *owner,
  22. const void *data, size_t datalen, gfp_t gfp,
  23. ssize_t (*read)(char *buffer, loff_t offset, size_t count,
  24. const void *data, size_t datalen),
  25. void (*free)(const void *data))
  26. {
  27. free(data);
  28. }
  29. #endif /* CONFIG_DEV_COREDUMP */
  30. #endif /* __DEVCOREDUMP_H */