amd64_edac_dbg.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #include "amd64_edac.h"
  2. #define EDAC_DCT_ATTR_SHOW(reg) \
  3. static ssize_t amd64_##reg##_show(struct mem_ctl_info *mci, char *data) \
  4. { \
  5. struct amd64_pvt *pvt = mci->pvt_info; \
  6. return sprintf(data, "0x%016llx\n", (u64)pvt->reg); \
  7. }
  8. EDAC_DCT_ATTR_SHOW(dhar);
  9. EDAC_DCT_ATTR_SHOW(dbam0);
  10. EDAC_DCT_ATTR_SHOW(top_mem);
  11. EDAC_DCT_ATTR_SHOW(top_mem2);
  12. static ssize_t amd64_hole_show(struct mem_ctl_info *mci, char *data)
  13. {
  14. u64 hole_base = 0;
  15. u64 hole_offset = 0;
  16. u64 hole_size = 0;
  17. amd64_get_dram_hole_info(mci, &hole_base, &hole_offset, &hole_size);
  18. return sprintf(data, "%llx %llx %llx\n", hole_base, hole_offset,
  19. hole_size);
  20. }
  21. /*
  22. * update NUM_DBG_ATTRS in case you add new members
  23. */
  24. struct mcidev_sysfs_attribute amd64_dbg_attrs[] = {
  25. {
  26. .attr = {
  27. .name = "dhar",
  28. .mode = (S_IRUGO)
  29. },
  30. .show = amd64_dhar_show,
  31. .store = NULL,
  32. },
  33. {
  34. .attr = {
  35. .name = "dbam",
  36. .mode = (S_IRUGO)
  37. },
  38. .show = amd64_dbam0_show,
  39. .store = NULL,
  40. },
  41. {
  42. .attr = {
  43. .name = "topmem",
  44. .mode = (S_IRUGO)
  45. },
  46. .show = amd64_top_mem_show,
  47. .store = NULL,
  48. },
  49. {
  50. .attr = {
  51. .name = "topmem2",
  52. .mode = (S_IRUGO)
  53. },
  54. .show = amd64_top_mem2_show,
  55. .store = NULL,
  56. },
  57. {
  58. .attr = {
  59. .name = "dram_hole",
  60. .mode = (S_IRUGO)
  61. },
  62. .show = amd64_hole_show,
  63. .store = NULL,
  64. },
  65. };