edac_module.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * edac_module.h
  3. *
  4. * For defining functions/data for within the EDAC_CORE module only
  5. *
  6. * written by doug thompson <norsk5@xmission.h>
  7. */
  8. #ifndef __EDAC_MODULE_H__
  9. #define __EDAC_MODULE_H__
  10. #include "edac_core.h"
  11. /*
  12. * INTERNAL EDAC MODULE:
  13. * EDAC memory controller sysfs create/remove functions
  14. * and setup/teardown functions
  15. *
  16. * edac_mc objects
  17. */
  18. /* on edac_mc_sysfs.c */
  19. int edac_mc_sysfs_init(void);
  20. void edac_mc_sysfs_exit(void);
  21. extern int edac_create_sysfs_mci_device(struct mem_ctl_info *mci,
  22. const struct attribute_group **groups);
  23. extern void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci);
  24. void edac_unregister_sysfs(struct mem_ctl_info *mci);
  25. extern int edac_get_log_ue(void);
  26. extern int edac_get_log_ce(void);
  27. extern int edac_get_panic_on_ue(void);
  28. extern int edac_mc_get_log_ue(void);
  29. extern int edac_mc_get_log_ce(void);
  30. extern int edac_mc_get_panic_on_ue(void);
  31. extern int edac_get_poll_msec(void);
  32. extern int edac_mc_get_poll_msec(void);
  33. unsigned edac_dimm_info_location(struct dimm_info *dimm, char *buf,
  34. unsigned len);
  35. /* on edac_device.c */
  36. extern int edac_device_register_sysfs_main_kobj(
  37. struct edac_device_ctl_info *edac_dev);
  38. extern void edac_device_unregister_sysfs_main_kobj(
  39. struct edac_device_ctl_info *edac_dev);
  40. extern int edac_device_create_sysfs(struct edac_device_ctl_info *edac_dev);
  41. extern void edac_device_remove_sysfs(struct edac_device_ctl_info *edac_dev);
  42. /* edac core workqueue: single CPU mode */
  43. int edac_workqueue_setup(void);
  44. void edac_workqueue_teardown(void);
  45. bool edac_queue_work(struct delayed_work *work, unsigned long delay);
  46. bool edac_stop_work(struct delayed_work *work);
  47. bool edac_mod_work(struct delayed_work *work, unsigned long delay);
  48. extern void edac_device_reset_delay_period(struct edac_device_ctl_info
  49. *edac_dev, unsigned long value);
  50. extern void edac_mc_reset_delay_period(unsigned long value);
  51. extern void *edac_align_ptr(void **p, unsigned size, int n_elems);
  52. /*
  53. * EDAC debugfs functions
  54. */
  55. #define edac_debugfs_remove_recursive debugfs_remove_recursive
  56. #define edac_debugfs_remove debugfs_remove
  57. #ifdef CONFIG_EDAC_DEBUG
  58. int edac_debugfs_init(void);
  59. void edac_debugfs_exit(void);
  60. int edac_create_debugfs_nodes(struct mem_ctl_info *mci);
  61. struct dentry *edac_debugfs_create_dir(const char *dirname);
  62. struct dentry *
  63. edac_debugfs_create_dir_at(const char *dirname, struct dentry *parent);
  64. struct dentry *
  65. edac_debugfs_create_file(const char *name, umode_t mode, struct dentry *parent,
  66. void *data, const struct file_operations *fops);
  67. struct dentry *
  68. edac_debugfs_create_x8(const char *name, umode_t mode, struct dentry *parent, u8 *value);
  69. struct dentry *
  70. edac_debugfs_create_x16(const char *name, umode_t mode, struct dentry *parent, u16 *value);
  71. #else
  72. static inline int edac_debugfs_init(void) { return -ENODEV; }
  73. static inline void edac_debugfs_exit(void) { }
  74. static inline int edac_create_debugfs_nodes(struct mem_ctl_info *mci) { return 0; }
  75. static inline struct dentry *edac_debugfs_create_dir(const char *dirname) { return NULL; }
  76. static inline struct dentry *
  77. edac_debugfs_create_dir_at(const char *dirname, struct dentry *parent) { return NULL; }
  78. static inline struct dentry *
  79. edac_debugfs_create_file(const char *name, umode_t mode, struct dentry *parent,
  80. void *data, const struct file_operations *fops) { return NULL; }
  81. static inline struct dentry *
  82. edac_debugfs_create_x8(const char *name, umode_t mode,
  83. struct dentry *parent, u8 *value) { return NULL; }
  84. static inline struct dentry *
  85. edac_debugfs_create_x16(const char *name, umode_t mode,
  86. struct dentry *parent, u16 *value) { return NULL; }
  87. #endif
  88. /*
  89. * EDAC PCI functions
  90. */
  91. #ifdef CONFIG_PCI
  92. extern void edac_pci_do_parity_check(void);
  93. extern void edac_pci_clear_parity_errors(void);
  94. extern int edac_sysfs_pci_setup(void);
  95. extern void edac_sysfs_pci_teardown(void);
  96. extern int edac_pci_get_check_errors(void);
  97. extern int edac_pci_get_poll_msec(void);
  98. extern void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci);
  99. extern void edac_pci_handle_pe(struct edac_pci_ctl_info *pci, const char *msg);
  100. extern void edac_pci_handle_npe(struct edac_pci_ctl_info *pci,
  101. const char *msg);
  102. #else /* CONFIG_PCI */
  103. /* pre-process these away */
  104. #define edac_pci_do_parity_check()
  105. #define edac_pci_clear_parity_errors()
  106. #define edac_sysfs_pci_setup() (0)
  107. #define edac_sysfs_pci_teardown()
  108. #define edac_pci_get_check_errors()
  109. #define edac_pci_get_poll_msec()
  110. #define edac_pci_handle_pe()
  111. #define edac_pci_handle_npe()
  112. #endif /* CONFIG_PCI */
  113. #endif /* __EDAC_MODULE_H__ */