entry_gcc.S 1000 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #include <rtconfig.h>
  15. .section ".start", "ax"
  16. .set noreorder
  17. /* the program entry */
  18. .globl _rtthread_entry
  19. _rtthread_entry:
  20. #ifndef RT_USING_SELF_BOOT
  21. .globl _start
  22. _start:
  23. #endif
  24. la ra, _rtthread_entry
  25. /* disable interrupt */
  26. mtc0 zero, CP0_CAUSE
  27. mtc0 zero, CP0_STATUS # Set CPU to disable interrupt.
  28. ehb
  29. /* setup stack pointer */
  30. la sp, _system_stack
  31. la gp, _gp
  32. bal rt_cpu_early_init
  33. nop
  34. /* clear bss */
  35. la t0, __bss_start
  36. la t1, __bss_end
  37. _clr_bss_loop:
  38. sw zero, 0(t0)
  39. bne t0, t1, _clr_bss_loop
  40. addiu t0, t0, 4
  41. /* jump to RT-Thread RTOS */
  42. jal rtthread_startup
  43. nop
  44. /* restart, never die */
  45. j _start
  46. nop