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