exception_gcc.S 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2019-12-04 Jiaxun Yang Initial version
  9. * 2020-07-26 lizhirui Add xtlb exception entry
  10. */
  11. #ifndef __ASSEMBLY__
  12. #define __ASSEMBLY__
  13. #endif
  14. #include <mips.h>
  15. .section ".exc_vectors", "ax"
  16. .extern tlb_refill_handler
  17. .extern cache_error_handler
  18. .extern mips_irq_handle
  19. /* 0x0 - TLB refill handler */
  20. .global tlb_refill_exception
  21. .type tlb_refill_exception,@function
  22. ebase_start:
  23. tlb_refill_exception:
  24. b _general_exception_handler
  25. nop
  26. /* 0x080 - XTLB refill handler */
  27. .org ebase_start + 0x080
  28. b _general_exception_handler
  29. nop
  30. /* 0x100 - Cache error handler */
  31. .org ebase_start + 0x100
  32. j cache_error_handler
  33. nop
  34. /* 0x180 - Exception/Interrupt handler */
  35. .global general_exception
  36. .type general_exception,@function
  37. .org ebase_start + 0x180
  38. general_exception:
  39. b _general_exception_handler
  40. nop
  41. /* 0x200 - Special Exception Interrupt handler (when IV is set in CP0_CAUSE) */
  42. .global irq_exception
  43. .type irq_exception,@function
  44. .org ebase_start + 0x200
  45. irq_exception:
  46. b _general_exception_handler
  47. nop
  48. /* general exception handler */
  49. _general_exception_handler:
  50. .set noreorder
  51. PTR_LA k0, mips_irq_handle
  52. jr k0
  53. nop
  54. .set reorder
  55. /* interrupt handler */
  56. _irq_handler:
  57. .set noreorder
  58. PTR_LA k0, mips_irq_handle
  59. jr k0
  60. nop
  61. .set reorder