~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arc/kernel/entry.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/arc/kernel/entry.S (Version linux-6.12-rc7) and /arch/alpha/kernel/entry.S (Version linux-4.14.336)


  1 /* SPDX-License-Identifier: GPL-2.0-only */    !!   1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*                                                  2 /*
  3  * Common Low Level Interrupts/Traps/Exception !!   3  * arch/alpha/kernel/entry.S
  4  * (included from entry-<isa>.S                << 
  5  *                                                  4  *
  6  * Copyright (C) 2014-15 Synopsys, Inc. (www.s !!   5  * Kernel entry-points.
  7  * Copyright (C) 2004, 2007-2010, 2011-2012 Sy << 
  8  */                                                 6  */
  9                                                     7 
 10 /*-------------------------------------------- !!   8 #include <asm/asm-offsets.h>
 11  *    Function                            ABI  !!   9 #include <asm/thread_info.h>
 12  *-------------------------------------------- !!  10 #include <asm/pal.h>
                                                   >>  11 #include <asm/errno.h>
                                                   >>  12 #include <asm/unistd.h>
                                                   >>  13 
                                                   >>  14         .text
                                                   >>  15         .set noat
                                                   >>  16         .cfi_sections   .debug_frame
                                                   >>  17 
                                                   >>  18 /* Stack offsets.  */
                                                   >>  19 #define SP_OFF                  184
                                                   >>  20 #define SWITCH_STACK_SIZE       320
                                                   >>  21 
                                                   >>  22 .macro  CFI_START_OSF_FRAME     func
                                                   >>  23         .align  4
                                                   >>  24         .globl  \func
                                                   >>  25         .type   \func,@function
                                                   >>  26 \func:
                                                   >>  27         .cfi_startproc simple
                                                   >>  28         .cfi_return_column 64
                                                   >>  29         .cfi_def_cfa    $sp, 48
                                                   >>  30         .cfi_rel_offset 64, 8
                                                   >>  31         .cfi_rel_offset $gp, 16
                                                   >>  32         .cfi_rel_offset $16, 24
                                                   >>  33         .cfi_rel_offset $17, 32
                                                   >>  34         .cfi_rel_offset $18, 40
                                                   >>  35 .endm
                                                   >>  36 
                                                   >>  37 .macro  CFI_END_OSF_FRAME       func
                                                   >>  38         .cfi_endproc
                                                   >>  39         .size   \func, . - \func
                                                   >>  40 .endm
                                                   >>  41 
                                                   >>  42 /*
                                                   >>  43  * This defines the normal kernel pt-regs layout.
 13  *                                                 44  *
 14  *  Arguments                           r0 - r !!  45  * regs 9-15 preserved by C code
 15  *  Caller Saved Registers              r0 - r !!  46  * regs 16-18 saved by PAL-code
 16  *  Callee Saved Registers              r13- r !!  47  * regs 29-30 saved and set up by PAL-code
 17  *  Global Pointer (gp)                 r26    !!  48  * JRP - Save regs 16-18 in a special area of the stack, so that
 18  *  Frame Pointer (fp)                  r27    !!  49  * the palcode-provided values are available to the signal handler.
 19  *  Stack Pointer (sp)                  r28    << 
 20  *  Branch link register (blink)        r31    << 
 21  *-------------------------------------------- << 
 22  */                                                50  */
 23                                                    51 
 24 ;################### Special Sys Call Wrappers !!  52 .macro  SAVE_ALL
 25                                                !!  53         subq    $sp, SP_OFF, $sp
 26 ENTRY(sys_clone_wrapper)                       !!  54         .cfi_adjust_cfa_offset  SP_OFF
 27         SAVE_CALLEE_SAVED_USER                 !!  55         stq     $0, 0($sp)
 28         bl  @sys_clone                         !!  56         stq     $1, 8($sp)
 29         DISCARD_CALLEE_SAVED_USER              !!  57         stq     $2, 16($sp)
 30                                                !!  58         stq     $3, 24($sp)
 31         GET_CURR_THR_INFO_FLAGS   r10          !!  59         stq     $4, 32($sp)
 32         and.f 0, r10, _TIF_SYSCALL_WORK        !!  60         stq     $28, 144($sp)
 33         bnz   tracesys_exit                    !!  61         .cfi_rel_offset $0, 0
 34                                                !!  62         .cfi_rel_offset $1, 8
 35         b .Lret_from_system_call               !!  63         .cfi_rel_offset $2, 16
 36 END(sys_clone_wrapper)                         !!  64         .cfi_rel_offset $3, 24
 37                                                !!  65         .cfi_rel_offset $4, 32
 38 ENTRY(sys_clone3_wrapper)                      !!  66         .cfi_rel_offset $28, 144
 39         SAVE_CALLEE_SAVED_USER                 !!  67         lda     $2, alpha_mv
 40         bl  @sys_clone3                        !!  68         stq     $5, 40($sp)
 41         DISCARD_CALLEE_SAVED_USER              !!  69         stq     $6, 48($sp)
 42                                                !!  70         stq     $7, 56($sp)
 43         GET_CURR_THR_INFO_FLAGS   r10          !!  71         stq     $8, 64($sp)
 44         and.f 0, r10, _TIF_SYSCALL_WORK        !!  72         stq     $19, 72($sp)
 45         bnz   tracesys_exit                    !!  73         stq     $20, 80($sp)
 46                                                !!  74         stq     $21, 88($sp)
 47         b .Lret_from_system_call               !!  75         ldq     $2, HAE_CACHE($2)
 48 END(sys_clone3_wrapper)                        !!  76         stq     $22, 96($sp)
 49                                                !!  77         stq     $23, 104($sp)
 50 ENTRY(ret_from_fork)                           !!  78         stq     $24, 112($sp)
 51         ; when the forked child comes here fro !!  79         stq     $25, 120($sp)
 52         ; r0 has the last task pointer.        !!  80         stq     $26, 128($sp)
 53         ; put last task in scheduler queue     !!  81         stq     $27, 136($sp)
 54         jl   @schedule_tail                    !!  82         stq     $2, 152($sp)
 55                                                !!  83         stq     $16, 160($sp)
 56         ld   r9, [sp, PT_status32]             !!  84         stq     $17, 168($sp)
 57         brne r9, 0, 1f                         !!  85         stq     $18, 176($sp)
 58                                                !!  86         .cfi_rel_offset $5, 40
 59         jl.d [r14]              ; kernel threa !!  87         .cfi_rel_offset $6, 48
 60         mov  r0, r13            ; (see PF_KTHR !!  88         .cfi_rel_offset $7, 56
 61                                                !!  89         .cfi_rel_offset $8, 64
 62 1:                                             !!  90         .cfi_rel_offset $19, 72
 63         ; Return to user space                 !!  91         .cfi_rel_offset $20, 80
 64         ; 1. Any forked task (Reach here via B !!  92         .cfi_rel_offset $21, 88
 65         ; 2. First ever init task (Reach here  !!  93         .cfi_rel_offset $22, 96
 66         ;    This is the historic "kernel_exec !!  94         .cfi_rel_offset $23, 104
 67         ;    user mode, in a round about way s !!  95         .cfi_rel_offset $24, 112
 68         ;    a kernel thread which is executed !!  96         .cfi_rel_offset $25, 120
 69         ;    out whenever kernel_execve (now i !!  97         .cfi_rel_offset $26, 128
 70         b    ret_from_exception                !!  98         .cfi_rel_offset $27, 136
 71 END(ret_from_fork)                             !!  99 .endm
 72                                                !! 100 
 73 ;################### Non TLB Exception Handlin !! 101 .macro  RESTORE_ALL
 74                                                !! 102         lda     $19, alpha_mv
 75 ; -------------------------------------------- !! 103         ldq     $0, 0($sp)
 76 ; Instruction Error Exception Handler          !! 104         ldq     $1, 8($sp)
 77 ; -------------------------------------------- !! 105         ldq     $2, 16($sp)
 78                                                !! 106         ldq     $3, 24($sp)
 79 ENTRY(instr_service)                           !! 107         ldq     $21, 152($sp)
 80                                                !! 108         ldq     $20, HAE_CACHE($19)
 81         EXCEPTION_PROLOGUE                     !! 109         ldq     $4, 32($sp)
 82                                                !! 110         ldq     $5, 40($sp)
 83         bl  do_insterror_or_kprobe             !! 111         ldq     $6, 48($sp)
 84         b   ret_from_exception                 !! 112         ldq     $7, 56($sp)
 85 END(instr_service)                             !! 113         subq    $20, $21, $20
 86                                                !! 114         ldq     $8, 64($sp)
 87 ; -------------------------------------------- !! 115         beq     $20, 99f
 88 ; Machine Check Exception Handler              !! 116         ldq     $20, HAE_REG($19)
 89 ; -------------------------------------------- !! 117         stq     $21, HAE_CACHE($19)
 90                                                !! 118         stq     $21, 0($20)
 91 ENTRY(EV_MachineCheck)                         !! 119 99:     ldq     $19, 72($sp)
 92                                                !! 120         ldq     $20, 80($sp)
 93         EXCEPTION_PROLOGUE_KEEP_AE      ; ECR  !! 121         ldq     $21, 88($sp)
 94                                                !! 122         ldq     $22, 96($sp)
 95         lr  r0, [efa]                          !! 123         ldq     $23, 104($sp)
 96         mov r1, sp                             !! 124         ldq     $24, 112($sp)
 97                                                !! 125         ldq     $25, 120($sp)
 98         ; MC exceptions disable MMU            !! 126         ldq     $26, 128($sp)
 99         ARC_MMU_REENABLE r3                    !! 127         ldq     $27, 136($sp)
100                                                !! 128         ldq     $28, 144($sp)
101         lsr     r3, r10, 8                     !! 129         addq    $sp, SP_OFF, $sp
102         bmsk    r3, r3, 7                      !! 130         .cfi_restore    $0
103         brne    r3, ECR_C_MCHK_DUP_TLB, 1f     !! 131         .cfi_restore    $1
104                                                !! 132         .cfi_restore    $2
105         bl      do_tlb_overlap_fault           !! 133         .cfi_restore    $3
106         b       ret_from_exception             !! 134         .cfi_restore    $4
107                                                !! 135         .cfi_restore    $5
108 1:                                             !! 136         .cfi_restore    $6
109         ; DEAD END: can't do much, display Reg !! 137         .cfi_restore    $7
110         SAVE_CALLEE_SAVED_USER                 !! 138         .cfi_restore    $8
111                                                !! 139         .cfi_restore    $19
112         GET_CURR_TASK_FIELD_PTR   TASK_THREAD, !! 140         .cfi_restore    $20
113         st  sp, [r10, THREAD_CALLEE_REG]       !! 141         .cfi_restore    $21
114                                                !! 142         .cfi_restore    $22
115         j  do_machine_check_fault              !! 143         .cfi_restore    $23
116                                                !! 144         .cfi_restore    $24
117 END(EV_MachineCheck)                           !! 145         .cfi_restore    $25
118                                                !! 146         .cfi_restore    $26
119 ; -------------------------------------------- !! 147         .cfi_restore    $27
120 ; Privilege Violation Exception Handler        !! 148         .cfi_restore    $28
121 ; -------------------------------------------- !! 149         .cfi_adjust_cfa_offset  -SP_OFF
122 ENTRY(EV_PrivilegeV)                           !! 150 .endm
123                                                !! 151 
124         EXCEPTION_PROLOGUE                     !! 152 .macro  DO_SWITCH_STACK
125                                                !! 153         bsr     $1, do_switch_stack
126         bl  do_privilege_fault                 !! 154         .cfi_adjust_cfa_offset  SWITCH_STACK_SIZE
127         b   ret_from_exception                 !! 155         .cfi_rel_offset $9, 0
128 END(EV_PrivilegeV)                             !! 156         .cfi_rel_offset $10, 8
129                                                !! 157         .cfi_rel_offset $11, 16
130 ; -------------------------------------------- !! 158         .cfi_rel_offset $12, 24
131 ; Extension Instruction Exception Handler      !! 159         .cfi_rel_offset $13, 32
132 ; -------------------------------------------- !! 160         .cfi_rel_offset $14, 40
133 ENTRY(EV_Extension)                            !! 161         .cfi_rel_offset $15, 48
134                                                !! 162         /* We don't really care about the FP registers for debugging.  */
135         EXCEPTION_PROLOGUE                     !! 163 .endm
136                                                !! 164 
137         bl  do_extension_fault                 !! 165 .macro  UNDO_SWITCH_STACK
138         b   ret_from_exception                 !! 166         bsr     $1, undo_switch_stack
139 END(EV_Extension)                              !! 167         .cfi_restore    $9
140                                                !! 168         .cfi_restore    $10
141 ;################ Trap Handling (Syscall, Brea !! 169         .cfi_restore    $11
142                                                !! 170         .cfi_restore    $12
143 ; -------------------------------------------- !! 171         .cfi_restore    $13
144 ; syscall Tracing                              !! 172         .cfi_restore    $14
145 ; -------------------------------------------- !! 173         .cfi_restore    $15
146 tracesys:                                      !! 174         .cfi_adjust_cfa_offset  -SWITCH_STACK_SIZE
147         ; safekeep EFA (r12) if syscall tracer !! 175 .endm
148         ; for traps, ERET is pre-commit so poi << 
149         GET_CURR_TASK_FIELD_PTR   TASK_THREAD, << 
150         st  r12, [r11, THREAD_FAULT_ADDR]      << 
151                                                << 
152         ; PRE syscall trace hook               << 
153         mov r0, sp                             << 
154         bl  @syscall_trace_enter               << 
155                                                << 
156         ; Tracing code now returns the syscall << 
157         mov r8, r0                             << 
158                                                << 
159         ; Do the Sys Call as we normally would << 
160         cmp     r8,  NR_syscalls - 1           << 
161         mov.hi  r0, -ENOSYS                    << 
162         bhi     tracesys_exit                  << 
163                                                << 
164         ; Restore the sys-call args. Mere invo << 
165         ; clobbered them (since they are in sc << 
166         ; have deliberately changed the syscal << 
167         ld  r0, [sp, PT_r0]                    << 
168         ld  r1, [sp, PT_r1]                    << 
169         ld  r2, [sp, PT_r2]                    << 
170         ld  r3, [sp, PT_r3]                    << 
171         ld  r4, [sp, PT_r4]                    << 
172         ld  r5, [sp, PT_r5]                    << 
173         ld  r6, [sp, PT_r6]                    << 
174         ld  r7, [sp, PT_r7]                    << 
175         ld.as   r9, [sys_call_table, r8]       << 
176         jl      [r9]                           << 
177                                                << 
178 tracesys_exit:                                 << 
179         st  r0, [sp, PT_r0]                    << 
180                                                << 
181         ; POST syscall trace hook              << 
182         mov r0, sp              ; pt_regs need << 
183         bl  @syscall_trace_exit                << 
184                                                << 
185         ; don't call ret_from_system_call as i << 
186         b   ret_from_exception                 << 
187                                                << 
188 ; -------------------------------------------- << 
189 ; Breakpoint TRAP                              << 
190 ; -------------------------------------------- << 
191 trap_with_param:                               << 
192         mov r0, r12     ; EFA in case ptracer/ << 
193         mov r1, sp      ; pt_regs              << 
194                                                << 
195         ; save callee regs in case tracer/gdb  << 
196         SAVE_CALLEE_SAVED_USER                 << 
197                                                << 
198         ; safekeep ref to callee regs          << 
199         GET_CURR_TASK_FIELD_PTR   TASK_THREAD, << 
200         st  sp, [r10, THREAD_CALLEE_REG]       << 
201                                                << 
202         ; call the non syscall trap handler    << 
203         bl  do_non_swi_trap                    << 
204                                                << 
205         ; unwind stack to discard callee regs  << 
206         DISCARD_CALLEE_SAVED_USER              << 
207                                                << 
208         b   ret_from_exception                 << 
209                                                   176 
210 ; -------------------------------------------- !! 177 /*
211 ; syscall TRAP                                 !! 178  * Non-syscall kernel entry points.
212 ; ABI: (r0-r7) up to 8 args, (r8) syscall numb !! 179  */
213 ; -------------------------------------------- << 
214                                                << 
215 ENTRY(EV_Trap)                                 << 
216                                                << 
217         EXCEPTION_PROLOGUE_KEEP_AE             << 
218                                                << 
219         lr  r12, [efa]                         << 
220                                                << 
221         FAKE_RET_FROM_EXCPN                    << 
222                                                << 
223         ;============ TRAP N : breakpoints, kp << 
224         bmsk.f 0, r10, 7                       << 
225         bnz    trap_with_param                 << 
226                                                << 
227         ;============ TRAP 0 (no param): sysca << 
228                                                << 
229         ; syscall tracing ongoing, invoke pre- << 
230         GET_CURR_THR_INFO_FLAGS   r10          << 
231         and.f 0, r10, _TIF_SYSCALL_WORK        << 
232         bnz   tracesys  ; this never comes bac << 
233                                                << 
234         ;============ Normal syscall case      << 
235                                                << 
236         cmp     r8,  NR_syscalls - 1           << 
237         mov.hi  r0, -ENOSYS                    << 
238         bhi     .Lret_from_system_call         << 
239                                                << 
240         ld.as   r9,[sys_call_table, r8]        << 
241         jl      [r9]                           << 
242                                                << 
243 .Lret_from_system_call:                        << 
244         st  r0, [sp, PT_r0]     ; sys call ret << 
245                                                << 
246         ; fall through to ret_from_exception   << 
247 END(EV_Trap)                                   << 
248                                                << 
249 ;############# Return from Intr/Excp/Trap (Lin << 
250 ;                                              << 
251 ; If ret to user mode do we need to handle sig << 
252                                                << 
253 ENTRY(ret_from_exception)                      << 
254                                                << 
255         ; Pre-{IRQ,Trap,Exception} K/U mode fr << 
256         ld  r8, [sp, PT_status32]   ; returnin << 
257                                                << 
258         bbit0  r8, STATUS_U_BIT, resume_kernel << 
259                                                << 
260         ; Before returning to User mode check- << 
261         ; such as rescheduling/signal-delivery << 
262 resume_user_mode_begin:                        << 
263                                                << 
264         ; Disable IRQs to ensures that chk for << 
265         ; (and we don't end up missing a NEED_ << 
266         ; interim IRQ).                        << 
267         IRQ_DISABLE     r10                    << 
268                                                << 
269         ; Fast Path return to user mode if no  << 
270         GET_CURR_THR_INFO_FLAGS   r9           << 
271         and.f  0,  r9, _TIF_WORK_MASK          << 
272         bz     .Lrestore_regs                  << 
273                                                << 
274         ; --- (Slow Path #1) task preemption - << 
275         bbit0  r9, TIF_NEED_RESCHED, .Lchk_pen << 
276         mov    blink, resume_user_mode_begin   << 
277         j      @schedule        ; BTST+Bnz cau << 
278                                                << 
279 .Lchk_pend_signals:                            << 
280         IRQ_ENABLE      r10                    << 
281                                                << 
282         ; --- (Slow Path #2) pending signal  - << 
283         mov r0, sp      ; pt_regs for arg to d << 
284                                                << 
285         GET_CURR_THR_INFO_FLAGS   r9           << 
286         and.f  0,  r9, _TIF_SIGPENDING|_TIF_NO << 
287         bz .Lchk_notify_resume                 << 
288                                                << 
289         ; Normal Trap/IRQ entry only saves Scr << 
290         ; in pt_reg since the "C" ABI (kernel  << 
291         ; save/restore callee-saved regs.      << 
292         ;                                      << 
293         ; However, here we need to explicitly  << 
294         ; (i)  If this signal causes coredump  << 
295         ; (ii) If signal is SIGTRAP/SIGSTOP, t << 
296         ;      tracer might call PEEKUSR(CALLE << 
297         ;                                      << 
298         ; NOTE: SP will grow up by size of CAL << 
299         SAVE_CALLEE_SAVED_USER                 << 
300                                                << 
301         ; save location of saved Callee Regs @ << 
302         GET_CURR_TASK_FIELD_PTR   TASK_THREAD, << 
303         st  sp, [r10, THREAD_CALLEE_REG]       << 
304                                                << 
305         bl  @do_signal                         << 
306                                                   180 
307         ; Ideally we want to discard the Calle !! 181 CFI_START_OSF_FRAME entInt
308         ; a tracing signal, tracer could have  !! 182         SAVE_ALL
309         RESTORE_CALLEE_SAVED_USER              !! 183         lda     $8, 0x3fff
                                                   >> 184         lda     $26, ret_from_sys_call
                                                   >> 185         bic     $sp, $8, $8
                                                   >> 186         mov     $sp, $19
                                                   >> 187         jsr     $31, do_entInt
                                                   >> 188 CFI_END_OSF_FRAME entInt
                                                   >> 189 
                                                   >> 190 CFI_START_OSF_FRAME entArith
                                                   >> 191         SAVE_ALL
                                                   >> 192         lda     $8, 0x3fff
                                                   >> 193         lda     $26, ret_from_sys_call
                                                   >> 194         bic     $sp, $8, $8
                                                   >> 195         mov     $sp, $18
                                                   >> 196         jsr     $31, do_entArith
                                                   >> 197 CFI_END_OSF_FRAME entArith
                                                   >> 198 
                                                   >> 199 CFI_START_OSF_FRAME entMM
                                                   >> 200         SAVE_ALL
                                                   >> 201 /* save $9 - $15 so the inline exception code can manipulate them.  */
                                                   >> 202         subq    $sp, 56, $sp
                                                   >> 203         .cfi_adjust_cfa_offset  56
                                                   >> 204         stq     $9, 0($sp)
                                                   >> 205         stq     $10, 8($sp)
                                                   >> 206         stq     $11, 16($sp)
                                                   >> 207         stq     $12, 24($sp)
                                                   >> 208         stq     $13, 32($sp)
                                                   >> 209         stq     $14, 40($sp)
                                                   >> 210         stq     $15, 48($sp)
                                                   >> 211         .cfi_rel_offset $9, 0
                                                   >> 212         .cfi_rel_offset $10, 8
                                                   >> 213         .cfi_rel_offset $11, 16
                                                   >> 214         .cfi_rel_offset $12, 24
                                                   >> 215         .cfi_rel_offset $13, 32
                                                   >> 216         .cfi_rel_offset $14, 40
                                                   >> 217         .cfi_rel_offset $15, 48
                                                   >> 218         addq    $sp, 56, $19
                                                   >> 219 /* handle the fault */
                                                   >> 220         lda     $8, 0x3fff
                                                   >> 221         bic     $sp, $8, $8
                                                   >> 222         jsr     $26, do_page_fault
                                                   >> 223 /* reload the registers after the exception code played.  */
                                                   >> 224         ldq     $9, 0($sp)
                                                   >> 225         ldq     $10, 8($sp)
                                                   >> 226         ldq     $11, 16($sp)
                                                   >> 227         ldq     $12, 24($sp)
                                                   >> 228         ldq     $13, 32($sp)
                                                   >> 229         ldq     $14, 40($sp)
                                                   >> 230         ldq     $15, 48($sp)
                                                   >> 231         addq    $sp, 56, $sp
                                                   >> 232         .cfi_restore    $9
                                                   >> 233         .cfi_restore    $10
                                                   >> 234         .cfi_restore    $11
                                                   >> 235         .cfi_restore    $12
                                                   >> 236         .cfi_restore    $13
                                                   >> 237         .cfi_restore    $14
                                                   >> 238         .cfi_restore    $15
                                                   >> 239         .cfi_adjust_cfa_offset  -56
                                                   >> 240 /* finish up the syscall as normal.  */
                                                   >> 241         br      ret_from_sys_call
                                                   >> 242 CFI_END_OSF_FRAME entMM
                                                   >> 243 
                                                   >> 244 CFI_START_OSF_FRAME entIF
                                                   >> 245         SAVE_ALL
                                                   >> 246         lda     $8, 0x3fff
                                                   >> 247         lda     $26, ret_from_sys_call
                                                   >> 248         bic     $sp, $8, $8
                                                   >> 249         mov     $sp, $17
                                                   >> 250         jsr     $31, do_entIF
                                                   >> 251 CFI_END_OSF_FRAME entIF
                                                   >> 252 
                                                   >> 253 CFI_START_OSF_FRAME entUna
                                                   >> 254         lda     $sp, -256($sp)
                                                   >> 255         .cfi_adjust_cfa_offset  256
                                                   >> 256         stq     $0, 0($sp)
                                                   >> 257         .cfi_rel_offset $0, 0
                                                   >> 258         .cfi_remember_state
                                                   >> 259         ldq     $0, 256($sp)    /* get PS */
                                                   >> 260         stq     $1, 8($sp)
                                                   >> 261         stq     $2, 16($sp)
                                                   >> 262         stq     $3, 24($sp)
                                                   >> 263         and     $0, 8, $0               /* user mode? */
                                                   >> 264         stq     $4, 32($sp)
                                                   >> 265         bne     $0, entUnaUser  /* yup -> do user-level unaligned fault */
                                                   >> 266         stq     $5, 40($sp)
                                                   >> 267         stq     $6, 48($sp)
                                                   >> 268         stq     $7, 56($sp)
                                                   >> 269         stq     $8, 64($sp)
                                                   >> 270         stq     $9, 72($sp)
                                                   >> 271         stq     $10, 80($sp)
                                                   >> 272         stq     $11, 88($sp)
                                                   >> 273         stq     $12, 96($sp)
                                                   >> 274         stq     $13, 104($sp)
                                                   >> 275         stq     $14, 112($sp)
                                                   >> 276         stq     $15, 120($sp)
                                                   >> 277         /* 16-18 PAL-saved */
                                                   >> 278         stq     $19, 152($sp)
                                                   >> 279         stq     $20, 160($sp)
                                                   >> 280         stq     $21, 168($sp)
                                                   >> 281         stq     $22, 176($sp)
                                                   >> 282         stq     $23, 184($sp)
                                                   >> 283         stq     $24, 192($sp)
                                                   >> 284         stq     $25, 200($sp)
                                                   >> 285         stq     $26, 208($sp)
                                                   >> 286         stq     $27, 216($sp)
                                                   >> 287         stq     $28, 224($sp)
                                                   >> 288         mov     $sp, $19
                                                   >> 289         stq     $gp, 232($sp)
                                                   >> 290         .cfi_rel_offset $1, 1*8
                                                   >> 291         .cfi_rel_offset $2, 2*8
                                                   >> 292         .cfi_rel_offset $3, 3*8
                                                   >> 293         .cfi_rel_offset $4, 4*8
                                                   >> 294         .cfi_rel_offset $5, 5*8
                                                   >> 295         .cfi_rel_offset $6, 6*8
                                                   >> 296         .cfi_rel_offset $7, 7*8
                                                   >> 297         .cfi_rel_offset $8, 8*8
                                                   >> 298         .cfi_rel_offset $9, 9*8
                                                   >> 299         .cfi_rel_offset $10, 10*8
                                                   >> 300         .cfi_rel_offset $11, 11*8
                                                   >> 301         .cfi_rel_offset $12, 12*8
                                                   >> 302         .cfi_rel_offset $13, 13*8
                                                   >> 303         .cfi_rel_offset $14, 14*8
                                                   >> 304         .cfi_rel_offset $15, 15*8
                                                   >> 305         .cfi_rel_offset $19, 19*8
                                                   >> 306         .cfi_rel_offset $20, 20*8
                                                   >> 307         .cfi_rel_offset $21, 21*8
                                                   >> 308         .cfi_rel_offset $22, 22*8
                                                   >> 309         .cfi_rel_offset $23, 23*8
                                                   >> 310         .cfi_rel_offset $24, 24*8
                                                   >> 311         .cfi_rel_offset $25, 25*8
                                                   >> 312         .cfi_rel_offset $26, 26*8
                                                   >> 313         .cfi_rel_offset $27, 27*8
                                                   >> 314         .cfi_rel_offset $28, 28*8
                                                   >> 315         .cfi_rel_offset $29, 29*8
                                                   >> 316         lda     $8, 0x3fff
                                                   >> 317         stq     $31, 248($sp)
                                                   >> 318         bic     $sp, $8, $8
                                                   >> 319         jsr     $26, do_entUna
                                                   >> 320         ldq     $0, 0($sp)
                                                   >> 321         ldq     $1, 8($sp)
                                                   >> 322         ldq     $2, 16($sp)
                                                   >> 323         ldq     $3, 24($sp)
                                                   >> 324         ldq     $4, 32($sp)
                                                   >> 325         ldq     $5, 40($sp)
                                                   >> 326         ldq     $6, 48($sp)
                                                   >> 327         ldq     $7, 56($sp)
                                                   >> 328         ldq     $8, 64($sp)
                                                   >> 329         ldq     $9, 72($sp)
                                                   >> 330         ldq     $10, 80($sp)
                                                   >> 331         ldq     $11, 88($sp)
                                                   >> 332         ldq     $12, 96($sp)
                                                   >> 333         ldq     $13, 104($sp)
                                                   >> 334         ldq     $14, 112($sp)
                                                   >> 335         ldq     $15, 120($sp)
                                                   >> 336         /* 16-18 PAL-saved */
                                                   >> 337         ldq     $19, 152($sp)
                                                   >> 338         ldq     $20, 160($sp)
                                                   >> 339         ldq     $21, 168($sp)
                                                   >> 340         ldq     $22, 176($sp)
                                                   >> 341         ldq     $23, 184($sp)
                                                   >> 342         ldq     $24, 192($sp)
                                                   >> 343         ldq     $25, 200($sp)
                                                   >> 344         ldq     $26, 208($sp)
                                                   >> 345         ldq     $27, 216($sp)
                                                   >> 346         ldq     $28, 224($sp)
                                                   >> 347         ldq     $gp, 232($sp)
                                                   >> 348         lda     $sp, 256($sp)
                                                   >> 349         .cfi_restore    $1
                                                   >> 350         .cfi_restore    $2
                                                   >> 351         .cfi_restore    $3
                                                   >> 352         .cfi_restore    $4
                                                   >> 353         .cfi_restore    $5
                                                   >> 354         .cfi_restore    $6
                                                   >> 355         .cfi_restore    $7
                                                   >> 356         .cfi_restore    $8
                                                   >> 357         .cfi_restore    $9
                                                   >> 358         .cfi_restore    $10
                                                   >> 359         .cfi_restore    $11
                                                   >> 360         .cfi_restore    $12
                                                   >> 361         .cfi_restore    $13
                                                   >> 362         .cfi_restore    $14
                                                   >> 363         .cfi_restore    $15
                                                   >> 364         .cfi_restore    $19
                                                   >> 365         .cfi_restore    $20
                                                   >> 366         .cfi_restore    $21
                                                   >> 367         .cfi_restore    $22
                                                   >> 368         .cfi_restore    $23
                                                   >> 369         .cfi_restore    $24
                                                   >> 370         .cfi_restore    $25
                                                   >> 371         .cfi_restore    $26
                                                   >> 372         .cfi_restore    $27
                                                   >> 373         .cfi_restore    $28
                                                   >> 374         .cfi_restore    $29
                                                   >> 375         .cfi_adjust_cfa_offset  -256
                                                   >> 376         call_pal PAL_rti
                                                   >> 377 
                                                   >> 378         .align  4
                                                   >> 379 entUnaUser:
                                                   >> 380         .cfi_restore_state
                                                   >> 381         ldq     $0, 0($sp)      /* restore original $0 */
                                                   >> 382         lda     $sp, 256($sp)   /* pop entUna's stack frame */
                                                   >> 383         .cfi_restore    $0
                                                   >> 384         .cfi_adjust_cfa_offset  -256
                                                   >> 385         SAVE_ALL                /* setup normal kernel stack */
                                                   >> 386         lda     $sp, -56($sp)
                                                   >> 387         .cfi_adjust_cfa_offset  56
                                                   >> 388         stq     $9, 0($sp)
                                                   >> 389         stq     $10, 8($sp)
                                                   >> 390         stq     $11, 16($sp)
                                                   >> 391         stq     $12, 24($sp)
                                                   >> 392         stq     $13, 32($sp)
                                                   >> 393         stq     $14, 40($sp)
                                                   >> 394         stq     $15, 48($sp)
                                                   >> 395         .cfi_rel_offset $9, 0
                                                   >> 396         .cfi_rel_offset $10, 8
                                                   >> 397         .cfi_rel_offset $11, 16
                                                   >> 398         .cfi_rel_offset $12, 24
                                                   >> 399         .cfi_rel_offset $13, 32
                                                   >> 400         .cfi_rel_offset $14, 40
                                                   >> 401         .cfi_rel_offset $15, 48
                                                   >> 402         lda     $8, 0x3fff
                                                   >> 403         addq    $sp, 56, $19
                                                   >> 404         bic     $sp, $8, $8
                                                   >> 405         jsr     $26, do_entUnaUser
                                                   >> 406         ldq     $9, 0($sp)
                                                   >> 407         ldq     $10, 8($sp)
                                                   >> 408         ldq     $11, 16($sp)
                                                   >> 409         ldq     $12, 24($sp)
                                                   >> 410         ldq     $13, 32($sp)
                                                   >> 411         ldq     $14, 40($sp)
                                                   >> 412         ldq     $15, 48($sp)
                                                   >> 413         lda     $sp, 56($sp)
                                                   >> 414         .cfi_restore    $9
                                                   >> 415         .cfi_restore    $10
                                                   >> 416         .cfi_restore    $11
                                                   >> 417         .cfi_restore    $12
                                                   >> 418         .cfi_restore    $13
                                                   >> 419         .cfi_restore    $14
                                                   >> 420         .cfi_restore    $15
                                                   >> 421         .cfi_adjust_cfa_offset  -56
                                                   >> 422         br      ret_from_sys_call
                                                   >> 423 CFI_END_OSF_FRAME entUna
                                                   >> 424 
                                                   >> 425 CFI_START_OSF_FRAME entDbg
                                                   >> 426         SAVE_ALL
                                                   >> 427         lda     $8, 0x3fff
                                                   >> 428         lda     $26, ret_from_sys_call
                                                   >> 429         bic     $sp, $8, $8
                                                   >> 430         mov     $sp, $16
                                                   >> 431         jsr     $31, do_entDbg
                                                   >> 432 CFI_END_OSF_FRAME entDbg
                                                   >> 433 
                                                   >> 434 /*
                                                   >> 435  * The system call entry point is special.  Most importantly, it looks
                                                   >> 436  * like a function call to userspace as far as clobbered registers.  We
                                                   >> 437  * do preserve the argument registers (for syscall restarts) and $26
                                                   >> 438  * (for leaf syscall functions).
                                                   >> 439  *
                                                   >> 440  * So much for theory.  We don't take advantage of this yet.
                                                   >> 441  *
                                                   >> 442  * Note that a0-a2 are not saved by PALcode as with the other entry points.
                                                   >> 443  */
310                                                   444 
311         b      resume_user_mode_begin   ; loop !! 445         .align  4
                                                   >> 446         .globl  entSys
                                                   >> 447         .type   entSys, @function
                                                   >> 448         .cfi_startproc simple
                                                   >> 449         .cfi_return_column 64
                                                   >> 450         .cfi_def_cfa    $sp, 48
                                                   >> 451         .cfi_rel_offset 64, 8
                                                   >> 452         .cfi_rel_offset $gp, 16
                                                   >> 453 entSys:
                                                   >> 454         SAVE_ALL
                                                   >> 455         lda     $8, 0x3fff
                                                   >> 456         bic     $sp, $8, $8
                                                   >> 457         lda     $4, NR_SYSCALLS($31)
                                                   >> 458         stq     $16, SP_OFF+24($sp)
                                                   >> 459         lda     $5, sys_call_table
                                                   >> 460         lda     $27, sys_ni_syscall
                                                   >> 461         cmpult  $0, $4, $4
                                                   >> 462         ldl     $3, TI_FLAGS($8)
                                                   >> 463         stq     $17, SP_OFF+32($sp)
                                                   >> 464         s8addq  $0, $5, $5
                                                   >> 465         stq     $18, SP_OFF+40($sp)
                                                   >> 466         .cfi_rel_offset $16, SP_OFF+24
                                                   >> 467         .cfi_rel_offset $17, SP_OFF+32
                                                   >> 468         .cfi_rel_offset $18, SP_OFF+40
                                                   >> 469 #ifdef CONFIG_AUDITSYSCALL
                                                   >> 470         lda     $6, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
                                                   >> 471         and     $3, $6, $3
                                                   >> 472         bne     $3, strace
                                                   >> 473 #else
                                                   >> 474         blbs    $3, strace              /* check for SYSCALL_TRACE in disguise */
                                                   >> 475 #endif
                                                   >> 476         beq     $4, 1f
                                                   >> 477         ldq     $27, 0($5)
                                                   >> 478 1:      jsr     $26, ($27), alpha_ni_syscall
                                                   >> 479         ldgp    $gp, 0($26)
                                                   >> 480         blt     $0, $syscall_error      /* the call failed */
                                                   >> 481         stq     $0, 0($sp)
                                                   >> 482         stq     $31, 72($sp)            /* a3=0 => no error */
                                                   >> 483 
                                                   >> 484         .align  4
                                                   >> 485         .globl  ret_from_sys_call
                                                   >> 486 ret_from_sys_call:
                                                   >> 487         cmovne  $26, 0, $18             /* $18 = 0 => non-restartable */
                                                   >> 488         ldq     $0, SP_OFF($sp)
                                                   >> 489         and     $0, 8, $0
                                                   >> 490         beq     $0, ret_to_kernel
                                                   >> 491 ret_to_user:
                                                   >> 492         /* Make sure need_resched and sigpending don't change between
                                                   >> 493                 sampling and the rti.  */
                                                   >> 494         lda     $16, 7
                                                   >> 495         call_pal PAL_swpipl
                                                   >> 496         ldl     $17, TI_FLAGS($8)
                                                   >> 497         and     $17, _TIF_WORK_MASK, $2
                                                   >> 498         bne     $2, work_pending
                                                   >> 499 restore_all:
                                                   >> 500         .cfi_remember_state
                                                   >> 501         RESTORE_ALL
                                                   >> 502         call_pal PAL_rti
                                                   >> 503 
                                                   >> 504 ret_to_kernel:
                                                   >> 505         .cfi_restore_state
                                                   >> 506         lda     $16, 7
                                                   >> 507         call_pal PAL_swpipl
                                                   >> 508         br restore_all
                                                   >> 509 
                                                   >> 510         .align 3
                                                   >> 511 $syscall_error:
                                                   >> 512         /*
                                                   >> 513          * Some system calls (e.g., ptrace) can return arbitrary
                                                   >> 514          * values which might normally be mistaken as error numbers.
                                                   >> 515          * Those functions must zero $0 (v0) directly in the stack
                                                   >> 516          * frame to indicate that a negative return value wasn't an
                                                   >> 517          * error number..
                                                   >> 518          */
                                                   >> 519         ldq     $18, 0($sp)     /* old syscall nr (zero if success) */
                                                   >> 520         beq     $18, $ret_success
                                                   >> 521 
                                                   >> 522         ldq     $19, 72($sp)    /* .. and this a3 */
                                                   >> 523         subq    $31, $0, $0     /* with error in v0 */
                                                   >> 524         addq    $31, 1, $1      /* set a3 for errno return */
                                                   >> 525         stq     $0, 0($sp)
                                                   >> 526         mov     $31, $26        /* tell "ret_from_sys_call" we can restart */
                                                   >> 527         stq     $1, 72($sp)     /* a3 for return */
                                                   >> 528         br      ret_from_sys_call
                                                   >> 529 
                                                   >> 530 $ret_success:
                                                   >> 531         stq     $0, 0($sp)
                                                   >> 532         stq     $31, 72($sp)    /* a3=0 => no error */
                                                   >> 533         br      ret_from_sys_call
312                                                   534 
313         ; --- (Slow Path #3) notify_resume --- !! 535 /*
314 .Lchk_notify_resume:                           !! 536  * Do all cleanup when returning from all interrupts and system calls.
315         btst   r9, TIF_NOTIFY_RESUME           !! 537  *
316         blnz   @do_notify_resume               !! 538  * Arguments:
317         b      resume_user_mode_begin   ; unco !! 539  *       $8: current.
318                                         ; for  !! 540  *      $17: TI_FLAGS.
                                                   >> 541  *      $18: The old syscall number, or zero if this is not a return
                                                   >> 542  *           from a syscall that errored and is possibly restartable.
                                                   >> 543  *      $19: The old a3 value
                                                   >> 544  */
319                                                   545 
320 resume_kernel_mode:                            !! 546         .align  4
                                                   >> 547         .type   work_pending, @function
                                                   >> 548 work_pending:
                                                   >> 549         and     $17, _TIF_NOTIFY_RESUME | _TIF_SIGPENDING, $2
                                                   >> 550         bne     $2, $work_notifysig
                                                   >> 551 
                                                   >> 552 $work_resched:
                                                   >> 553         /*
                                                   >> 554          * We can get here only if we returned from syscall without SIGPENDING
                                                   >> 555          * or got through work_notifysig already.  Either case means no syscall
                                                   >> 556          * restarts for us, so let $18 and $19 burn.
                                                   >> 557          */
                                                   >> 558         jsr     $26, schedule
                                                   >> 559         mov     0, $18
                                                   >> 560         br      ret_to_user
                                                   >> 561 
                                                   >> 562 $work_notifysig:
                                                   >> 563         mov     $sp, $16
                                                   >> 564         DO_SWITCH_STACK
                                                   >> 565         jsr     $26, do_work_pending
                                                   >> 566         UNDO_SWITCH_STACK
                                                   >> 567         br      restore_all
321                                                   568 
322         ; Disable Interrupts from this point o !! 569 /*
323         ; CONFIG_PREEMPTION: This is a must fo !! 570  * PTRACE syscall handler
324         ; !CONFIG_PREEMPTION: To ensure restor !! 571  */
325         IRQ_DISABLE     r9                     << 
326                                                   572 
327 #ifdef CONFIG_PREEMPTION                       !! 573         .align  4
                                                   >> 574         .type   strace, @function
                                                   >> 575 strace:
                                                   >> 576         /* set up signal stack, call syscall_trace */
                                                   >> 577         DO_SWITCH_STACK
                                                   >> 578         jsr     $26, syscall_trace_enter /* returns the syscall number */
                                                   >> 579         UNDO_SWITCH_STACK
                                                   >> 580 
                                                   >> 581         /* get the arguments back.. */
                                                   >> 582         ldq     $16, SP_OFF+24($sp)
                                                   >> 583         ldq     $17, SP_OFF+32($sp)
                                                   >> 584         ldq     $18, SP_OFF+40($sp)
                                                   >> 585         ldq     $19, 72($sp)
                                                   >> 586         ldq     $20, 80($sp)
                                                   >> 587         ldq     $21, 88($sp)
                                                   >> 588 
                                                   >> 589         /* get the system call pointer.. */
                                                   >> 590         lda     $1, NR_SYSCALLS($31)
                                                   >> 591         lda     $2, sys_call_table
                                                   >> 592         lda     $27, alpha_ni_syscall
                                                   >> 593         cmpult  $0, $1, $1
                                                   >> 594         s8addq  $0, $2, $2
                                                   >> 595         beq     $1, 1f
                                                   >> 596         ldq     $27, 0($2)
                                                   >> 597 1:      jsr     $26, ($27), sys_gettimeofday
                                                   >> 598 ret_from_straced:
                                                   >> 599         ldgp    $gp, 0($26)
                                                   >> 600 
                                                   >> 601         /* check return.. */
                                                   >> 602         blt     $0, $strace_error       /* the call failed */
                                                   >> 603         stq     $31, 72($sp)            /* a3=0 => no error */
                                                   >> 604 $strace_success:
                                                   >> 605         stq     $0, 0($sp)              /* save return value */
                                                   >> 606 
                                                   >> 607         DO_SWITCH_STACK
                                                   >> 608         jsr     $26, syscall_trace_leave
                                                   >> 609         UNDO_SWITCH_STACK
                                                   >> 610         br      $31, ret_from_sys_call
                                                   >> 611 
                                                   >> 612         .align  3
                                                   >> 613 $strace_error:
                                                   >> 614         ldq     $18, 0($sp)     /* old syscall nr (zero if success) */
                                                   >> 615         beq     $18, $strace_success
                                                   >> 616         ldq     $19, 72($sp)    /* .. and this a3 */
                                                   >> 617 
                                                   >> 618         subq    $31, $0, $0     /* with error in v0 */
                                                   >> 619         addq    $31, 1, $1      /* set a3 for errno return */
                                                   >> 620         stq     $0, 0($sp)
                                                   >> 621         stq     $1, 72($sp)     /* a3 for return */
                                                   >> 622 
                                                   >> 623         DO_SWITCH_STACK
                                                   >> 624         mov     $18, $9         /* save old syscall number */
                                                   >> 625         mov     $19, $10        /* save old a3 */
                                                   >> 626         jsr     $26, syscall_trace_leave
                                                   >> 627         mov     $9, $18
                                                   >> 628         mov     $10, $19
                                                   >> 629         UNDO_SWITCH_STACK
                                                   >> 630 
                                                   >> 631         mov     $31, $26        /* tell "ret_from_sys_call" we can restart */
                                                   >> 632         br      ret_from_sys_call
                                                   >> 633 CFI_END_OSF_FRAME entSys
                                                   >> 634 
                                                   >> 635 /*
                                                   >> 636  * Save and restore the switch stack -- aka the balance of the user context.
                                                   >> 637  */
328                                                   638 
329         ; Can't preempt if preemption disabled !! 639         .align  4
330         GET_CURR_THR_INFO_FROM_SP   r10        !! 640         .type   do_switch_stack, @function
331         ld  r8, [r10, THREAD_INFO_PREEMPT_COUN !! 641         .cfi_startproc simple
332         brne  r8, 0, .Lrestore_regs            !! 642         .cfi_return_column 64
                                                   >> 643         .cfi_def_cfa $sp, 0
                                                   >> 644         .cfi_register 64, $1
                                                   >> 645 do_switch_stack:
                                                   >> 646         lda     $sp, -SWITCH_STACK_SIZE($sp)
                                                   >> 647         .cfi_adjust_cfa_offset  SWITCH_STACK_SIZE
                                                   >> 648         stq     $9, 0($sp)
                                                   >> 649         stq     $10, 8($sp)
                                                   >> 650         stq     $11, 16($sp)
                                                   >> 651         stq     $12, 24($sp)
                                                   >> 652         stq     $13, 32($sp)
                                                   >> 653         stq     $14, 40($sp)
                                                   >> 654         stq     $15, 48($sp)
                                                   >> 655         stq     $26, 56($sp)
                                                   >> 656         stt     $f0, 64($sp)
                                                   >> 657         stt     $f1, 72($sp)
                                                   >> 658         stt     $f2, 80($sp)
                                                   >> 659         stt     $f3, 88($sp)
                                                   >> 660         stt     $f4, 96($sp)
                                                   >> 661         stt     $f5, 104($sp)
                                                   >> 662         stt     $f6, 112($sp)
                                                   >> 663         stt     $f7, 120($sp)
                                                   >> 664         stt     $f8, 128($sp)
                                                   >> 665         stt     $f9, 136($sp)
                                                   >> 666         stt     $f10, 144($sp)
                                                   >> 667         stt     $f11, 152($sp)
                                                   >> 668         stt     $f12, 160($sp)
                                                   >> 669         stt     $f13, 168($sp)
                                                   >> 670         stt     $f14, 176($sp)
                                                   >> 671         stt     $f15, 184($sp)
                                                   >> 672         stt     $f16, 192($sp)
                                                   >> 673         stt     $f17, 200($sp)
                                                   >> 674         stt     $f18, 208($sp)
                                                   >> 675         stt     $f19, 216($sp)
                                                   >> 676         stt     $f20, 224($sp)
                                                   >> 677         stt     $f21, 232($sp)
                                                   >> 678         stt     $f22, 240($sp)
                                                   >> 679         stt     $f23, 248($sp)
                                                   >> 680         stt     $f24, 256($sp)
                                                   >> 681         stt     $f25, 264($sp)
                                                   >> 682         stt     $f26, 272($sp)
                                                   >> 683         stt     $f27, 280($sp)
                                                   >> 684         mf_fpcr $f0             # get fpcr
                                                   >> 685         stt     $f28, 288($sp)
                                                   >> 686         stt     $f29, 296($sp)
                                                   >> 687         stt     $f30, 304($sp)
                                                   >> 688         stt     $f0, 312($sp)   # save fpcr in slot of $f31
                                                   >> 689         ldt     $f0, 64($sp)    # dont let "do_switch_stack" change fp state.
                                                   >> 690         ret     $31, ($1), 1
                                                   >> 691         .cfi_endproc
                                                   >> 692         .size   do_switch_stack, .-do_switch_stack
                                                   >> 693 
                                                   >> 694         .align  4
                                                   >> 695         .type   undo_switch_stack, @function
                                                   >> 696         .cfi_startproc simple
                                                   >> 697         .cfi_def_cfa $sp, 0
                                                   >> 698         .cfi_register 64, $1
                                                   >> 699 undo_switch_stack:
                                                   >> 700         ldq     $9, 0($sp)
                                                   >> 701         ldq     $10, 8($sp)
                                                   >> 702         ldq     $11, 16($sp)
                                                   >> 703         ldq     $12, 24($sp)
                                                   >> 704         ldq     $13, 32($sp)
                                                   >> 705         ldq     $14, 40($sp)
                                                   >> 706         ldq     $15, 48($sp)
                                                   >> 707         ldq     $26, 56($sp)
                                                   >> 708         ldt     $f30, 312($sp)  # get saved fpcr
                                                   >> 709         ldt     $f0, 64($sp)
                                                   >> 710         ldt     $f1, 72($sp)
                                                   >> 711         ldt     $f2, 80($sp)
                                                   >> 712         ldt     $f3, 88($sp)
                                                   >> 713         mt_fpcr $f30            # install saved fpcr
                                                   >> 714         ldt     $f4, 96($sp)
                                                   >> 715         ldt     $f5, 104($sp)
                                                   >> 716         ldt     $f6, 112($sp)
                                                   >> 717         ldt     $f7, 120($sp)
                                                   >> 718         ldt     $f8, 128($sp)
                                                   >> 719         ldt     $f9, 136($sp)
                                                   >> 720         ldt     $f10, 144($sp)
                                                   >> 721         ldt     $f11, 152($sp)
                                                   >> 722         ldt     $f12, 160($sp)
                                                   >> 723         ldt     $f13, 168($sp)
                                                   >> 724         ldt     $f14, 176($sp)
                                                   >> 725         ldt     $f15, 184($sp)
                                                   >> 726         ldt     $f16, 192($sp)
                                                   >> 727         ldt     $f17, 200($sp)
                                                   >> 728         ldt     $f18, 208($sp)
                                                   >> 729         ldt     $f19, 216($sp)
                                                   >> 730         ldt     $f20, 224($sp)
                                                   >> 731         ldt     $f21, 232($sp)
                                                   >> 732         ldt     $f22, 240($sp)
                                                   >> 733         ldt     $f23, 248($sp)
                                                   >> 734         ldt     $f24, 256($sp)
                                                   >> 735         ldt     $f25, 264($sp)
                                                   >> 736         ldt     $f26, 272($sp)
                                                   >> 737         ldt     $f27, 280($sp)
                                                   >> 738         ldt     $f28, 288($sp)
                                                   >> 739         ldt     $f29, 296($sp)
                                                   >> 740         ldt     $f30, 304($sp)
                                                   >> 741         lda     $sp, SWITCH_STACK_SIZE($sp)
                                                   >> 742         ret     $31, ($1), 1
                                                   >> 743         .cfi_endproc
                                                   >> 744         .size   undo_switch_stack, .-undo_switch_stack
                                                   >> 745 
                                                   >> 746 /*
                                                   >> 747  * The meat of the context switch code.
                                                   >> 748  */
333                                                   749 
334         ; check if this task's NEED_RESCHED fl !! 750         .align  4
335         ld  r9, [r10, THREAD_INFO_FLAGS]       !! 751         .globl  alpha_switch_to
336         bbit0  r9, TIF_NEED_RESCHED, .Lrestore !! 752         .type   alpha_switch_to, @function
                                                   >> 753         .cfi_startproc
                                                   >> 754 alpha_switch_to:
                                                   >> 755         DO_SWITCH_STACK
                                                   >> 756         call_pal PAL_swpctx
                                                   >> 757         lda     $8, 0x3fff
                                                   >> 758         UNDO_SWITCH_STACK
                                                   >> 759         bic     $sp, $8, $8
                                                   >> 760         mov     $17, $0
                                                   >> 761         ret
                                                   >> 762         .cfi_endproc
                                                   >> 763         .size   alpha_switch_to, .-alpha_switch_to
337                                                   764 
338         ; Invoke PREEMPTION                    !! 765 /*
339         jl      preempt_schedule_irq           !! 766  * New processes begin life here.
                                                   >> 767  */
340                                                   768 
341         ; preempt_schedule_irq() always return !! 769         .globl  ret_from_fork
342 #endif                                         !! 770         .align  4
                                                   >> 771         .ent    ret_from_fork
                                                   >> 772 ret_from_fork:
                                                   >> 773         lda     $26, ret_from_sys_call
                                                   >> 774         mov     $17, $16
                                                   >> 775         jmp     $31, schedule_tail
                                                   >> 776 .end ret_from_fork
343                                                   777 
344         b       .Lrestore_regs                 !! 778 /*
                                                   >> 779  * ... and new kernel threads - here
                                                   >> 780  */
                                                   >> 781         .align 4
                                                   >> 782         .globl  ret_from_kernel_thread
                                                   >> 783         .ent    ret_from_kernel_thread
                                                   >> 784 ret_from_kernel_thread:
                                                   >> 785         mov     $17, $16
                                                   >> 786         jsr     $26, schedule_tail
                                                   >> 787         mov     $9, $27
                                                   >> 788         mov     $10, $16
                                                   >> 789         jsr     $26, ($9)
                                                   >> 790         mov     $31, $19                /* to disable syscall restarts */
                                                   >> 791         br      $31, ret_to_user
                                                   >> 792 .end ret_from_kernel_thread
345                                                   793 
346 ##### DONT ADD CODE HERE - .Lrestore_regs actu !! 794 
                                                   >> 795 /*
                                                   >> 796  * Special system calls.  Most of these are special in that they either
                                                   >> 797  * have to play switch_stack games or in some way use the pt_regs struct.
                                                   >> 798  */
347                                                   799 
                                                   >> 800 .macro  fork_like name
                                                   >> 801         .align  4
                                                   >> 802         .globl  alpha_\name
                                                   >> 803         .ent    alpha_\name
                                                   >> 804 alpha_\name:
                                                   >> 805         .prologue 0
                                                   >> 806         bsr     $1, do_switch_stack
                                                   >> 807         jsr     $26, sys_\name
                                                   >> 808         ldq     $26, 56($sp)
                                                   >> 809         lda     $sp, SWITCH_STACK_SIZE($sp)
                                                   >> 810         ret
                                                   >> 811 .end    alpha_\name
                                                   >> 812 .endm
                                                   >> 813 
                                                   >> 814 fork_like fork
                                                   >> 815 fork_like vfork
                                                   >> 816 fork_like clone
                                                   >> 817 
                                                   >> 818         .align  4
                                                   >> 819         .globl  sys_sigreturn
                                                   >> 820         .ent    sys_sigreturn
                                                   >> 821 sys_sigreturn:
                                                   >> 822         .prologue 0
                                                   >> 823         lda     $9, ret_from_straced
                                                   >> 824         cmpult  $26, $9, $9
                                                   >> 825         lda     $sp, -SWITCH_STACK_SIZE($sp)
                                                   >> 826         jsr     $26, do_sigreturn
                                                   >> 827         bne     $9, 1f
                                                   >> 828         jsr     $26, syscall_trace_leave
                                                   >> 829 1:      br      $1, undo_switch_stack
                                                   >> 830         br      ret_from_sys_call
                                                   >> 831 .end sys_sigreturn
                                                   >> 832 
                                                   >> 833         .align  4
                                                   >> 834         .globl  sys_rt_sigreturn
                                                   >> 835         .ent    sys_rt_sigreturn
                                                   >> 836 sys_rt_sigreturn:
                                                   >> 837         .prologue 0
                                                   >> 838         lda     $9, ret_from_straced
                                                   >> 839         cmpult  $26, $9, $9
                                                   >> 840         lda     $sp, -SWITCH_STACK_SIZE($sp)
                                                   >> 841         jsr     $26, do_rt_sigreturn
                                                   >> 842         bne     $9, 1f
                                                   >> 843         jsr     $26, syscall_trace_leave
                                                   >> 844 1:      br      $1, undo_switch_stack
                                                   >> 845         br      ret_from_sys_call
                                                   >> 846 .end sys_rt_sigreturn
                                                   >> 847 
                                                   >> 848         .align  4
                                                   >> 849         .globl  alpha_ni_syscall
                                                   >> 850         .ent    alpha_ni_syscall
                                                   >> 851 alpha_ni_syscall:
                                                   >> 852         .prologue 0
                                                   >> 853         /* Special because it also implements overflow handling via
                                                   >> 854            syscall number 0.  And if you recall, zero is a special
                                                   >> 855            trigger for "not an error".  Store large non-zero there.  */
                                                   >> 856         lda     $0, -ENOSYS
                                                   >> 857         unop
                                                   >> 858         stq     $0, 0($sp)
                                                   >> 859         ret
                                                   >> 860 .end alpha_ni_syscall
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php