riscv32i-unknown-none-elf-m.s 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. .text
  2. .attribute 4, 16
  3. .attribute 5, "rv32i2p0"
  4. .file "zk0t2u2b1an050m"
  5. .section .init,"ax",@progbits
  6. .globl _start
  7. _start:
  8. lui ra, %hi(_abs_start)
  9. jalr zero, %lo(_abs_start)(ra)
  10. _abs_start:
  11. .cfi_startproc
  12. .cfi_undefined ra
  13. csrwi mie, 0
  14. csrwi mip, 0
  15. li ra, 0
  16. li sp, 0
  17. li gp, 0
  18. li tp, 0
  19. li t0, 0
  20. li t1, 0
  21. li t2, 0
  22. li s0, 0
  23. li s1, 0
  24. li a3, 0
  25. li a4, 0
  26. li a5, 0
  27. li a6, 0
  28. li a7, 0
  29. li s2, 0
  30. li s3, 0
  31. li s4, 0
  32. li s5, 0
  33. li s6, 0
  34. li s7, 0
  35. li s8, 0
  36. li s9, 0
  37. li s10, 0
  38. li s11, 0
  39. li t3, 0
  40. li t4, 0
  41. li t5, 0
  42. li t6, 0
  43. .option push
  44. .option norelax
  45. .Lpcrel_hi0:
  46. auipc gp, %pcrel_hi(__global_pointer$)
  47. addi gp, gp, %pcrel_lo(.Lpcrel_hi0)
  48. .option pop
  49. csrr t2, mhartid
  50. lui t0, %hi(_max_hart_id)
  51. addi t0, t0, %lo(_max_hart_id)
  52. bltu t0, t2, abort
  53. .Lpcrel_hi1:
  54. auipc sp, %pcrel_hi(_stack_start)
  55. addi sp, sp, %pcrel_lo(.Lpcrel_hi1)
  56. lui t0, %hi(_hart_stack_size)
  57. addi t0, t0, %lo(_hart_stack_size)
  58. beqz t2, .Ltmp0
  59. mv t1, t2
  60. mv t3, t0
  61. .Ltmp1:
  62. add t0, t0, t3
  63. addi t1, t1, -1
  64. bnez t1, .Ltmp1
  65. .Ltmp0:
  66. sub sp, sp, t0
  67. add s0, sp, zero
  68. j _start_rust
  69. .cfi_endproc
  70. .section .trap,"ax",@progbits
  71. .globl default_start_trap
  72. default_start_trap:
  73. addi sp, sp, -64
  74. sw ra, 0(sp)
  75. sw t0, 4(sp)
  76. sw t1, 8(sp)
  77. sw t2, 12(sp)
  78. sw t3, 16(sp)
  79. sw t4, 20(sp)
  80. sw t5, 24(sp)
  81. sw t6, 28(sp)
  82. sw a0, 32(sp)
  83. sw a1, 36(sp)
  84. sw a2, 40(sp)
  85. sw a3, 44(sp)
  86. sw a4, 48(sp)
  87. sw a5, 52(sp)
  88. sw a6, 56(sp)
  89. sw a7, 60(sp)
  90. mv a0, sp
  91. jal _start_trap_rust
  92. lw ra, 0(sp)
  93. lw t0, 4(sp)
  94. lw t1, 8(sp)
  95. lw t2, 12(sp)
  96. lw t3, 16(sp)
  97. lw t4, 20(sp)
  98. lw t5, 24(sp)
  99. lw t6, 28(sp)
  100. lw a0, 32(sp)
  101. lw a1, 36(sp)
  102. lw a2, 40(sp)
  103. lw a3, 44(sp)
  104. lw a4, 48(sp)
  105. lw a5, 52(sp)
  106. lw a6, 56(sp)
  107. lw a7, 60(sp)
  108. addi sp, sp, 64
  109. mret
  110. .section .text.abort,"ax",@progbits
  111. .globl abort
  112. abort:
  113. j abort