interrupts_64.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * (C) Copyright 2013
  3. * David Feng <fenghua@phytium.com.cn>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <linux/compiler.h>
  9. int interrupt_init(void)
  10. {
  11. return 0;
  12. }
  13. void enable_interrupts(void)
  14. {
  15. return;
  16. }
  17. int disable_interrupts(void)
  18. {
  19. return 0;
  20. }
  21. void show_regs(struct pt_regs *regs)
  22. {
  23. int i;
  24. printf("ELR: %lx\n", regs->elr);
  25. printf("LR: %lx\n", regs->regs[30]);
  26. for (i = 0; i < 29; i += 2)
  27. printf("x%-2d: %016lx x%-2d: %016lx\n",
  28. i, regs->regs[i], i+1, regs->regs[i+1]);
  29. printf("\n");
  30. }
  31. /*
  32. * do_bad_sync handles the impossible case in the Synchronous Abort vector.
  33. */
  34. void do_bad_sync(struct pt_regs *pt_regs, unsigned int esr)
  35. {
  36. printf("Bad mode in \"Synchronous Abort\" handler, esr 0x%08x\n", esr);
  37. show_regs(pt_regs);
  38. panic("Resetting CPU ...\n");
  39. }
  40. /*
  41. * do_bad_irq handles the impossible case in the Irq vector.
  42. */
  43. void do_bad_irq(struct pt_regs *pt_regs, unsigned int esr)
  44. {
  45. printf("Bad mode in \"Irq\" handler, esr 0x%08x\n", esr);
  46. show_regs(pt_regs);
  47. panic("Resetting CPU ...\n");
  48. }
  49. /*
  50. * do_bad_fiq handles the impossible case in the Fiq vector.
  51. */
  52. void do_bad_fiq(struct pt_regs *pt_regs, unsigned int esr)
  53. {
  54. printf("Bad mode in \"Fiq\" handler, esr 0x%08x\n", esr);
  55. show_regs(pt_regs);
  56. panic("Resetting CPU ...\n");
  57. }
  58. /*
  59. * do_bad_error handles the impossible case in the Error vector.
  60. */
  61. void do_bad_error(struct pt_regs *pt_regs, unsigned int esr)
  62. {
  63. printf("Bad mode in \"Error\" handler, esr 0x%08x\n", esr);
  64. show_regs(pt_regs);
  65. panic("Resetting CPU ...\n");
  66. }
  67. /*
  68. * do_sync handles the Synchronous Abort exception.
  69. */
  70. void do_sync(struct pt_regs *pt_regs, unsigned int esr)
  71. {
  72. printf("\"Synchronous Abort\" handler, esr 0x%08x\n", esr);
  73. show_regs(pt_regs);
  74. panic("Resetting CPU ...\n");
  75. }
  76. /*
  77. * do_irq handles the Irq exception.
  78. */
  79. void do_irq(struct pt_regs *pt_regs, unsigned int esr)
  80. {
  81. printf("\"Irq\" handler, esr 0x%08x\n", esr);
  82. show_regs(pt_regs);
  83. panic("Resetting CPU ...\n");
  84. }
  85. /*
  86. * do_fiq handles the Fiq exception.
  87. */
  88. void do_fiq(struct pt_regs *pt_regs, unsigned int esr)
  89. {
  90. printf("\"Fiq\" handler, esr 0x%08x\n", esr);
  91. show_regs(pt_regs);
  92. panic("Resetting CPU ...\n");
  93. }
  94. /*
  95. * do_error handles the Error exception.
  96. * Errors are more likely to be processor specific,
  97. * it is defined with weak attribute and can be redefined
  98. * in processor specific code.
  99. */
  100. void __weak do_error(struct pt_regs *pt_regs, unsigned int esr)
  101. {
  102. printf("\"Error\" handler, esr 0x%08x\n", esr);
  103. show_regs(pt_regs);
  104. panic("Resetting CPU ...\n");
  105. }