exception_gcc.S 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) 2006-2019, 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. */
  10. #ifndef __ASSEMBLY__
  11. #define __ASSEMBLY__
  12. #endif
  13. #include <mips.h>
  14. .section ".exc_vectors", "ax"
  15. .extern tlb_refill_handler
  16. .extern cache_error_handler
  17. .extern mips_irq_handle
  18. /* 0x0 - TLB refill handler */
  19. .global tlb_refill_exception
  20. .type tlb_refill_exception,@function
  21. ebase_start:
  22. tlb_refill_exception:
  23. b _general_exception_handler
  24. nop
  25. /* 0x100 - Cache error handler */
  26. .org ebase_start + 0x100
  27. j cache_error_handler
  28. nop
  29. /* 0x180 - Exception/Interrupt handler */
  30. .global general_exception
  31. .type general_exception,@function
  32. .org ebase_start + 0x180
  33. general_exception:
  34. b _general_exception_handler
  35. nop
  36. /* 0x200 - Special Exception Interrupt handler (when IV is set in CP0_CAUSE) */
  37. .global irq_exception
  38. .type irq_exception,@function
  39. .org ebase_start + 0x200
  40. irq_exception:
  41. b _general_exception_handler
  42. nop
  43. /* general exception handler */
  44. _general_exception_handler:
  45. .set noreorder
  46. PTR_LA k0, mips_irq_handle
  47. jr k0
  48. nop
  49. .set reorder
  50. /* interrupt handler */
  51. _irq_handler:
  52. .set noreorder
  53. PTR_LA k0, mips_irq_handle
  54. jr k0
  55. nop
  56. .set reorder