2
0

head.S 771 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "sys.h"
  2. #include "picorv32.h"
  3. // The linker ensures that section .init is first
  4. .section ".init.reset","ax"
  5. .globl _reset
  6. _reset:
  7. rdtime t0 // Record timer at reset
  8. li sp,STACK_TOP // Cheaper than using la sp,___stack_top
  9. .option push
  10. .option norelax // Can't make gp references to set up gp...
  11. la gp, __global_pointer$
  12. .option pop
  13. sw t0, time_zero, t1
  14. j _start
  15. .type _reset, @function
  16. .size _reset, . - _reset
  17. .pushsection ".sdata","a"
  18. .balign 4
  19. .globl time_zero
  20. time_zero:
  21. .long 0
  22. .type time_zero, @object
  23. .size time_zero, . - time_zero
  24. .popsection
  25. .section ".stack","aw",@nobits
  26. .balign 4
  27. .globl ___stack_bottom
  28. ___stack:
  29. .space STACK_SIZE
  30. .type ___stack, @object
  31. .size ___stack, STACK_SIZE
  32. .globl ___stack_top
  33. ___stack_top: