crt0.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * uC-libc/sysdeps/linux/powerpc/crt0.S
  3. * process init code for powerpc
  4. *
  5. * Copyright (C) 2001 by Lineo, Inc.
  6. * Author: David A. Schleef <ds@schleef.org>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU Library General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
  16. * for more details.
  17. *
  18. * You should have received a copy of the GNU Library General Public License
  19. * along with this program; if not, write to the Free Software Foundation,
  20. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. /*
  24. _start is called with the following registers initialized:
  25. r1 null stack frame
  26. r3 argc
  27. r4 argv
  28. r5 envp
  29. r6 auxiliary vector. ignored.
  30. r7 function pointer to jump to when main() exits. If
  31. this is non-zero, it should be registered with atexit().
  32. Linux always (?) sets r7 to NULL, so it is not implemented
  33. here.
  34. */
  35. .text
  36. .global _start
  37. .global __uClibc_main
  38. .type _start,%function
  39. .type __uClibc_main,%function
  40. _start:
  41. /* create 2 empty stack frames */
  42. stwu 1,-32(1)
  43. lwz 3,32(1)
  44. addi 4,1,36
  45. addi 5,1,40
  46. rlwinm 0,3,2,0,29
  47. add 5,5,0
  48. bl __uClibc_main