head.S 1.8 KB

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