head.S 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * arch/alpha/boot/head.S
  3. *
  4. * initial bootloader stuff..
  5. */
  6. #include <asm/pal.h>
  7. .set noreorder
  8. .globl __start
  9. .ent __start
  10. __start:
  11. br $29,2f
  12. 2: ldgp $29,0($29)
  13. jsr $26,start_kernel
  14. call_pal PAL_halt
  15. .end __start
  16. .align 5
  17. .globl wrent
  18. .ent wrent
  19. wrent:
  20. .prologue 0
  21. call_pal PAL_wrent
  22. ret ($26)
  23. .end wrent
  24. .align 5
  25. .globl wrkgp
  26. .ent wrkgp
  27. wrkgp:
  28. .prologue 0
  29. call_pal PAL_wrkgp
  30. ret ($26)
  31. .end wrkgp
  32. .align 5
  33. .globl switch_to_osf_pal
  34. .ent switch_to_osf_pal
  35. switch_to_osf_pal:
  36. subq $30,128,$30
  37. .frame $30,128,$26
  38. stq $26,0($30)
  39. stq $1,8($30)
  40. stq $2,16($30)
  41. stq $3,24($30)
  42. stq $4,32($30)
  43. stq $5,40($30)
  44. stq $6,48($30)
  45. stq $7,56($30)
  46. stq $8,64($30)
  47. stq $9,72($30)
  48. stq $10,80($30)
  49. stq $11,88($30)
  50. stq $12,96($30)
  51. stq $13,104($30)
  52. stq $14,112($30)
  53. stq $15,120($30)
  54. .prologue 0
  55. stq $30,0($17) /* save KSP in PCB */
  56. bis $30,$30,$20 /* a4 = KSP */
  57. br $17,1f
  58. ldq $26,0($30)
  59. ldq $1,8($30)
  60. ldq $2,16($30)
  61. ldq $3,24($30)
  62. ldq $4,32($30)
  63. ldq $5,40($30)
  64. ldq $6,48($30)
  65. ldq $7,56($30)
  66. ldq $8,64($30)
  67. ldq $9,72($30)
  68. ldq $10,80($30)
  69. ldq $11,88($30)
  70. ldq $12,96($30)
  71. ldq $13,104($30)
  72. ldq $14,112($30)
  73. ldq $15,120($30)
  74. addq $30,128,$30
  75. ret ($26)
  76. 1: call_pal PAL_swppal
  77. .end switch_to_osf_pal
  78. .align 3
  79. .globl tbi
  80. .ent tbi
  81. tbi:
  82. .prologue 0
  83. call_pal PAL_tbi
  84. ret ($26)
  85. .end tbi
  86. .align 3
  87. .globl halt
  88. .ent halt
  89. halt:
  90. .prologue 0
  91. call_pal PAL_halt
  92. .end halt
  93. /* $16 - new stack page */
  94. .align 3
  95. .globl move_stack
  96. .ent move_stack
  97. move_stack:
  98. .prologue 0
  99. lda $0, 0x1fff($31)
  100. and $0, $30, $1 /* Stack offset */
  101. or $1, $16, $16 /* New stack pointer */
  102. mov $30, $1
  103. mov $16, $2
  104. 1: ldq $3, 0($1) /* Move the stack */
  105. addq $1, 8, $1
  106. stq $3, 0($2)
  107. and $0, $1, $4
  108. addq $2, 8, $2
  109. bne $4, 1b
  110. mov $16, $30
  111. ret ($26)
  112. .end move_stack