head.S 1.7 KB

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