head.S 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * arch/alpha/kernel/head.S
  3. *
  4. * initial boot stuff.. At this point, the bootloader has already
  5. * switched into OSF/1 PAL-code, and loaded us at the correct address
  6. * (START_ADDR). So there isn't much left for us to do: just set up
  7. * the kernel global pointer and jump to the kernel entry-point.
  8. */
  9. #include <linux/init.h>
  10. #include <asm/asm-offsets.h>
  11. #include <asm/pal.h>
  12. #include <asm/setup.h>
  13. __HEAD
  14. .globl _stext
  15. .set noreorder
  16. .globl __start
  17. .ent __start
  18. _stext:
  19. __start:
  20. .prologue 0
  21. br $27,1f
  22. 1: ldgp $29,0($27)
  23. /* We need to get current_task_info loaded up... */
  24. lda $8,init_thread_union
  25. /* ... and find our stack ... */
  26. lda $30,0x4000 - SIZEOF_PT_REGS($8)
  27. /* ... and then we can start the kernel. */
  28. jsr $26,start_kernel
  29. call_pal PAL_halt
  30. .end __start
  31. #ifdef CONFIG_SMP
  32. .align 3
  33. .globl __smp_callin
  34. .ent __smp_callin
  35. /* On entry here from SRM console, the HWPCB of the per-cpu
  36. slot for this processor has been loaded. We've arranged
  37. for the UNIQUE value for this process to contain the PCBB
  38. of the target idle task. */
  39. __smp_callin:
  40. .prologue 1
  41. ldgp $29,0($27) # First order of business, load the GP.
  42. call_pal PAL_rduniq # Grab the target PCBB.
  43. mov $0,$16 # Install it.
  44. call_pal PAL_swpctx
  45. lda $8,0x3fff # Find "current".
  46. bic $30,$8,$8
  47. jsr $26,smp_callin
  48. call_pal PAL_halt
  49. .end __smp_callin
  50. #endif /* CONFIG_SMP */
  51. #
  52. # The following two functions are needed for supporting SRM PALcode
  53. # on the PC164 (at least), since that PALcode manages the interrupt
  54. # masking, and we cannot duplicate the effort without causing problems
  55. #
  56. .align 3
  57. .globl cserve_ena
  58. .ent cserve_ena
  59. cserve_ena:
  60. .prologue 0
  61. bis $16,$16,$17
  62. lda $16,52($31)
  63. call_pal PAL_cserve
  64. ret ($26)
  65. .end cserve_ena
  66. .align 3
  67. .globl cserve_dis
  68. .ent cserve_dis
  69. cserve_dis:
  70. .prologue 0
  71. bis $16,$16,$17
  72. lda $16,53($31)
  73. call_pal PAL_cserve
  74. ret ($26)
  75. .end cserve_dis
  76. #
  77. # It is handy, on occasion, to make halt actually just loop.
  78. # Putting it here means we dont have to recompile the whole
  79. # kernel.
  80. #
  81. .align 3
  82. .globl halt
  83. .ent halt
  84. halt:
  85. .prologue 0
  86. call_pal PAL_halt
  87. .end halt