ioerror.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
  7. */
  8. #ifndef _ASM_IA64_SN_IOERROR_H
  9. #define _ASM_IA64_SN_IOERROR_H
  10. /*
  11. * IO error structure.
  12. *
  13. * This structure would expand to hold the information retrieved from
  14. * all IO related error registers.
  15. *
  16. * This structure is defined to hold all system specific
  17. * information related to a single error.
  18. *
  19. * This serves a couple of purpose.
  20. * - Error handling often involves translating one form of address to other
  21. * form. So, instead of having different data structures at each level,
  22. * we have a single structure, and the appropriate fields get filled in
  23. * at each layer.
  24. * - This provides a way to dump all error related information in any layer
  25. * of erorr handling (debugging aid).
  26. *
  27. * A second possibility is to allow each layer to define its own error
  28. * data structure, and fill in the proper fields. This has the advantage
  29. * of isolating the layers.
  30. * A big concern is the potential stack usage (and overflow), if each layer
  31. * defines these structures on stack (assuming we don't want to do kmalloc.
  32. *
  33. * Any layer wishing to pass extra information to a layer next to it in
  34. * error handling hierarchy, can do so as a separate parameter.
  35. */
  36. typedef struct io_error_s {
  37. /* Bit fields indicating which structure fields are valid */
  38. union {
  39. struct {
  40. unsigned ievb_errortype:1;
  41. unsigned ievb_widgetnum:1;
  42. unsigned ievb_widgetdev:1;
  43. unsigned ievb_srccpu:1;
  44. unsigned ievb_srcnode:1;
  45. unsigned ievb_errnode:1;
  46. unsigned ievb_sysioaddr:1;
  47. unsigned ievb_xtalkaddr:1;
  48. unsigned ievb_busspace:1;
  49. unsigned ievb_busaddr:1;
  50. unsigned ievb_vaddr:1;
  51. unsigned ievb_memaddr:1;
  52. unsigned ievb_epc:1;
  53. unsigned ievb_ef:1;
  54. unsigned ievb_tnum:1;
  55. } iev_b;
  56. unsigned iev_a;
  57. } ie_v;
  58. short ie_errortype; /* error type: extra info about error */
  59. short ie_widgetnum; /* Widget number that's in error */
  60. short ie_widgetdev; /* Device within widget in error */
  61. cpuid_t ie_srccpu; /* CPU on srcnode generating error */
  62. cnodeid_t ie_srcnode; /* Node which caused the error */
  63. cnodeid_t ie_errnode; /* Node where error was noticed */
  64. iopaddr_t ie_sysioaddr; /* Sys specific IO address */
  65. iopaddr_t ie_xtalkaddr; /* Xtalk (48bit) addr of Error */
  66. iopaddr_t ie_busspace; /* Bus specific address space */
  67. iopaddr_t ie_busaddr; /* Bus specific address */
  68. caddr_t ie_vaddr; /* Virtual address of error */
  69. iopaddr_t ie_memaddr; /* Physical memory address */
  70. caddr_t ie_epc; /* pc when error reported */
  71. caddr_t ie_ef; /* eframe when error reported */
  72. short ie_tnum; /* Xtalk TNUM field */
  73. } ioerror_t;
  74. #define IOERROR_INIT(e) do { (e)->ie_v.iev_a = 0; } while (0)
  75. #define IOERROR_SETVALUE(e,f,v) do { (e)->ie_ ## f = (v); (e)->ie_v.iev_b.ievb_ ## f = 1; } while (0)
  76. #endif /* _ASM_IA64_SN_IOERROR_H */