Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * arch/alpha/boot/head.S
0004  *
0005  * initial bootloader stuff..
0006  */
0007 
0008 #include <asm/pal.h>
0009 
0010     .set noreorder
0011     .globl  __start
0012     .ent    __start
0013 __start:
0014     br  $29,2f
0015 2:  ldgp    $29,0($29)
0016     jsr $26,start_kernel
0017     call_pal PAL_halt
0018     .end __start
0019 
0020     .align 5
0021     .globl  wrent
0022     .ent    wrent
0023 wrent:
0024     .prologue 0
0025     call_pal PAL_wrent
0026     ret ($26)
0027     .end wrent
0028 
0029     .align 5
0030     .globl  wrkgp
0031     .ent    wrkgp
0032 wrkgp:
0033     .prologue 0
0034     call_pal PAL_wrkgp
0035     ret ($26)
0036     .end wrkgp
0037 
0038     .align 5
0039     .globl  switch_to_osf_pal
0040     .ent    switch_to_osf_pal
0041 switch_to_osf_pal:
0042     subq    $30,128,$30
0043     .frame  $30,128,$26
0044     stq $26,0($30)
0045     stq $1,8($30)
0046     stq $2,16($30)
0047     stq $3,24($30)
0048     stq $4,32($30)
0049     stq $5,40($30)
0050     stq $6,48($30)
0051     stq $7,56($30)
0052     stq $8,64($30)
0053     stq $9,72($30)
0054     stq $10,80($30)
0055     stq $11,88($30)
0056     stq $12,96($30)
0057     stq $13,104($30)
0058     stq $14,112($30)
0059     stq $15,120($30)
0060     .prologue 0
0061 
0062     stq $30,0($17)  /* save KSP in PCB */
0063 
0064     bis $30,$30,$20 /* a4 = KSP */
0065     br  $17,1f
0066 
0067     ldq $26,0($30)
0068     ldq $1,8($30)
0069     ldq $2,16($30)
0070     ldq $3,24($30)
0071     ldq $4,32($30)
0072     ldq $5,40($30)
0073     ldq $6,48($30)
0074     ldq $7,56($30)
0075     ldq $8,64($30)
0076     ldq $9,72($30)
0077     ldq $10,80($30)
0078     ldq $11,88($30)
0079     ldq $12,96($30)
0080     ldq $13,104($30)
0081     ldq $14,112($30)
0082     ldq $15,120($30)
0083     addq    $30,128,$30
0084     ret ($26)
0085 1:  call_pal PAL_swppal
0086     .end    switch_to_osf_pal
0087 
0088     .align 3
0089     .globl  tbi
0090     .ent    tbi
0091 tbi:
0092     .prologue 0
0093     call_pal PAL_tbi
0094     ret ($26)
0095     .end tbi
0096 
0097     .align 3
0098     .globl  halt
0099     .ent    halt
0100 halt:
0101     .prologue 0
0102     call_pal PAL_halt
0103     .end halt
0104 
0105 /* $16 - new stack page */
0106     .align 3
0107     .globl  move_stack
0108     .ent    move_stack
0109 move_stack:
0110     .prologue 0
0111     lda $0, 0x1fff($31)
0112     and $0, $30, $1         /* Stack offset */
0113     or  $1, $16, $16            /* New stack pointer */
0114     mov $30, $1
0115     mov $16, $2
0116 1:  ldq $3, 0($1)           /* Move the stack */
0117     addq    $1, 8, $1
0118     stq $3, 0($2)
0119     and $0, $1, $4
0120     addq    $2, 8, $2
0121     bne $4, 1b
0122     mov $16, $30
0123     ret ($26)
0124     .end move_stack