head.S 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* $Id: head.S,v 1.7 2003/09/01 17:58:19 lethal Exp $
  2. *
  3. * arch/sh/kernel/head.S
  4. *
  5. * Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima
  6. *
  7. * This file is subject to the terms and conditions of the GNU General Public
  8. * License. See the file "COPYING" in the main directory of this archive
  9. * for more details.
  10. *
  11. * Head.S contains the SH exception handlers and startup code.
  12. */
  13. #include <linux/linkage.h>
  14. .section .empty_zero_page, "aw"
  15. ENTRY(empty_zero_page)
  16. .long 1 /* MOUNT_ROOT_RDONLY */
  17. .long 0 /* RAMDISK_FLAGS */
  18. .long 0x0200 /* ORIG_ROOT_DEV */
  19. .long 1 /* LOADER_TYPE */
  20. .long 0x00360000 /* INITRD_START */
  21. .long 0x000a0000 /* INITRD_SIZE */
  22. .long 0
  23. .balign 4096,0,4096
  24. .text
  25. /*
  26. * Condition at the entry of _stext:
  27. *
  28. * BSC has already been initialized.
  29. * INTC may or may not be initialized.
  30. * VBR may or may not be initialized.
  31. * MMU may or may not be initialized.
  32. * Cache may or may not be initialized.
  33. * Hardware (including on-chip modules) may or may not be initialized.
  34. *
  35. */
  36. ENTRY(_stext)
  37. ! Initialize Status Register
  38. mov.l 1f, r0 ! MD=1, RB=0, BL=0, IMASK=0xF
  39. ldc r0, sr
  40. ! Initialize global interrupt mask
  41. mov #0, r0
  42. ldc r0, r6_bank
  43. !
  44. mov.l 2f, r0
  45. mov r0, r15 ! Set initial r15 (stack pointer)
  46. mov #0x20, r1 !
  47. shll8 r1 ! r1 = 8192
  48. sub r1, r0 !
  49. ldc r0, r7_bank ! ... and initial thread_info
  50. !
  51. ! Additional CPU initialization
  52. mov.l 6f, r0
  53. jsr @r0
  54. nop
  55. ! Clear BSS area
  56. mov.l 3f, r1
  57. add #4, r1
  58. mov.l 4f, r2
  59. mov #0, r0
  60. 9: cmp/hs r2, r1
  61. bf/s 9b ! while (r1 < r2)
  62. mov.l r0,@-r2
  63. ! Start kernel
  64. mov.l 5f, r0
  65. jmp @r0
  66. nop
  67. .balign 4
  68. 1: .long 0x400080F0 ! MD=1, RB=0, BL=0, FD=1, IMASK=0xF
  69. 2: .long stack
  70. 3: .long __bss_start
  71. 4: .long _end
  72. 5: .long start_kernel
  73. 6: .long sh_cpu_init