mca.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * File: mca.h
  3. * Purpose: Machine check handling specific defines
  4. *
  5. * Copyright (C) 1999, 2004 Silicon Graphics, Inc.
  6. * Copyright (C) Vijay Chander (vijay@engr.sgi.com)
  7. * Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com)
  8. * Copyright (C) Russ Anderson (rja@sgi.com)
  9. */
  10. #ifndef _ASM_IA64_MCA_H
  11. #define _ASM_IA64_MCA_H
  12. #define IA64_MCA_STACK_SIZE 8192
  13. #if !defined(__ASSEMBLY__)
  14. #include <linux/interrupt.h>
  15. #include <linux/types.h>
  16. #include <asm/param.h>
  17. #include <asm/sal.h>
  18. #include <asm/processor.h>
  19. #include <asm/mca_asm.h>
  20. #define IA64_MCA_RENDEZ_TIMEOUT (20 * 1000) /* value in milliseconds - 20 seconds */
  21. typedef struct ia64_fptr {
  22. unsigned long fp;
  23. unsigned long gp;
  24. } ia64_fptr_t;
  25. typedef union cmcv_reg_u {
  26. u64 cmcv_regval;
  27. struct {
  28. u64 cmcr_vector : 8;
  29. u64 cmcr_reserved1 : 4;
  30. u64 cmcr_ignored1 : 1;
  31. u64 cmcr_reserved2 : 3;
  32. u64 cmcr_mask : 1;
  33. u64 cmcr_ignored2 : 47;
  34. } cmcv_reg_s;
  35. } cmcv_reg_t;
  36. #define cmcv_mask cmcv_reg_s.cmcr_mask
  37. #define cmcv_vector cmcv_reg_s.cmcr_vector
  38. enum {
  39. IA64_MCA_RENDEZ_CHECKIN_NOTDONE = 0x0,
  40. IA64_MCA_RENDEZ_CHECKIN_DONE = 0x1
  41. };
  42. /* Information maintained by the MC infrastructure */
  43. typedef struct ia64_mc_info_s {
  44. u64 imi_mca_handler;
  45. size_t imi_mca_handler_size;
  46. u64 imi_monarch_init_handler;
  47. size_t imi_monarch_init_handler_size;
  48. u64 imi_slave_init_handler;
  49. size_t imi_slave_init_handler_size;
  50. u8 imi_rendez_checkin[NR_CPUS];
  51. } ia64_mc_info_t;
  52. typedef struct ia64_mca_sal_to_os_state_s {
  53. u64 imsto_os_gp; /* GP of the os registered with the SAL */
  54. u64 imsto_pal_proc; /* PAL_PROC entry point - physical addr */
  55. u64 imsto_sal_proc; /* SAL_PROC entry point - physical addr */
  56. u64 imsto_sal_gp; /* GP of the SAL - physical */
  57. u64 imsto_rendez_state; /* Rendez state information */
  58. u64 imsto_sal_check_ra; /* Return address in SAL_CHECK while going
  59. * back to SAL from OS after MCA handling.
  60. */
  61. u64 pal_min_state; /* from PAL in r17 */
  62. u64 proc_state_param; /* from PAL in r18. See SDV 2:268 11.3.2.1 */
  63. } ia64_mca_sal_to_os_state_t;
  64. enum {
  65. IA64_MCA_CORRECTED = 0x0, /* Error has been corrected by OS_MCA */
  66. IA64_MCA_WARM_BOOT = -1, /* Warm boot of the system need from SAL */
  67. IA64_MCA_COLD_BOOT = -2, /* Cold boot of the system need from SAL */
  68. IA64_MCA_HALT = -3 /* System to be halted by SAL */
  69. };
  70. enum {
  71. IA64_MCA_SAME_CONTEXT = 0x0, /* SAL to return to same context */
  72. IA64_MCA_NEW_CONTEXT = -1 /* SAL to return to new context */
  73. };
  74. typedef struct ia64_mca_os_to_sal_state_s {
  75. u64 imots_os_status; /* OS status to SAL as to what happened
  76. * with the MCA handling.
  77. */
  78. u64 imots_sal_gp; /* GP of the SAL - physical */
  79. u64 imots_context; /* 0 if return to same context
  80. 1 if return to new context */
  81. u64 *imots_new_min_state; /* Pointer to structure containing
  82. * new values of registers in the min state
  83. * save area.
  84. */
  85. u64 imots_sal_check_ra; /* Return address in SAL_CHECK while going
  86. * back to SAL from OS after MCA handling.
  87. */
  88. } ia64_mca_os_to_sal_state_t;
  89. /* Per-CPU MCA state that is too big for normal per-CPU variables. */
  90. struct ia64_mca_cpu {
  91. u64 stack[IA64_MCA_STACK_SIZE/8]; /* MCA memory-stack */
  92. u64 proc_state_dump[512];
  93. u64 stackframe[32];
  94. u64 rbstore[IA64_MCA_STACK_SIZE/8]; /* MCA reg.-backing store */
  95. u64 init_stack[KERNEL_STACK_SIZE/8];
  96. } __attribute__ ((aligned(16)));
  97. /* Array of physical addresses of each CPU's MCA area. */
  98. extern unsigned long __per_cpu_mca[NR_CPUS];
  99. extern void ia64_mca_init(void);
  100. extern void ia64_mca_cpu_init(void *);
  101. extern void ia64_os_mca_dispatch(void);
  102. extern void ia64_os_mca_dispatch_end(void);
  103. extern void ia64_mca_ucmc_handler(void);
  104. extern void ia64_monarch_init_handler(void);
  105. extern void ia64_slave_init_handler(void);
  106. extern void ia64_mca_cmc_vector_setup(void);
  107. extern int ia64_reg_MCA_extension(void*);
  108. extern void ia64_unreg_MCA_extension(void);
  109. #endif /* !__ASSEMBLY__ */
  110. #endif /* _ASM_IA64_MCA_H */