octeon-wdt-nmi.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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) 2007 Cavium Networks
  7. */
  8. #include <asm/asm.h>
  9. #include <asm/regdef.h>
  10. #define SAVE_REG(r) sd $r, -32768+6912-(32-r)*8($0)
  11. NESTED(octeon_wdt_nmi_stage2, 0, sp)
  12. .set push
  13. .set noreorder
  14. .set noat
  15. /* Save all registers to the top CVMSEG. This shouldn't
  16. * corrupt any state used by the kernel. Also all registers
  17. * should have the value right before the NMI. */
  18. SAVE_REG(0)
  19. SAVE_REG(1)
  20. SAVE_REG(2)
  21. SAVE_REG(3)
  22. SAVE_REG(4)
  23. SAVE_REG(5)
  24. SAVE_REG(6)
  25. SAVE_REG(7)
  26. SAVE_REG(8)
  27. SAVE_REG(9)
  28. SAVE_REG(10)
  29. SAVE_REG(11)
  30. SAVE_REG(12)
  31. SAVE_REG(13)
  32. SAVE_REG(14)
  33. SAVE_REG(15)
  34. SAVE_REG(16)
  35. SAVE_REG(17)
  36. SAVE_REG(18)
  37. SAVE_REG(19)
  38. SAVE_REG(20)
  39. SAVE_REG(21)
  40. SAVE_REG(22)
  41. SAVE_REG(23)
  42. SAVE_REG(24)
  43. SAVE_REG(25)
  44. SAVE_REG(26)
  45. SAVE_REG(27)
  46. SAVE_REG(28)
  47. SAVE_REG(29)
  48. SAVE_REG(30)
  49. SAVE_REG(31)
  50. /* Set the stack to begin right below the registers */
  51. li sp, -32768+6912-32*8
  52. /* Load the address of the third stage handler */
  53. dla a0, octeon_wdt_nmi_stage3
  54. /* Call the third stage handler */
  55. jal a0
  56. /* a0 is the address of the saved registers */
  57. move a0, sp
  58. /* Loop forvever if we get here. */
  59. 1: b 1b
  60. nop
  61. .set pop
  62. END(octeon_wdt_nmi_stage2)