boot1_arch.h 836 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* Any assmbly language/system dependent hacks needed to setup boot1.c so it
  2. * will work as expected and cope with whatever platform specific wierdness is
  3. * needed for this architecture.
  4. */
  5. asm("" \
  6. " .text\n" \
  7. " .globl _dl_boot\n" \
  8. "_dl_boot:\n" \
  9. " .set noreorder\n" \
  10. " bltzal $0, 0f\n" \
  11. " nop\n" \
  12. "0: .cpload $31\n" \
  13. " .set reorder\n" \
  14. " la $4, _DYNAMIC\n" \
  15. " sw $4, -0x7ff0($28)\n" \
  16. " move $4, $29\n" \
  17. " la $8, coff\n" \
  18. " .set noreorder\n" \
  19. " bltzal $0, coff\n" \
  20. " nop\n" \
  21. "coff: subu $8, $31, $8\n" \
  22. " .set reorder\n" \
  23. " la $25, _dl_boot2\n" \
  24. " addu $25, $8\n" \
  25. " jalr $25\n" \
  26. " lw $4, 0($29)\n" \
  27. " la $5, 4($29)\n" \
  28. " sll $6, $4, 2\n" \
  29. " addu $6, $6, $5\n" \
  30. " addu $6, $6, 4\n" \
  31. " la $7, _dl_elf_main\n" \
  32. " lw $25, 0($7)\n" \
  33. " jr $25\n" \
  34. );