nmi.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. * Derived from IRIX <sys/SN/nmi.h>, Revision 1.5.
  7. *
  8. * Copyright (C) 1992 - 1997 Silicon Graphics, Inc.
  9. */
  10. #ifndef __ASM_SN_NMI_H
  11. #define __ASM_SN_NMI_H
  12. #include <asm/sn/addrs.h>
  13. /*
  14. * The launch data structure resides at a fixed place in each node's memory
  15. * and is used to communicate between the master processor and the slave
  16. * processors.
  17. *
  18. * The master stores launch parameters in the launch structure
  19. * corresponding to a target processor that is in a slave loop, then sends
  20. * an interrupt to the slave processor. The slave calls the desired
  21. * function, followed by an optional rendezvous function, then returns to
  22. * the slave loop. The master does not wait for the slaves before
  23. * returning.
  24. *
  25. * There is an array of launch structures, one per CPU on the node. One
  26. * interrupt level is used per CPU.
  27. */
  28. #define NMI_MAGIC 0x48414d4d455201
  29. #define NMI_SIZEOF 0x40
  30. #define NMI_OFF_MAGIC 0x00 /* Struct offsets for assembly */
  31. #define NMI_OFF_FLAGS 0x08
  32. #define NMI_OFF_CALL 0x10
  33. #define NMI_OFF_CALLC 0x18
  34. #define NMI_OFF_CALLPARM 0x20
  35. #define NMI_OFF_GMASTER 0x28
  36. /*
  37. * The NMI routine is called only if the complement address is
  38. * correct.
  39. *
  40. * Before control is transferred to a routine, the complement address
  41. * is zeroed (invalidated) to prevent an accidental call from a spurious
  42. * interrupt.
  43. *
  44. */
  45. #ifndef __ASSEMBLY__
  46. typedef struct nmi_s {
  47. volatile unsigned long magic; /* Magic number */
  48. volatile unsigned long flags; /* Combination of flags above */
  49. volatile void *call_addr; /* Routine for slave to call */
  50. volatile void *call_addr_c; /* 1's complement of address */
  51. volatile void *call_parm; /* Single parm passed to call */
  52. volatile unsigned long gmaster; /* Flag true only on global master*/
  53. } nmi_t;
  54. #endif /* !__ASSEMBLY__ */
  55. /* Following definitions are needed both in the prom & the kernel
  56. * to identify the format of the nmi cpu register save area in the
  57. * low memory on each node.
  58. */
  59. #ifndef __ASSEMBLY__
  60. struct reg_struct {
  61. unsigned long gpr[32];
  62. unsigned long sr;
  63. unsigned long cause;
  64. unsigned long epc;
  65. unsigned long badva;
  66. unsigned long error_epc;
  67. unsigned long cache_err;
  68. unsigned long nmi_sr;
  69. };
  70. #endif /* !__ASSEMBLY__ */
  71. /* These are the assembly language offsets into the reg_struct structure */
  72. #define R0_OFF 0x0
  73. #define R1_OFF 0x8
  74. #define R2_OFF 0x10
  75. #define R3_OFF 0x18
  76. #define R4_OFF 0x20
  77. #define R5_OFF 0x28
  78. #define R6_OFF 0x30
  79. #define R7_OFF 0x38
  80. #define R8_OFF 0x40
  81. #define R9_OFF 0x48
  82. #define R10_OFF 0x50
  83. #define R11_OFF 0x58
  84. #define R12_OFF 0x60
  85. #define R13_OFF 0x68
  86. #define R14_OFF 0x70
  87. #define R15_OFF 0x78
  88. #define R16_OFF 0x80
  89. #define R17_OFF 0x88
  90. #define R18_OFF 0x90
  91. #define R19_OFF 0x98
  92. #define R20_OFF 0xa0
  93. #define R21_OFF 0xa8
  94. #define R22_OFF 0xb0
  95. #define R23_OFF 0xb8
  96. #define R24_OFF 0xc0
  97. #define R25_OFF 0xc8
  98. #define R26_OFF 0xd0
  99. #define R27_OFF 0xd8
  100. #define R28_OFF 0xe0
  101. #define R29_OFF 0xe8
  102. #define R30_OFF 0xf0
  103. #define R31_OFF 0xf8
  104. #define SR_OFF 0x100
  105. #define CAUSE_OFF 0x108
  106. #define EPC_OFF 0x110
  107. #define BADVA_OFF 0x118
  108. #define ERROR_EPC_OFF 0x120
  109. #define CACHE_ERR_OFF 0x128
  110. #define NMISR_OFF 0x130
  111. #endif /* __ASM_SN_NMI_H */