head.S 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /*
  2. * arch/alpha/boot/head.S
  3. *
  4. * initial bootloader stuff..
  5. */
  6. #include "pal.h"
  7. #include <config.h>
  8. .set noreorder
  9. .globl __start
  10. .ent __start
  11. __start:
  12. .prologue 0
  13. bis $31,$31,$31
  14. br 1f
  15. /* room for the initial PCB, which comes here */
  16. .quad 0,0,0,0,0,0,0,0
  17. 1: br $27,2f
  18. 2: ldgp $29,0($27)
  19. lda $27,main_
  20. jsr $26,($27),main_
  21. call_pal PAL_halt
  22. .end __start
  23. /* these must appear within first 512 bytes: */
  24. .align 3
  25. .quad ABOOT_MAGIC
  26. config_file_partition:
  27. .globl config_file_partition
  28. .quad CONFIG_FILE_PARTITION
  29. raw_initrd_size:
  30. .globl raw_initrd_size
  31. .quad 0
  32. .align 3
  33. .globl wrent
  34. .ent wrent
  35. wrent:
  36. .prologue 0
  37. call_pal PAL_wrent
  38. ret ($26)
  39. .end wrent
  40. .align 3
  41. .globl wrkgp
  42. .ent wrkgp
  43. wrkgp:
  44. .prologue 0
  45. call_pal PAL_wrkgp
  46. ret ($26)
  47. .end wrkgp
  48. .align 3
  49. .globl tbi
  50. .ent tbi
  51. tbi:
  52. .prologue 0
  53. call_pal PAL_tbi
  54. ret ($26)
  55. .end tbi
  56. .align 3
  57. .globl switch_to_osf_pal
  58. .ent switch_to_osf_pal
  59. switch_to_osf_pal:
  60. .prologue 0
  61. subq $30,128,$30
  62. stq $26,0($30)
  63. stq $1,8($30) # regs clobbered by swppal
  64. stq $2,16($30)
  65. stq $3,24($30)
  66. stq $4,32($30)
  67. stq $5,40($30)
  68. stq $6,48($30)
  69. stq $7,56($30)
  70. stq $8,64($30)
  71. stq $9,72($30)
  72. stq $10,80($30)
  73. stq $11,88($30)
  74. stq $12,96($30)
  75. stq $13,104($30)
  76. stq $14,112($30)
  77. stq $15,120($30)
  78. stq $30,0($17) /* save KSP in PCB (a1) */
  79. bis $30,$30,$20 /* a4 = KSP */
  80. br $17,__do_swppal
  81. ldq $26,0($30)
  82. ldq $1,8($30)
  83. ldq $2,16($30)
  84. ldq $3,24($30)
  85. ldq $4,32($30)
  86. ldq $5,40($30)
  87. ldq $6,48($30)
  88. ldq $7,56($30)
  89. ldq $8,64($30)
  90. ldq $9,72($30)
  91. ldq $10,80($30)
  92. ldq $11,88($30)
  93. ldq $12,96($30)
  94. ldq $13,104($30)
  95. ldq $14,112($30)
  96. ldq $15,120($30)
  97. addq $30,128,$30
  98. ret ($26)
  99. __do_swppal:
  100. call_pal PAL_swppal
  101. .end switch_to_osf_pal
  102. .align 3
  103. .globl dispatch
  104. .ent dispatch
  105. dispatch:
  106. .prologue 0
  107. subq $30,80,$30
  108. stq $26,0($30)
  109. stq $29,8($30)
  110. stq $8,16($30) /* OpenVMS save regs */
  111. stq $9,24($30)
  112. stq $10,32($30)
  113. stq $11,40($30)
  114. stq $12,48($30)
  115. stq $13,56($30)
  116. stq $14,64($30)
  117. stq $15,72($30)
  118. lda $1,0x10000000 /* hwrpb */
  119. ldq $2,0xc0($1) /* crb offset */
  120. addq $2,$1,$2 /* crb */
  121. ldq $27,0($2) /* dispatch procedure value */
  122. ldq $2,8($27) /* dispatch call address */
  123. jsr $26,($2) /* call it (weird VMS call seq) */
  124. ldq $26,0($30)
  125. ldq $29,8($30)
  126. ldq $8,16($30)
  127. ldq $9,24($30)
  128. ldq $10,32($30)
  129. ldq $11,40($30)
  130. ldq $12,48($30)
  131. ldq $13,56($30)
  132. ldq $14,64($30)
  133. ldq $15,72($30)
  134. addq $30,80,$30
  135. ret $31,($26)
  136. .end dispatch
  137. .align 3
  138. .globl halt
  139. .ent halt
  140. halt:
  141. .prologue 0
  142. call_pal PAL_halt
  143. .end halt
  144. .ent run_kernel
  145. .globl run_kernel
  146. run_kernel:
  147. .prologue 0
  148. mov $16,$27
  149. mov $17,$30
  150. jmp $31,($27)
  151. .end run_kernel