Import 2.3.12pre3
[davej-history.git] / arch / alpha / kernel / entry.S
blob79ca929137fa4a95a09c2ded4dc0daaa13dc1352
1 /*
2  * alpha/entry.S
3  *
4  * kernel entry-points
5  */
7 #include <asm/system.h>
9 #define SIGCHLD 20
11 #define NR_SYSCALLS 371
14  * These offsets must match with alpha_mv in <asm/machvec.h>.
15  */
16 #define HAE_CACHE       0
17 #define HAE_REG         8
20  * stack offsets
21  */
22 #define SP_OFF          184
24 #define SWITCH_STACK_SIZE 320
27  * task structure offsets
28  */
29 #define TASK_STATE              0
30 #define TASK_FLAGS              8
31 #define TASK_SIGPENDING         16
32 #define TASK_ADDR_LIMIT         24      
33 #define TASK_EXEC_DOMAIN        32
34 #define TASK_NEED_RESCHED       40
37  * task flags (must match include/linux/sched.h):
38  */
39 #define PF_PTRACED      0x00000010
42  * This defines the normal kernel pt-regs layout.
43  *
44  * regs 9-15 preserved by C code
45  * regs 16-18 saved by PAL-code
46  * regs 29-30 saved and set up by PAL-code
47  * JRP - Save regs 16-18 in a special area of the stack, so that
48  * the palcode-provided values are available to the signal handler.
49  */
51 #define SAVE_ALL                        \
52         subq    $30,184,$30;            \
53         stq     $0,0($30);              \
54         stq     $1,8($30);              \
55         stq     $2,16($30);             \
56         stq     $3,24($30);             \
57         stq     $4,32($30);             \
58         stq     $28,144($30);           \
59         lda     $2,alpha_mv;            \
60         stq     $5,40($30);             \
61         stq     $6,48($30);             \
62         stq     $7,56($30);             \
63         stq     $8,64($30);             \
64         stq     $19,72($30);            \
65         stq     $20,80($30);            \
66         stq     $21,88($30);            \
67         ldq     $2,HAE_CACHE($2);       \
68         stq     $22,96($30);            \
69         stq     $23,104($30);           \
70         stq     $24,112($30);           \
71         stq     $25,120($30);           \
72         stq     $26,128($30);           \
73         stq     $27,136($30);           \
74         stq     $2,152($30);            \
75         stq     $16,160($30);           \
76         stq     $17,168($30);           \
77         stq     $18,176($30)
79 #define RESTORE_ALL                     \
80         lda     $19,alpha_mv;           \
81         ldq     $0,0($30);              \
82         ldq     $1,8($30);              \
83         ldq     $2,16($30);             \
84         ldq     $3,24($30);             \
85         ldq     $20,152($30);           \
86         ldq     $21,HAE_CACHE($19);     \
87         ldq     $4,32($30);             \
88         ldq     $5,40($30);             \
89         ldq     $6,48($30);             \
90         ldq     $7,56($30);             \
91         subq    $20,$21,$20;            \
92         ldq     $8,64($30);             \
93         beq     $20,99f;                \
94         ldq     $20,HAE_REG($19);       \
95         addq    $31,7,$16;              \
96         call_pal PAL_swpipl;            \
97         stq     $21,HAE_CACHE($19);     \
98         stq     $21,0($20);             \
99         mov     $0,$16;                 \
100         call_pal PAL_swpipl;            \
101         ldq     $0,0($30);              \
102         ldq     $1,8($30);              \
103 99:;                                    \
104         ldq     $19,72($30);            \
105         ldq     $20,80($30);            \
106         ldq     $21,88($30);            \
107         ldq     $22,96($30);            \
108         ldq     $23,104($30);           \
109         ldq     $24,112($30);           \
110         ldq     $25,120($30);           \
111         ldq     $26,128($30);           \
112         ldq     $27,136($30);           \
113         ldq     $28,144($30);           \
114         addq    $30,184,$30
116 .text
117 .set noat
118 #if defined(__linux__) && !defined(__ELF__)
119   .set singlegp
120 #endif
122 .align 3
123 .globl  entInt
124 .ent    entInt
125 entInt:
126         SAVE_ALL
127         lda     $8,0x3fff
128         lda     $26,ret_from_sys_call
129         bic     $30,$8,$8
130         jsr     $31,do_entInt
131 .end entInt
133 .align 3
134 .globl  entMM
135 .ent    entMM
136 entMM:
137         SAVE_ALL
138 /* save $9 - $15 so the inline exception code can manipulate them.  */
139         subq    $30,56,$30
140         stq     $9,0($30)
141         stq     $10,8($30)
142         stq     $11,16($30)
143         stq     $12,24($30)
144         stq     $13,32($30)
145         stq     $14,40($30)
146         stq     $15,48($30)
147         addq    $30,56,$19
148 /* handle the fault */
149         lda     $8,0x3fff
150         bic     $30,$8,$8
151         jsr     $26,do_page_fault
152 /* reload the registers after the exception code played.  */
153         ldq     $9,0($30)
154         ldq     $10,8($30)
155         ldq     $11,16($30)
156         ldq     $12,24($30)
157         ldq     $13,32($30)
158         ldq     $14,40($30)
159         ldq     $15,48($30)
160         addq    $30,56,$30
161 /* finish up the syscall as normal.  */
162         br      ret_from_sys_call
163 .end entMM
165 .align 3
166 .globl  entArith
167 .ent    entArith
168 entArith:
169         SAVE_ALL
170         lda     $8,0x3fff
171         lda     $26,ret_from_sys_call
172         bic     $30,$8,$8
173         jsr     $31,do_entArith
174 .end entArith
176 .align 3
177 .globl  entIF
178 .ent    entIF
179 entIF:
180         SAVE_ALL
181         lda     $8,0x3fff
182         lda     $26,ret_from_sys_call
183         bic     $30,$8,$8
184         jsr     $31,do_entIF
185 .end entIF
187 .align 3
188 .globl  entDbg
189 .ent    entDbg
190 entDbg:
191         SAVE_ALL
192         lda     $8,0x3fff
193         lda     $26,ret_from_sys_call
194         bic     $30,$8,$8
195         jsr     $31,do_entDbg
196 .end entDbg
200  * Fork() is one of the special system calls: it needs to
201  * save the callee-saved regs so that the regs can be found
202  * for the new process.. We save them in the "context switch"
203  * stack format (see arch/alpha/kernel/process.c).
205  * Also, for the kernel fork, we need to fake the system call
206  * stack buildup, as we can't do system calls from kernel space.
207  */
208 .align 3
209 .ent    kernel_clone
210 kernel_clone:
211         .frame $30, 0, $26
212         .prologue 0
213         subq    $30,6*8,$30
214         stq     $31,0($30)
215         stq     $26,8($30)
216         stq     $29,16($30)
217         stq     $16,24($30)
218         stq     $17,32($30)
219         stq     $18,40($30)
220         bis     $31,2,$0        /* Register v0: syscall nr for fork() */
221         SAVE_ALL
222         bsr     $26,sys_clone
223         stq     $0,0($30)
224         br      ret_from_sys_call
225 .end    kernel_clone
228  * __kernel_thread(clone_flags, fn, arg)
229  */
230 .align 3
231 .globl  __kernel_thread
232 .ent    __kernel_thread
233 __kernel_thread:
234         ldgp    $29,0($27)      /* we can be called from a module */
235         .frame $30, 4*8, $26
236         subq    $30,4*8,$30
237         stq     $10,16($30)
238         stq     $9,8($30)
239         stq     $26,0($30)
240         .prologue 1
241         mov     $17,$9          /* save fn */           
242         mov     $18,$10         /* save arg */
243         bsr     $26,kernel_clone
244         bne     $20,1f          /* $20 is non-zero in child */
245         ldq     $26,0($30)
246         ldq     $9,8($30)
247         ldq     $10,16($30)
248         addq    $30,4*8,$30
249         ret     $31,($26),1
250 /* this is in child: look out as we don't have any stack here.. */
251 1:      mov     $9,$27          /* get fn */
252         lda     $8,0x3fff
253         mov     $10,$16         /* get arg */
254         bic     $30,$8,$8       /* get current */
255         jsr     $26,($27)
256         ldgp    $29,0($26)
257         mov     $0,$16
258         mov     $31,$26
259         jsr     $31,sys_exit
260 .end    __kernel_thread
263  * __kernel_execve(path, argv, envp, regs)
264  */
265 .align 3
266 .globl  __kernel_execve
267 .ent    __kernel_execve
268 __kernel_execve:
269         ldgp    $29,0($27)      /* we can be called from modules.  */
270         subq    $30,16,$30
271         .frame  $30,16,$26,0
272         stq     $26,0($30)
273         stq     $19,8($30)
274         .prologue 1
275         jsr     $26,do_execve
276         bne     $0,1f           /* error! */
277         ldq     $30,8($30)
278         br      $31,ret_from_sys_call
279 1:      ldq     $26,0($30)
280         addq    $30,16,$30
281         ret
282 .end    __kernel_execve
284 .align 3
285 .ent    do_switch_stack
286 do_switch_stack:
287         lda     $30,-SWITCH_STACK_SIZE($30)
288         stq     $9,0($30)
289         stq     $10,8($30)
290         stq     $11,16($30)
291         stq     $12,24($30)
292         stq     $13,32($30)
293         stq     $14,40($30)
294         stq     $15,48($30)
295         stq     $26,56($30)
296         stt     $f0,64($30)
297         stt     $f1,72($30)
298         stt     $f2,80($30)
299         stt     $f3,88($30)
300         stt     $f4,96($30)
301         stt     $f5,104($30)
302         stt     $f6,112($30)
303         stt     $f7,120($30)
304         stt     $f8,128($30)
305         stt     $f9,136($30)
306         stt     $f10,144($30)
307         stt     $f11,152($30)
308         stt     $f12,160($30)
309         stt     $f13,168($30)
310         stt     $f14,176($30)
311         stt     $f15,184($30)
312         stt     $f16,192($30)
313         stt     $f17,200($30)
314         stt     $f18,208($30)
315         stt     $f19,216($30)
316         stt     $f20,224($30)
317         stt     $f21,232($30)
318         stt     $f22,240($30)
319         stt     $f23,248($30)
320         stt     $f24,256($30)
321         stt     $f25,264($30)
322         stt     $f26,272($30)
323         stt     $f27,280($30)
324         mf_fpcr $f0             # get fpcr
325         stt     $f28,288($30)
326         stt     $f29,296($30)
327         stt     $f30,304($30)
328         stt     $f0,312($30)    # save fpcr in slot of $f31
329         ldt     $f0,64($30)     # dont let "do_switch_stack" change fp state.
330         ret     $31,($1),1
331 .end do_switch_stack
333 .align 3
334 .ent    undo_switch_stack
335 undo_switch_stack:
336         ldq     $9,0($30)
337         ldq     $10,8($30)
338         ldq     $11,16($30)
339         ldq     $12,24($30)
340         ldq     $13,32($30)
341         ldq     $14,40($30)
342         ldq     $15,48($30)
343         ldq     $26,56($30)
344         ldt     $f30,312($30)   # get saved fpcr
345         ldt     $f0,64($30)
346         ldt     $f1,72($30)
347         ldt     $f2,80($30)
348         ldt     $f3,88($30)
349         mt_fpcr $f30            # install saved fpcr
350         ldt     $f4,96($30)
351         ldt     $f5,104($30)
352         ldt     $f6,112($30)
353         ldt     $f7,120($30)
354         ldt     $f8,128($30)
355         ldt     $f9,136($30)
356         ldt     $f10,144($30)
357         ldt     $f11,152($30)
358         ldt     $f12,160($30)
359         ldt     $f13,168($30)
360         ldt     $f14,176($30)
361         ldt     $f15,184($30)
362         ldt     $f16,192($30)
363         ldt     $f17,200($30)
364         ldt     $f18,208($30)
365         ldt     $f19,216($30)
366         ldt     $f20,224($30)
367         ldt     $f21,232($30)
368         ldt     $f22,240($30)
369         ldt     $f23,248($30)
370         ldt     $f24,256($30)
371         ldt     $f25,264($30)
372         ldt     $f26,272($30)
373         ldt     $f27,280($30)
374         ldt     $f28,288($30)
375         ldt     $f29,296($30)
376         ldt     $f30,304($30)
377         lda     $30,SWITCH_STACK_SIZE($30)
378         ret     $31,($1),1
379 .end undo_switch_stack
381 .align 3
382 .globl  entUna
383 .ent    entUna
384 entUna:
385         lda     $30,-256($30)
386         stq     $0,0($30)
387         ldq     $0,256($30)     /* get PS */
388         stq     $1,8($30)
389         stq     $2,16($30)
390         stq     $3,24($30)
391         and     $0,8,$0         /* user mode? */
392         stq     $4,32($30)
393         bne     $0,entUnaUser   /* yup -> do user-level unaligned fault */
394         stq     $5,40($30)
395         stq     $6,48($30)
396         stq     $7,56($30)
397         stq     $8,64($30)
398         stq     $9,72($30)
399         stq     $10,80($30)
400         stq     $11,88($30)
401         stq     $12,96($30)
402         stq     $13,104($30)
403         stq     $14,112($30)
404         stq     $15,120($30)
405         /* 16-18 PAL-saved */
406         stq     $19,152($30)
407         stq     $20,160($30)
408         stq     $21,168($30)
409         stq     $22,176($30)
410         stq     $23,184($30)
411         stq     $24,192($30)
412         stq     $25,200($30)
413         stq     $26,208($30)
414         stq     $27,216($30)
415         stq     $28,224($30)
416         stq     $29,232($30)
417         lda     $8,0x3fff
418         stq     $31,248($30)
419         bic     $30,$8,$8
420         jsr     $26,do_entUna
421         ldq     $0,0($30)
422         ldq     $1,8($30)
423         ldq     $2,16($30)
424         ldq     $3,24($30)
425         ldq     $4,32($30)
426         ldq     $5,40($30)
427         ldq     $6,48($30)
428         ldq     $7,56($30)
429         ldq     $8,64($30)
430         ldq     $9,72($30)
431         ldq     $10,80($30)
432         ldq     $11,88($30)
433         ldq     $12,96($30)
434         ldq     $13,104($30)
435         ldq     $14,112($30)
436         ldq     $15,120($30)
437         /* 16-18 PAL-saved */
438         ldq     $19,152($30)
439         ldq     $20,160($30)
440         ldq     $21,168($30)
441         ldq     $22,176($30)
442         ldq     $23,184($30)
443         ldq     $24,192($30)
444         ldq     $25,200($30)
445         ldq     $26,208($30)
446         ldq     $27,216($30)
447         ldq     $28,224($30)
448         ldq     $29,232($30)
449         lda     $30,256($30)
450         call_pal PAL_rti
451 .end entUna
453 .align 3
454 .ent    entUnaUser
455 entUnaUser:
456         ldq     $0,0($30)       /* restore original $0 */
457         lda     $30,256($30)    /* pop entUna's stack frame */
458         SAVE_ALL                /* setup normal kernel stack */
459         lda     $30,-56($30)
460         stq     $9,0($30)
461         stq     $10,8($30)
462         stq     $11,16($30)
463         stq     $12,24($30)
464         stq     $13,32($30)
465         stq     $14,40($30)
466         stq     $15,48($30)
467         lda     $8,0x3fff
468         addq    $30,56,$19
469         bic     $30,$8,$8
470         jsr     $26,do_entUnaUser
471         ldq     $9,0($30)
472         ldq     $10,8($30)
473         ldq     $11,16($30)
474         ldq     $12,24($30)
475         ldq     $13,32($30)
476         ldq     $14,40($30)
477         ldq     $15,48($30)
478         lda     $30,56($30)
479         br      ret_from_sys_call
480 .end    entUnaUser
483  * A fork is the same as clone(SIGCHLD, 0);
484  */
485 .align 3
486 .globl  sys_fork
487 .ent    sys_fork
488 sys_fork:
489         bsr     $1,do_switch_stack
490         bis     $31,SIGCHLD,$16
491         mov     $31,$17
492         mov     $30,$18
493         jsr     $26,alpha_clone
494         bsr     $1,undo_switch_stack
495         ret     $31,($26),1
496 .end    sys_fork
498 .align 3
499 .globl  sys_clone
500 .ent    sys_clone
501 sys_clone:
502         bsr     $1,do_switch_stack
503         /* arg1 and arg2 come from the user */
504         mov     $30,$18
505         jsr     $26,alpha_clone
506         bsr     $1,undo_switch_stack
507         ret     $31,($26),1
508 .end    sys_clone
510 .align 3
511 .globl  sys_vfork
512 .ent    sys_vfork
513 sys_vfork:
514         bsr     $1,do_switch_stack
515         mov     $30,$16
516         jsr     $26,alpha_vfork
517         bsr     $1,undo_switch_stack
518         ret     $31,($26),1
519 .end    sys_vfork
521 .align 3
522 .globl  alpha_switch_to
523 .ent    alpha_switch_to
524 alpha_switch_to:
525         .prologue 0
526         bsr     $1,do_switch_stack
527         call_pal PAL_swpctx
528         unop
529         bsr     $1,undo_switch_stack
530         mov     $17,$0
531         ret     $31,($26),1
532 .end alpha_switch_to
535  * Oh, well.. Disassembling OSF/1 binaries to find out how the
536  * system calls work isn't much fun.
538  * entSys is special in that the PAL-code doesn't save a0-a2, so
539  * we start off by doing that by hand.
540  */
541 .align 3
542 .globl  entSys
543 .globl  ret_from_sys_call
544 .ent    entSys
545 entSys:
546         SAVE_ALL
547         lda     $8,0x3fff
548         bic     $30,$8,$8
549         lda     $4,NR_SYSCALLS($31)
550         stq     $16,SP_OFF+24($30)
551         lda     $5,sys_call_table
552         lda     $27,sys_ni_syscall
553         cmpult  $0,$4,$4
554         ldq     $3,TASK_FLAGS($8)
555         stq     $17,SP_OFF+32($30)
556         s8addq  $0,$5,$5
557         and     $3,PF_PTRACED,$3
558         stq     $18,SP_OFF+40($30)
559         bne     $3,strace
560         beq     $4,1f
561         ldq     $27,0($5)
562 1:      jsr     $26,($27),alpha_ni_syscall
563         ldgp    $29,0($26)
564         blt     $0,syscall_error        /* the call failed */
565         stq     $0,0($30)
566         stq     $31,72($30)             /* a3=0 => no error */
568 .align 3
569 ret_from_sys_call:
570         cmovne  $26,0,$19               /* $19 = 0 => non-restartable */
571         /* check bottom half interrupts */
572         ldq     $3,bh_active
573         ldq     $4,bh_mask
574         and     $3,$4,$2
575         bne     $2,handle_bottom_half
576 ret_from_handle_bh:
577         ldq     $0,SP_OFF($30)
578         and     $0,8,$0
579         beq     $0,restore_all
580 ret_from_reschedule:
581         ldq     $2,TASK_NEED_RESCHED($8)
582         lda     $4,init_task_union
583         bne     $2,reschedule
584         xor     $4,$8,$4
585         ldl     $5,TASK_SIGPENDING($8)
586         beq     $4,restore_all
587         bne     $5,signal_return
588 restore_all:
589         RESTORE_ALL
590         call_pal PAL_rti
593 /* PTRACE syscall handler */
594 .align 3
595 strace:
596         /* set up signal stack, call syscall_trace */
597         bsr     $1,do_switch_stack
598         jsr     $26,syscall_trace
599         bsr     $1,undo_switch_stack
601         /* get the system call number and the arguments back.. */
602         ldq     $0,0($30)
603         ldq     $16,SP_OFF+24($30)
604         ldq     $17,SP_OFF+32($30)
605         ldq     $18,SP_OFF+40($30)
606         ldq     $19,72($30)
607         ldq     $20,80($30)
608         ldq     $21,88($30)
610         /* get the system call pointer.. */
611         lda     $1,NR_SYSCALLS($31)
612         lda     $2,sys_call_table
613         lda     $27,alpha_ni_syscall
614         cmpult  $0,$1,$1
615         s8addq  $0,$2,$2
616         beq     $1,1f
617         ldq     $27,0($2)
618 1:      jsr     $26,($27),sys_gettimeofday
619         ldgp    $29,0($26)
621         /* check return.. */
622         blt     $0,strace_error /* the call failed */
623         stq     $31,72($30)             /* a3=0 => no error */
624 strace_success:
625         stq     $0,0($30)               /* save return value */
627         bsr     $1,do_switch_stack
628         jsr     $26,syscall_trace
629         bsr     $1,undo_switch_stack
630         br      $31,ret_from_sys_call
632         .align  3
633 strace_error:
634         ldq     $19,0($30)      /* old syscall nr (zero if success) */
635         beq     $19,strace_success
636         ldq     $20,72($30)     /* .. and this a3 */
638         subq    $31,$0,$0       /* with error in v0 */
639         addq    $31,1,$1        /* set a3 for errno return */
640         stq     $0,0($30)
641         stq     $1,72($30)      /* a3 for return */
643         bsr     $1,do_switch_stack
644         mov     $19,$9          /* save old syscall number */
645         mov     $20,$10         /* save old a3 */
646         jsr     $26,syscall_trace
647         mov     $9,$19
648         mov     $10,$20
649         bsr     $1,undo_switch_stack
651         mov     $31,$26         /* tell "ret_from_sys_call" we can restart */
652         br      ret_from_sys_call
654         .align 3
655 handle_bottom_half:
656         subq    $30,16,$30
657         stq     $19,0($30)      /* save syscall nr */
658         stq     $20,8($30)      /* and error indication (a3) */
659         jsr     $26,do_bottom_half
660         ldq     $19,0($30)
661         ldq     $20,8($30)
662         addq    $30,16,$30
663         br      ret_from_handle_bh
665         .align 3
666 syscall_error:
667         /*
668          * Some system calls (e.g., ptrace) can return arbitrary
669          * values which might normally be mistaken as error numbers.
670          * Those functions must zero $0 (v0) directly in the stack
671          * frame to indicate that a negative return value wasn't an
672          * error number..
673          */
674         ldq     $19,0($30)      /* old syscall nr (zero if success) */
675         beq     $19,ret_success
677         ldq     $20,72($30)     /* .. and this a3 */
678         subq    $31,$0,$0       /* with error in v0 */
679         addq    $31,1,$1        /* set a3 for errno return */
680         stq     $0,0($30)
681         mov     $31,$26         /* tell "ret_from_sys_call" we can restart */
682         stq     $1,72($30)      /* a3 for return */
683         br      ret_from_sys_call
685 ret_success:
686         stq     $0,0($30)
687         stq     $31,72($30)     /* a3=0 => no error */
688         br      ret_from_sys_call
690 .align 3
691 signal_return:
692         mov     $30,$17
693         br      $1,do_switch_stack
694         mov     $30,$18
695         mov     $31,$16
696         jsr     $26,do_signal
697         bsr     $1,undo_switch_stack
698         br      restore_all
699 .end entSys
701 #ifdef __SMP__
702         .globl  ret_from_smp_fork
703 .align 3
704 .ent ret_from_smp_fork
705 ret_from_smp_fork:
706         lda     $26,ret_from_sys_call
707         mov     $17,$16
708         jsr     $31,schedule_tail
709 .end ret_from_smp_fork
710 #endif /* __SMP__ */
712 .align 3
713 .ent reschedule
714 reschedule:
715         subq    $30,16,$30
716         stq     $19,0($30)      /* save syscall nr */
717         stq     $20,8($30)      /* and error indication (a3) */
718         jsr     $26,schedule
719         ldq     $19,0($30)
720         ldq     $20,8($30)
721         addq    $30,16,$30
722         br      ret_from_reschedule
723 .end reschedule
725 .align 3
726 .ent sys_sigreturn
727 sys_sigreturn:
728         mov     $30,$17
729         lda     $18,-SWITCH_STACK_SIZE($30)
730         lda     $30,-SWITCH_STACK_SIZE($30)
731         jsr     $26,do_sigreturn
732         br      $1,undo_switch_stack
733         br      ret_from_sys_call
734 .end sys_sigreturn
736 .align 3
737 .ent sys_rt_sigreturn
738 sys_rt_sigreturn:
739         mov     $30,$17
740         lda     $18,-SWITCH_STACK_SIZE($30)
741         lda     $30,-SWITCH_STACK_SIZE($30)
742         jsr     $26,do_rt_sigreturn
743         br      $1,undo_switch_stack
744         br      ret_from_sys_call
745 .end sys_rt_sigreturn
747 .align 3
748 .ent sys_sigsuspend
749 sys_sigsuspend:
750         mov     $30,$17
751         br      $1,do_switch_stack
752         mov     $30,$18
753         jsr     $26,do_sigsuspend
754         lda     $30,SWITCH_STACK_SIZE($30)
755         br      ret_from_sys_call
756 .end sys_sigsuspend
758 .align 3
759 .ent sys_rt_sigsuspend
760 sys_rt_sigsuspend:
761         mov     $30,$18
762         br      $1,do_switch_stack
763         mov     $30,$19
764         jsr     $26,do_rt_sigsuspend
765         lda     $30,SWITCH_STACK_SIZE($30)
766         br      ret_from_sys_call
767 .end sys_rt_sigsuspend
769         .data
770         .align 3
771         .globl sys_call_table
772 sys_call_table:
773         .quad alpha_ni_syscall                  /* 0 */
774         .quad sys_exit
775         .quad sys_fork
776         .quad sys_read
777         .quad sys_write
778         .quad alpha_ni_syscall                  /* 5 */
779         .quad sys_close
780         .quad osf_wait4
781         .quad alpha_ni_syscall
782         .quad sys_link
783         .quad sys_unlink                        /* 10 */
784         .quad alpha_ni_syscall
785         .quad sys_chdir
786         .quad sys_fchdir
787         .quad sys_mknod
788         .quad sys_chmod                         /* 15 */
789         .quad sys_chown
790         .quad osf_brk
791         .quad alpha_ni_syscall
792         .quad sys_lseek
793         .quad sys_getxpid                       /* 20 */
794         .quad osf_mount
795         .quad sys_umount
796         .quad sys_setuid
797         .quad sys_getxuid
798         .quad alpha_ni_syscall                  /* 25 */
799         .quad sys_ptrace
800         .quad alpha_ni_syscall
801         .quad alpha_ni_syscall
802         .quad alpha_ni_syscall
803         .quad alpha_ni_syscall                  /* 30 */
804         .quad alpha_ni_syscall
805         .quad alpha_ni_syscall
806         .quad sys_access
807         .quad alpha_ni_syscall
808         .quad alpha_ni_syscall                  /* 35 */
809         .quad sys_sync
810         .quad sys_kill
811         .quad alpha_ni_syscall
812         .quad sys_setpgid
813         .quad alpha_ni_syscall                  /* 40 */
814         .quad sys_dup
815         .quad sys_pipe
816         .quad osf_set_program_attributes
817         .quad alpha_ni_syscall
818         .quad sys_open                          /* 45 */
819         .quad alpha_ni_syscall
820         .quad sys_getxgid
821         .quad osf_sigprocmask
822         .quad alpha_ni_syscall
823         .quad alpha_ni_syscall                  /* 50 */
824         .quad sys_acct
825         .quad osf_sigpending
826         .quad alpha_ni_syscall
827         .quad sys_ioctl
828         .quad alpha_ni_syscall                  /* 55 */
829         .quad alpha_ni_syscall
830         .quad sys_symlink
831         .quad sys_readlink
832         .quad sys_execve
833         .quad sys_umask                         /* 60 */
834         .quad sys_chroot
835         .quad alpha_ni_syscall
836         .quad sys_getpgrp
837         .quad sys_getpagesize
838         .quad alpha_ni_syscall                  /* 65 */
839         .quad sys_vfork
840         .quad sys_newstat
841         .quad sys_newlstat
842         .quad alpha_ni_syscall
843         .quad alpha_ni_syscall                  /* 70 */
844         .quad osf_mmap
845         .quad alpha_ni_syscall
846         .quad sys_munmap
847         .quad sys_mprotect
848         .quad sys_madvise                       /* 75 */
849         .quad sys_vhangup
850         .quad alpha_ni_syscall
851         .quad alpha_ni_syscall
852         .quad sys_getgroups
853         /* map BSD's setpgrp to sys_setpgid for binary compatibility: */
854         .quad sys_setgroups                     /* 80 */
855         .quad alpha_ni_syscall
856         .quad sys_setpgid
857         .quad osf_setitimer
858         .quad alpha_ni_syscall
859         .quad alpha_ni_syscall                  /* 85 */
860         .quad osf_getitimer
861         .quad sys_gethostname
862         .quad sys_sethostname
863         .quad sys_getdtablesize
864         .quad sys_dup2                          /* 90 */
865         .quad sys_newfstat
866         .quad sys_fcntl
867         .quad osf_select
868         .quad sys_poll
869         .quad sys_fsync                         /* 95 */
870         .quad sys_setpriority
871         .quad sys_socket
872         .quad sys_connect
873         .quad sys_accept
874         .quad osf_getpriority                   /* 100 */
875         .quad sys_send
876         .quad sys_recv
877         .quad sys_sigreturn
878         .quad sys_bind
879         .quad sys_setsockopt                    /* 105 */
880         .quad sys_listen
881         .quad alpha_ni_syscall
882         .quad alpha_ni_syscall
883         .quad alpha_ni_syscall
884         .quad alpha_ni_syscall                  /* 110 */
885         .quad sys_sigsuspend
886         .quad osf_sigstack
887         .quad sys_recvmsg
888         .quad sys_sendmsg
889         .quad alpha_ni_syscall                  /* 115 */
890         .quad osf_gettimeofday
891         .quad osf_getrusage
892         .quad sys_getsockopt
893         .quad alpha_ni_syscall
894         .quad sys_readv                         /* 120 */
895         .quad sys_writev
896         .quad osf_settimeofday
897         .quad sys_fchown
898         .quad sys_fchmod
899         .quad sys_recvfrom                      /* 125 */
900         .quad sys_setreuid
901         .quad sys_setregid
902         .quad sys_rename
903         .quad sys_truncate
904         .quad sys_ftruncate                     /* 130 */
905         .quad sys_flock
906         .quad sys_setgid
907         .quad sys_sendto
908         .quad sys_shutdown
909         .quad sys_socketpair                    /* 135 */
910         .quad sys_mkdir
911         .quad sys_rmdir
912         .quad osf_utimes
913         .quad alpha_ni_syscall
914         .quad alpha_ni_syscall                  /* 140 */
915         .quad sys_getpeername
916         .quad alpha_ni_syscall
917         .quad alpha_ni_syscall
918         .quad sys_getrlimit
919         .quad sys_setrlimit                     /* 145 */
920         .quad alpha_ni_syscall
921         .quad sys_setsid
922         .quad sys_quotactl
923         .quad alpha_ni_syscall
924         .quad sys_getsockname                   /* 150 */
925         .quad alpha_ni_syscall
926         .quad alpha_ni_syscall
927         .quad alpha_ni_syscall
928         .quad alpha_ni_syscall
929         .quad alpha_ni_syscall                  /* 155 */
930         .quad osf_sigaction
931         .quad alpha_ni_syscall
932         .quad alpha_ni_syscall
933         .quad osf_getdirentries
934         .quad osf_statfs                        /* 160 */
935         .quad osf_fstatfs
936         .quad alpha_ni_syscall
937         .quad alpha_ni_syscall
938         .quad alpha_ni_syscall
939         .quad osf_getdomainname                 /* 165 */
940         .quad sys_setdomainname
941         .quad alpha_ni_syscall
942         .quad alpha_ni_syscall
943         .quad alpha_ni_syscall
944         .quad alpha_ni_syscall                  /* 170 */
945         .quad alpha_ni_syscall
946         .quad alpha_ni_syscall
947         .quad alpha_ni_syscall
948         .quad alpha_ni_syscall
949         .quad alpha_ni_syscall                  /* 175 */
950         .quad alpha_ni_syscall
951         .quad alpha_ni_syscall
952         .quad alpha_ni_syscall
953         .quad alpha_ni_syscall
954         .quad alpha_ni_syscall                  /* 180 */
955         .quad alpha_ni_syscall
956         .quad alpha_ni_syscall
957         .quad alpha_ni_syscall
958         .quad alpha_ni_syscall
959         .quad alpha_ni_syscall                  /* 185 */
960         .quad alpha_ni_syscall
961         .quad alpha_ni_syscall
962         .quad alpha_ni_syscall
963         .quad alpha_ni_syscall
964         .quad alpha_ni_syscall                  /* 190 */
965         .quad alpha_ni_syscall
966         .quad alpha_ni_syscall
967         .quad alpha_ni_syscall
968         .quad alpha_ni_syscall
969         .quad alpha_ni_syscall                  /* 195 */
970         .quad alpha_ni_syscall
971         .quad alpha_ni_syscall
972         .quad alpha_ni_syscall
973         .quad osf_swapon
974         .quad sys_msgctl                        /* 200 */
975         .quad sys_msgget
976         .quad sys_msgrcv
977         .quad sys_msgsnd
978         .quad sys_semctl
979         .quad sys_semget                        /* 205 */
980         .quad sys_semop
981         .quad osf_utsname
982         .quad sys_lchown
983         .quad osf_shmat
984         .quad sys_shmctl                        /* 210 */
985         .quad sys_shmdt
986         .quad sys_shmget
987         .quad alpha_ni_syscall
988         .quad alpha_ni_syscall
989         .quad alpha_ni_syscall                  /* 215 */
990         .quad alpha_ni_syscall
991         .quad sys_msync
992         .quad alpha_ni_syscall
993         .quad alpha_ni_syscall
994         .quad alpha_ni_syscall                  /* 220 */
995         .quad alpha_ni_syscall
996         .quad alpha_ni_syscall
997         .quad alpha_ni_syscall
998         .quad alpha_ni_syscall
999         .quad alpha_ni_syscall                  /* 225 */
1000         .quad alpha_ni_syscall
1001         .quad alpha_ni_syscall
1002         .quad alpha_ni_syscall
1003         .quad alpha_ni_syscall
1004         .quad alpha_ni_syscall                  /* 230 */
1005         .quad alpha_ni_syscall
1006         .quad alpha_ni_syscall
1007         .quad sys_getpgid
1008         .quad sys_getsid
1009         .quad sys_sigaltstack                   /* 235 */
1010         .quad alpha_ni_syscall
1011         .quad alpha_ni_syscall
1012         .quad alpha_ni_syscall
1013         .quad alpha_ni_syscall
1014         .quad alpha_ni_syscall                  /* 240 */
1015         .quad osf_sysinfo
1016         .quad alpha_ni_syscall
1017         .quad alpha_ni_syscall
1018         .quad osf_proplist_syscall
1019         .quad alpha_ni_syscall                  /* 245 */
1020         .quad alpha_ni_syscall
1021         .quad alpha_ni_syscall
1022         .quad alpha_ni_syscall
1023         .quad alpha_ni_syscall
1024         .quad alpha_ni_syscall                  /* 250 */
1025         .quad osf_usleep_thread
1026         .quad alpha_ni_syscall
1027         .quad alpha_ni_syscall
1028         .quad sys_sysfs
1029         .quad alpha_ni_syscall                  /* 255 */
1030         .quad osf_getsysinfo
1031         .quad osf_setsysinfo
1032         .quad alpha_ni_syscall
1033         .quad alpha_ni_syscall
1034         .quad alpha_ni_syscall                  /* 260 */
1035         .quad alpha_ni_syscall
1036         .quad alpha_ni_syscall
1037         .quad alpha_ni_syscall
1038         .quad alpha_ni_syscall
1039         .quad alpha_ni_syscall                  /* 265 */
1040         .quad alpha_ni_syscall
1041         .quad alpha_ni_syscall
1042         .quad alpha_ni_syscall
1043         .quad alpha_ni_syscall
1044         .quad alpha_ni_syscall                  /* 270 */
1045         .quad alpha_ni_syscall
1046         .quad alpha_ni_syscall
1047         .quad alpha_ni_syscall
1048         .quad alpha_ni_syscall
1049         .quad alpha_ni_syscall                  /* 275 */
1050         .quad alpha_ni_syscall
1051         .quad alpha_ni_syscall
1052         .quad alpha_ni_syscall
1053         .quad alpha_ni_syscall
1054         .quad alpha_ni_syscall                  /* 280 */
1055         .quad alpha_ni_syscall
1056         .quad alpha_ni_syscall
1057         .quad alpha_ni_syscall
1058         .quad alpha_ni_syscall
1059         .quad alpha_ni_syscall                  /* 285 */
1060         .quad alpha_ni_syscall
1061         .quad alpha_ni_syscall
1062         .quad alpha_ni_syscall
1063         .quad alpha_ni_syscall
1064         .quad alpha_ni_syscall                  /* 290 */
1065         .quad alpha_ni_syscall
1066         .quad alpha_ni_syscall
1067         .quad alpha_ni_syscall
1068         .quad alpha_ni_syscall
1069         .quad alpha_ni_syscall                  /* 295 */
1070         .quad alpha_ni_syscall
1071         .quad alpha_ni_syscall
1072         .quad alpha_ni_syscall
1073         .quad alpha_ni_syscall
1074 /* linux-specific system calls start at 300 */
1075         .quad sys_bdflush                       /* 300 */
1076         .quad sys_sethae
1077         .quad sys_mount
1078         .quad sys_old_adjtimex
1079         .quad sys_swapoff
1080         .quad sys_getdents                      /* 305 */
1081         .quad alpha_create_module
1082         .quad sys_init_module
1083         .quad sys_delete_module
1084         .quad sys_get_kernel_syms
1085         .quad sys_syslog                        /* 310 */
1086         .quad sys_reboot
1087         .quad sys_clone
1088         .quad sys_uselib
1089         .quad sys_mlock
1090         .quad sys_munlock                       /* 315 */
1091         .quad sys_mlockall
1092         .quad sys_munlockall
1093         .quad sys_sysinfo
1094         .quad sys_sysctl
1095         .quad sys_idle                          /* 320 */
1096         .quad sys_oldumount
1097         .quad sys_swapon
1098         .quad sys_times
1099         .quad sys_personality
1100         .quad sys_setfsuid                      /* 325 */
1101         .quad sys_setfsgid
1102         .quad sys_ustat
1103         .quad sys_statfs
1104         .quad sys_fstatfs
1105         .quad sys_sched_setparam                /* 330 */
1106         .quad sys_sched_getparam
1107         .quad sys_sched_setscheduler
1108         .quad sys_sched_getscheduler
1109         .quad sys_sched_yield
1110         .quad sys_sched_get_priority_max        /* 335 */
1111         .quad sys_sched_get_priority_min
1112         .quad sys_sched_rr_get_interval
1113         .quad sys_ni_syscall                    /* sys_afs_syscall */
1114         .quad sys_newuname
1115         .quad sys_nanosleep                     /* 340 */
1116         .quad sys_mremap
1117         .quad sys_nfsservctl
1118         .quad sys_setresuid
1119         .quad sys_getresuid
1120         .quad sys_pciconfig_read                /* 345 */
1121         .quad sys_pciconfig_write
1122         .quad sys_query_module
1123         .quad sys_prctl
1124         .quad sys_pread
1125         .quad sys_pwrite                        /* 350 */
1126         .quad sys_rt_sigreturn
1127         .quad sys_rt_sigaction
1128         .quad sys_rt_sigprocmask
1129         .quad sys_rt_sigpending
1130         .quad sys_rt_sigtimedwait               /* 355 */
1131         .quad sys_rt_sigqueueinfo
1132         .quad sys_rt_sigsuspend
1133         .quad sys_select
1134         .quad sys_gettimeofday
1135         .quad sys_settimeofday                  /* 360 */
1136         .quad sys_getitimer
1137         .quad sys_setitimer
1138         .quad sys_utimes
1139         .quad sys_getrusage
1140         .quad sys_wait4                         /* 365 */
1141         .quad sys_adjtimex
1142         .quad sys_getcwd
1143         .quad sys_capget
1144         .quad sys_capset
1145         .quad sys_sendfile                      /* 370 */
1146         .quad sys_timer_create
1147         .quad sys_timer_settime
1148         .quad sys_timer_gettime
1149         .quad sys_timer_setoverrun
1150         .quad sys_timer_delete                  /* 375 */
1151         .quad sys_clock_gettime
1152         .quad sys_clock_settime
1153         .quad sys_clock_getres                  /* 378 */