sun3-head.S
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:3k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. #include <linux/linkage.h>
  2. #include <asm/page.h>
  3. #include <asm/contregs.h>
  4. #include <asm/sun3-head.h>
  5. PSL_HIGHIPL     = 0x2700
  6. NBSG            = 0x20000
  7. ICACHE_ONLY = 0x00000009
  8. CACHES_OFF = 0x00000008 | actually a clear and disable --m
  9. #define MAS_STACK INT_STACK 
  10. ROOT_TABLE_SIZE = 128
  11. PAGESIZE = 8192
  12. SUN3_INVALID_PMEG = 255
  13. .globl SYMBOL_NAME(bootup_user_stack)
  14. .globl SYMBOL_NAME(bootup_kernel_stack)
  15. .globl SYMBOL_NAME(pg0)
  16. .globl SYMBOL_NAME(empty_bad_page)
  17. .globl SYMBOL_NAME(empty_bad_page_table)
  18. .globl SYMBOL_NAME(empty_zero_page)
  19. .globl SYMBOL_NAME(swapper_pg_dir)
  20. .globl SYMBOL_NAME(kernel_pmd_table)
  21. .globl SYMBOL_NAME(availmem)
  22. .global SYMBOL_NAME(m68k_pgtable_cachemode)
  23. .global SYMBOL_NAME(kpt)
  24. | todo: all these should be in bss!
  25. SYMBOL_NAME(swapper_pg_dir):                .skip 0x2000
  26. SYMBOL_NAME(pg0):                           .skip 0x2000
  27. SYMBOL_NAME(empty_bad_page):                .skip 0x2000
  28. SYMBOL_NAME(empty_bad_page_table):          .skip 0x2000
  29. SYMBOL_NAME(kernel_pmd_table):              .skip 0x2000
  30. SYMBOL_NAME(empty_zero_page):               .skip 0x2000
  31. .globl SYMBOL_NAME(kernel_pg_dir)
  32. .equ    SYMBOL_NAME(kernel_pg_dir),SYMBOL_NAME(kernel_pmd_table)
  33. .section .head
  34. ENTRY(_stext)
  35. ENTRY(_start)
  36. /* Firstly, disable interrupts and set up function codes. */
  37. movew #PSL_HIGHIPL, %sr
  38. moveq #FC_CONTROL, %d0
  39. movec %d0, %sfc
  40. movec %d0, %dfc
  41. /* Make sure we're in context zero. */
  42. moveq #0, %d0
  43. movsb %d0, AC_CONTEXT
  44. /* map everything the bootloader left us into high memory, clean up the
  45.    excess later */
  46. lea (AC_SEGMAP+0),%a0 
  47. lea (AC_SEGMAP+KERNBASE),%a1
  48. 1:
  49. movsb %a0@, %d1
  50. movsb %d1, %a1@
  51. cmpib #SUN3_INVALID_PMEG, %d1
  52. beq 2f
  53. addl #NBSG,%a0
  54. addl #NBSG,%a1
  55. jmp 1b
  56. 2:
  57. /* Disable caches and jump to high code. */
  58. moveq #ICACHE_ONLY,%d0 | Cache disabled until we're ready to enable it
  59. movc %d0, %cacr |   is this the right value? (yes --m)
  60. jmp 1f:l
  61. /* Following code executes at high addresses (0xE000xxx). */
  62. 1: lea SYMBOL_NAME(init_task_union),%a2 | get initial thread...
  63. lea %a2@(KTHREAD_SIZE),%sp | ...and its stack.
  64. /* copy bootinfo records from the loader to _end */
  65. lea SYMBOL_NAME(_end), %a1
  66. lea BI_START, %a0
  67. /* number of longs to copy */
  68. movel %a0@, %d0
  69. 1: addl #4, %a0
  70. movel   %a0@, %a1@
  71. addl #4, %a1
  72. dbf %d0, 1b
  73. /* Point MSP at an invalid page to trap if it's used. --m */
  74. movl #(PAGESIZE),%d0
  75. movc %d0,%msp
  76. moveq #-1,%d0
  77. movsb %d0,(AC_SEGMAP+0x0)
  78. jbsr SYMBOL_NAME(sun3_init)
  79. jbsr SYMBOL_NAME(base_trap_init)
  80.         jbsr    SYMBOL_NAME(start_kernel)
  81. trap #15
  82.         .data
  83.         .even
  84. SYMBOL_NAME_LABEL(kpt)
  85.         .long 0
  86. SYMBOL_NAME_LABEL(availmem)
  87.         .long 0
  88. | todo: remove next two. --m
  89. SYMBOL_NAME_LABEL(is_medusa)
  90.         .long 0
  91. SYMBOL_NAME_LABEL(m68k_pgtable_cachemode)
  92.         .long 0