crt0.S 704 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * (C) Copyright 2007 Semihalf
  3. *
  4. * Written by: Rafal Jaworowski <raj@semihalf.com>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #if defined(CONFIG_PPC)
  9. .text
  10. .globl _start
  11. _start:
  12. lis %r11, search_hint@ha
  13. addi %r11, %r11, search_hint@l
  14. stw %r1, 0(%r11)
  15. b main
  16. .globl syscall
  17. syscall:
  18. lis %r11, syscall_ptr@ha
  19. addi %r11, %r11, syscall_ptr@l
  20. lwz %r11, 0(%r11)
  21. mtctr %r11
  22. bctr
  23. #elif defined(CONFIG_ARM)
  24. .text
  25. .globl _start
  26. _start:
  27. ldr ip, =search_hint
  28. str sp, [ip]
  29. b main
  30. .globl syscall
  31. syscall:
  32. ldr ip, =syscall_ptr
  33. ldr pc, [ip]
  34. #else
  35. #error No support for this arch!
  36. #endif
  37. .globl syscall_ptr
  38. syscall_ptr:
  39. .align 4
  40. .long 0
  41. .globl search_hint
  42. search_hint:
  43. .long 0