head.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994, 1995 Waldorf Electronics
  7. * Written by Ralf Baechle and Andreas Busse
  8. * Copyright (C) 1995 - 1999 Ralf Baechle
  9. * Copyright (C) 1996 Paul M. Antoine
  10. * Modified for DECStation and hence R3000 support by Paul M. Antoine
  11. * Further modifications by David S. Miller and Harald Koerfgen
  12. * Copyright (C) 1999 Silicon Graphics, Inc.
  13. */
  14. #include <asm/asm.h>
  15. #include <asm/regdef.h>
  16. .set noreorder
  17. .cprestore
  18. LEAF(start)
  19. start:
  20. /* Save boot rom start args */
  21. move s0, a0
  22. move s1, a1
  23. move s2, a2
  24. move s3, a3
  25. /* Clear BSS */
  26. PTR_LA a0, _edata
  27. PTR_LA a2, _end
  28. 1: sw zero, 0(a0)
  29. bne a2, a0, 1b
  30. addiu a0, a0, 4
  31. PTR_LA a0, (.heap) /* heap address */
  32. PTR_LA sp, (.stack + 8192) /* stack address */
  33. PTR_LA ra, 2f
  34. PTR_LA k0, decompress_kernel
  35. jr k0
  36. nop
  37. 2:
  38. move a0, s0
  39. move a1, s1
  40. move a2, s2
  41. move a3, s3
  42. PTR_LI k0, KERNEL_ENTRY
  43. jr k0
  44. nop
  45. 3:
  46. b 3b
  47. nop
  48. END(start)
  49. .comm .heap,BOOT_HEAP_SIZE,4
  50. .comm .stack,4096*2,4