1/*
2 * alpha/entry.S
3 *
4 * kernel entry-points
5 */
6
7#include <linux/config.h>
8#include <asm/system.h>
9#include <asm/cache.h>
10
11#define SIGCHLD 20
12
13#define NR_SYSCALLS 382
14
15/*
16 * These offsets must match with alpha_mv in <asm/machvec.h>.
17 */
18#define HAE_CACHE	0
19#define HAE_REG		8
20
21/*
22 * stack offsets
23 */
24#define SP_OFF		184
25
26#define SWITCH_STACK_SIZE 320
27
28/*
29 * task structure offsets
30 */
31#define TASK_STATE		0
32#define TASK_FLAGS		8
33#define TASK_SIGPENDING		16
34#define TASK_ADDR_LIMIT		24
35#define TASK_EXEC_DOMAIN	32
36#define TASK_NEED_RESCHED	40
37#define TASK_PTRACE		48
38#define TASK_PROCESSOR		100
39
40/*
41 * task flags (must match include/linux/sched.h):
42 */
43#define	PT_PTRACED	0x00000001
44
45#define CLONE_VM        0x00000100
46
47/*
48 * This defines the normal kernel pt-regs layout.
49 *
50 * regs 9-15 preserved by C code
51 * regs 16-18 saved by PAL-code
52 * regs 29-30 saved and set up by PAL-code
53 * JRP - Save regs 16-18 in a special area of the stack, so that
54 * the palcode-provided values are available to the signal handler.
55 */
56
57#define SAVE_ALL			\
58	subq	$30,184,$30;		\
59	stq	$0,0($30);		\
60	stq	$1,8($30);		\
61	stq	$2,16($30);		\
62	stq	$3,24($30);		\
63	stq	$4,32($30);		\
64	stq	$28,144($30);		\
65	lda	$2,alpha_mv;		\
66	stq	$5,40($30);		\
67	stq	$6,48($30);		\
68	stq	$7,56($30);		\
69	stq	$8,64($30);		\
70	stq	$19,72($30);		\
71	stq	$20,80($30);		\
72	stq	$21,88($30);		\
73	ldq	$2,HAE_CACHE($2);	\
74	stq	$22,96($30);		\
75	stq	$23,104($30);		\
76	stq	$24,112($30);		\
77	stq	$25,120($30);		\
78	stq	$26,128($30);		\
79	stq	$27,136($30);		\
80	stq	$2,152($30);		\
81	stq	$16,160($30);		\
82	stq	$17,168($30);		\
83	stq	$18,176($30)
84
85#define RESTORE_ALL			\
86	lda	$19,alpha_mv;		\
87	ldq	$0,0($30);		\
88	ldq	$1,8($30);		\
89	ldq	$2,16($30);		\
90	ldq	$3,24($30);		\
91	ldq	$21,152($30);		\
92	ldq	$20,HAE_CACHE($19);	\
93	ldq	$4,32($30);		\
94	ldq	$5,40($30);		\
95	ldq	$6,48($30);		\
96	ldq	$7,56($30);		\
97	subq	$20,$21,$20;		\
98	ldq	$8,64($30);		\
99	beq	$20,99f;		\
100	ldq	$20,HAE_REG($19);	\
101	addq	$31,7,$16;		\
102	call_pal PAL_swpipl;		\
103	stq	$21,HAE_CACHE($19);	\
104	stq	$21,0($20);		\
105	mov	$0,$16;			\
106	call_pal PAL_swpipl;		\
107	ldq	$0,0($30);		\
108	ldq	$1,8($30);		\
10999:;					\
110	ldq	$19,72($30);		\
111	ldq	$20,80($30);		\
112	ldq	$21,88($30);		\
113	ldq	$22,96($30);		\
114	ldq	$23,104($30);		\
115	ldq	$24,112($30);		\
116	ldq	$25,120($30);		\
117	ldq	$26,128($30);		\
118	ldq	$27,136($30);		\
119	ldq	$28,144($30);		\
120	addq	$30,184,$30
121
122.text
123.set noat
124#if defined(__linux__) && !defined(__ELF__)
125  .set singlegp
126#endif
127
128.align 3
129.globl	entInt
130.ent	entInt
131entInt:
132	SAVE_ALL
133	lda	$8,0x3fff
134	lda	$26,ret_from_sys_call
135	bic	$30,$8,$8
136	jsr	$31,do_entInt
137.end entInt
138
139.align 3
140.globl	entMM
141.ent	entMM
142entMM:
143	SAVE_ALL
144/* save $9 - $15 so the inline exception code can manipulate them.  */
145	subq	$30,56,$30
146	stq	$9,0($30)
147	stq	$10,8($30)
148	stq	$11,16($30)
149	stq	$12,24($30)
150	stq	$13,32($30)
151	stq	$14,40($30)
152	stq	$15,48($30)
153	addq	$30,56,$19
154/* handle the fault */
155	lda	$8,0x3fff
156	bic	$30,$8,$8
157	jsr	$26,do_page_fault
158/* reload the registers after the exception code played.  */
159	ldq	$9,0($30)
160	ldq	$10,8($30)
161	ldq	$11,16($30)
162	ldq	$12,24($30)
163	ldq	$13,32($30)
164	ldq	$14,40($30)
165	ldq	$15,48($30)
166	addq	$30,56,$30
167/* finish up the syscall as normal.  */
168	br	ret_from_sys_call
169.end entMM
170
171.align 3
172.globl	entArith
173.ent	entArith
174entArith:
175	SAVE_ALL
176	lda	$8,0x3fff
177	lda	$26,ret_from_sys_call
178	bic	$30,$8,$8
179	jsr	$31,do_entArith
180.end entArith
181
182.align 3
183.globl	entIF
184.ent	entIF
185entIF:
186	SAVE_ALL
187	lda	$8,0x3fff
188	lda	$26,ret_from_sys_call
189	bic	$30,$8,$8
190	jsr	$31,do_entIF
191.end entIF
192
193.align 3
194.globl	entDbg
195.ent	entDbg
196entDbg:
197	SAVE_ALL
198	lda	$8,0x3fff
199	lda	$26,ret_from_sys_call
200	bic	$30,$8,$8
201	jsr	$31,do_entDbg
202.end entDbg
203
204
205/*
206 * Fork() is one of the special system calls: it needs to
207 * save the callee-saved regs so that the regs can be found
208 * for the new process.. We save them in the "context switch"
209 * stack format (see arch/alpha/kernel/process.c).
210 *
211 * Also, for the kernel fork, we need to fake the system call
212 * stack buildup, as we can't do system calls from kernel space.
213 */
214.align 3
215.ent	kernel_clone
216kernel_clone:
217	.frame $30, 0, $26
218	.prologue 0
219	subq	$30,6*8,$30
220	stq	$31,0($30)
221	stq	$26,8($30)
222	stq	$29,16($30)
223	stq	$16,24($30)
224	stq	$17,32($30)
225	stq	$18,40($30)
226	bis	$31,2,$0	/* Register v0: syscall nr for fork() */
227	SAVE_ALL
228	bsr	$26,sys_clone
229	stq	$0,0($30)
230	br	ret_from_sys_call
231.end	kernel_clone
232
233/*
234 * arch_kernel_thread(fn, arg, clone_flags)
235 */
236.align 3
237.globl	arch_kernel_thread
238.ent	arch_kernel_thread
239arch_kernel_thread:
240	ldgp	$29,0($27)	/* we can be called from a module */
241	.frame $30, 4*8, $26
242	subq	$30,4*8,$30
243	stq	$10,16($30)
244	stq	$9,8($30)
245	lda	$0,CLONE_VM
246	stq	$26,0($30)
247	.prologue 1
248	mov	$16,$9		/* save fn */
249	mov	$17,$10		/* save arg */
250	or	$18,$0,$16	/* shuffle flags to front; add CLONE_VM.  */
251	bsr	$26,kernel_clone
252	bne	$20,1f		/* $20 is non-zero in child */
253	ldq	$26,0($30)
254	ldq	$9,8($30)
255	ldq	$10,16($30)
256	addq	$30,4*8,$30
257	ret	$31,($26),1
258/* this is in child: look out as we don't have any stack here.. */
2591:	mov	$9,$27		/* get fn */
260	lda	$8,0x3fff
261	mov	$10,$16		/* get arg */
262	bic	$30,$8,$8	/* get current */
263	jsr	$26,($27)
264	ldgp	$29,0($26)
265	mov	$0,$16
266	mov	$31,$26
267	jsr	$31,sys_exit
268.end	arch_kernel_thread
269
270/*
271 * __kernel_execve(path, argv, envp, regs)
272 */
273.align 3
274.globl	__kernel_execve
275.ent	__kernel_execve
276__kernel_execve:
277	ldgp	$29,0($27)	/* we can be called from modules.  */
278	subq	$30,16,$30
279	.frame	$30,16,$26,0
280	stq	$26,0($30)
281	stq	$19,8($30)
282	.prologue 1
283	jsr	$26,do_execve
284	bne	$0,1f		/* error! */
285	ldq	$30,8($30)
286	br	$31,ret_from_sys_call
2871:	ldq	$26,0($30)
288	addq	$30,16,$30
289	ret
290.end	__kernel_execve
291
292.align 3
293.ent	do_switch_stack
294do_switch_stack:
295	lda	$30,-SWITCH_STACK_SIZE($30)
296	stq	$9,0($30)
297	stq	$10,8($30)
298	stq	$11,16($30)
299	stq	$12,24($30)
300	stq	$13,32($30)
301	stq	$14,40($30)
302	stq	$15,48($30)
303	stq	$26,56($30)
304	stt	$f0,64($30)
305	stt	$f1,72($30)
306	stt	$f2,80($30)
307	stt	$f3,88($30)
308	stt	$f4,96($30)
309	stt	$f5,104($30)
310	stt	$f6,112($30)
311	stt	$f7,120($30)
312	stt	$f8,128($30)
313	stt	$f9,136($30)
314	stt	$f10,144($30)
315	stt	$f11,152($30)
316	stt	$f12,160($30)
317	stt	$f13,168($30)
318	stt	$f14,176($30)
319	stt	$f15,184($30)
320	stt	$f16,192($30)
321	stt	$f17,200($30)
322	stt	$f18,208($30)
323	stt	$f19,216($30)
324	stt	$f20,224($30)
325	stt	$f21,232($30)
326	stt	$f22,240($30)
327	stt	$f23,248($30)
328	stt	$f24,256($30)
329	stt	$f25,264($30)
330	stt	$f26,272($30)
331	stt	$f27,280($30)
332	mf_fpcr	$f0		# get fpcr
333	stt	$f28,288($30)
334	stt	$f29,296($30)
335	stt	$f30,304($30)
336	stt	$f0,312($30)	# save fpcr in slot of $f31
337	ldt	$f0,64($30)	# dont let "do_switch_stack" change fp state.
338	ret	$31,($1),1
339.end do_switch_stack
340
341.align 3
342.ent	undo_switch_stack
343undo_switch_stack:
344	ldq	$9,0($30)
345	ldq	$10,8($30)
346	ldq	$11,16($30)
347	ldq	$12,24($30)
348	ldq	$13,32($30)
349	ldq	$14,40($30)
350	ldq	$15,48($30)
351	ldq	$26,56($30)
352	ldt	$f30,312($30)	# get saved fpcr
353	ldt	$f0,64($30)
354	ldt	$f1,72($30)
355	ldt	$f2,80($30)
356	ldt	$f3,88($30)
357	mt_fpcr	$f30		# install saved fpcr
358	ldt	$f4,96($30)
359	ldt	$f5,104($30)
360	ldt	$f6,112($30)
361	ldt	$f7,120($30)
362	ldt	$f8,128($30)
363	ldt	$f9,136($30)
364	ldt	$f10,144($30)
365	ldt	$f11,152($30)
366	ldt	$f12,160($30)
367	ldt	$f13,168($30)
368	ldt	$f14,176($30)
369	ldt	$f15,184($30)
370	ldt	$f16,192($30)
371	ldt	$f17,200($30)
372	ldt	$f18,208($30)
373	ldt	$f19,216($30)
374	ldt	$f20,224($30)
375	ldt	$f21,232($30)
376	ldt	$f22,240($30)
377	ldt	$f23,248($30)
378	ldt	$f24,256($30)
379	ldt	$f25,264($30)
380	ldt	$f26,272($30)
381	ldt	$f27,280($30)
382	ldt	$f28,288($30)
383	ldt	$f29,296($30)
384	ldt	$f30,304($30)
385	lda	$30,SWITCH_STACK_SIZE($30)
386	ret	$31,($1),1
387.end undo_switch_stack
388
389.align 3
390.globl	entUna
391.ent	entUna
392entUna:
393	lda	$30,-256($30)
394	stq	$0,0($30)
395	ldq	$0,256($30)	/* get PS */
396	stq	$1,8($30)
397	stq	$2,16($30)
398	stq	$3,24($30)
399	and	$0,8,$0		/* user mode? */
400	stq	$4,32($30)
401	bne	$0,entUnaUser	/* yup -> do user-level unaligned fault */
402	stq	$5,40($30)
403	stq	$6,48($30)
404	stq	$7,56($30)
405	stq	$8,64($30)
406	stq	$9,72($30)
407	stq	$10,80($30)
408	stq	$11,88($30)
409	stq	$12,96($30)
410	stq	$13,104($30)
411	stq	$14,112($30)
412	stq	$15,120($30)
413	/* 16-18 PAL-saved */
414	stq	$19,152($30)
415	stq	$20,160($30)
416	stq	$21,168($30)
417	stq	$22,176($30)
418	stq	$23,184($30)
419	stq	$24,192($30)
420	stq	$25,200($30)
421	stq	$26,208($30)
422	stq	$27,216($30)
423	stq	$28,224($30)
424	stq	$29,232($30)
425	lda	$8,0x3fff
426	stq	$31,248($30)
427	bic	$30,$8,$8
428	jsr	$26,do_entUna
429	ldq	$0,0($30)
430	ldq	$1,8($30)
431	ldq	$2,16($30)
432	ldq	$3,24($30)
433	ldq	$4,32($30)
434	ldq	$5,40($30)
435	ldq	$6,48($30)
436	ldq	$7,56($30)
437	ldq	$8,64($30)
438	ldq	$9,72($30)
439	ldq	$10,80($30)
440	ldq	$11,88($30)
441	ldq	$12,96($30)
442	ldq	$13,104($30)
443	ldq	$14,112($30)
444	ldq	$15,120($30)
445	/* 16-18 PAL-saved */
446	ldq	$19,152($30)
447	ldq	$20,160($30)
448	ldq	$21,168($30)
449	ldq	$22,176($30)
450	ldq	$23,184($30)
451	ldq	$24,192($30)
452	ldq	$25,200($30)
453	ldq	$26,208($30)
454	ldq	$27,216($30)
455	ldq	$28,224($30)
456	ldq	$29,232($30)
457	lda	$30,256($30)
458	call_pal PAL_rti
459.end entUna
460
461.align 3
462.ent	entUnaUser
463entUnaUser:
464	ldq	$0,0($30)	/* restore original $0 */
465	lda	$30,256($30)	/* pop entUna's stack frame */
466	SAVE_ALL		/* setup normal kernel stack */
467	lda	$30,-56($30)
468	stq	$9,0($30)
469	stq	$10,8($30)
470	stq	$11,16($30)
471	stq	$12,24($30)
472	stq	$13,32($30)
473	stq	$14,40($30)
474	stq	$15,48($30)
475	lda	$8,0x3fff
476	addq	$30,56,$19
477	bic	$30,$8,$8
478	jsr	$26,do_entUnaUser
479	ldq	$9,0($30)
480	ldq	$10,8($30)
481	ldq	$11,16($30)
482	ldq	$12,24($30)
483	ldq	$13,32($30)
484	ldq	$14,40($30)
485	ldq	$15,48($30)
486	lda	$30,56($30)
487	br	ret_from_sys_call
488.end	entUnaUser
489
490/*
491 * A fork is the same as clone(SIGCHLD, 0);
492 */
493.align 3
494.globl	sys_fork
495.ent	sys_fork
496sys_fork:
497	bsr	$1,do_switch_stack
498	bis	$31,SIGCHLD,$16
499	mov	$31,$17
500	mov	$30,$18
501	jsr	$26,alpha_clone
502	bsr	$1,undo_switch_stack
503	ret	$31,($26),1
504.end	sys_fork
505
506.align 3
507.globl	sys_clone
508.ent	sys_clone
509sys_clone:
510	bsr	$1,do_switch_stack
511	/* arg1 and arg2 come from the user */
512	mov	$30,$18
513	jsr	$26,alpha_clone
514	bsr	$1,undo_switch_stack
515	ret	$31,($26),1
516.end	sys_clone
517
518.align 3
519.globl	sys_vfork
520.ent	sys_vfork
521sys_vfork:
522	bsr	$1,do_switch_stack
523	mov	$30,$16
524	jsr	$26,alpha_vfork
525	bsr	$1,undo_switch_stack
526	ret	$31,($26),1
527.end	sys_vfork
528
529.align 3
530.globl  alpha_switch_to
531.ent    alpha_switch_to
532alpha_switch_to:
533	.prologue 0
534	bsr	$1,do_switch_stack
535	call_pal PAL_swpctx
536	unop
537	bsr	$1,undo_switch_stack
538	mov	$17,$0
539	ret	$31,($26),1
540.end alpha_switch_to
541
542/*
543 * Oh, well.. Disassembling OSF/1 binaries to find out how the
544 * system calls work isn't much fun.
545 *
546 * entSys is special in that the PAL-code doesn't save a0-a2, so
547 * we start off by doing that by hand.
548 */
549.align 3
550.globl	entSys
551.globl	ret_from_sys_call
552.ent	entSys
553entSys:
554	SAVE_ALL
555	lda	$8,0x3fff
556	bic	$30,$8,$8
557	lda	$4,NR_SYSCALLS($31)
558	stq	$16,SP_OFF+24($30)
559	lda	$5,sys_call_table
560	lda	$27,sys_ni_syscall
561	cmpult	$0,$4,$4
562	ldq	$3,TASK_PTRACE($8)
563	stq	$17,SP_OFF+32($30)
564	s8addq	$0,$5,$5
565	and     $3,PT_PTRACED,$3
566	stq	$18,SP_OFF+40($30)
567	bne     $3,strace
568	beq	$4,1f
569	ldq	$27,0($5)
5701:	jsr	$26,($27),alpha_ni_syscall
571	ldgp	$29,0($26)
572	blt	$0,syscall_error	/* the call failed */
573	stq	$0,0($30)
574	stq	$31,72($30)		/* a3=0 => no error */
575
576.align 3
577ret_from_sys_call:
578	cmovne	$26,0,$19		/* $19 = 0 => non-restartable */
579	ldq	$0,SP_OFF($30)
580	and	$0,8,$0
581	beq	$0,restore_all
582ret_from_reschedule:
583	ldq	$2,TASK_NEED_RESCHED($8)
584	lda	$4,init_task_union
585	bne	$2,reschedule
586	xor	$4,$8,$4
587	ldl	$5,TASK_SIGPENDING($8)
588	beq	$4,restore_all
589	bne	$5,signal_return
590restore_all:
591	RESTORE_ALL
592	call_pal PAL_rti
593
594
595/* PTRACE syscall handler */
596.align 3
597strace:
598	/* set up signal stack, call syscall_trace */
599	bsr	$1,do_switch_stack
600	jsr     $26,syscall_trace
601	bsr	$1,undo_switch_stack
602
603	/* get the system call number and the arguments back.. */
604	ldq     $0,0($30)
605	ldq     $16,SP_OFF+24($30)
606	ldq     $17,SP_OFF+32($30)
607	ldq     $18,SP_OFF+40($30)
608	ldq     $19,72($30)
609	ldq     $20,80($30)
610	ldq     $21,88($30)
611
612	/* get the system call pointer.. */
613	lda	$1,NR_SYSCALLS($31)
614	lda	$2,sys_call_table
615	lda	$27,alpha_ni_syscall
616	cmpult	$0,$1,$1
617	s8addq	$0,$2,$2
618	beq	$1,1f
619	ldq	$27,0($2)
6201:	jsr	$26,($27),sys_gettimeofday
621	ldgp	$29,0($26)
622
623	/* check return.. */
624	blt	$0,strace_error	/* the call failed */
625	stq	$31,72($30)		/* a3=0 => no error */
626strace_success:
627	stq	$0,0($30)		/* save return value */
628
629	bsr	$1,do_switch_stack
630	jsr     $26,syscall_trace
631	bsr	$1,undo_switch_stack
632	br	$31,ret_from_sys_call
633
634	.align  3
635strace_error:
636	ldq	$19,0($30)	/* old syscall nr (zero if success) */
637	beq	$19,strace_success
638	ldq	$20,72($30)	/* .. and this a3 */
639
640	subq	$31,$0,$0	/* with error in v0 */
641	addq	$31,1,$1	/* set a3 for errno return */
642	stq	$0,0($30)
643	stq	$1,72($30)	/* a3 for return */
644
645	bsr	$1,do_switch_stack
646	mov	$19,$9		/* save old syscall number */
647	mov	$20,$10		/* save old a3 */
648	jsr     $26,syscall_trace
649	mov	$9,$19
650	mov	$10,$20
651	bsr	$1,undo_switch_stack
652
653	mov	$31,$26		/* tell "ret_from_sys_call" we can restart */
654	br	ret_from_sys_call
655
656	.align 3
657syscall_error:
658	/*
659	 * Some system calls (e.g., ptrace) can return arbitrary
660	 * values which might normally be mistaken as error numbers.
661	 * Those functions must zero $0 (v0) directly in the stack
662	 * frame to indicate that a negative return value wasn't an
663	 * error number..
664	 */
665	ldq	$19,0($30)	/* old syscall nr (zero if success) */
666	beq	$19,ret_success
667
668	ldq	$20,72($30)	/* .. and this a3 */
669	subq	$31,$0,$0	/* with error in v0 */
670	addq	$31,1,$1	/* set a3 for errno return */
671	stq	$0,0($30)
672	mov	$31,$26		/* tell "ret_from_sys_call" we can restart */
673	stq	$1,72($30)	/* a3 for return */
674	br	ret_from_sys_call
675
676ret_success:
677	stq	$0,0($30)
678	stq	$31,72($30)	/* a3=0 => no error */
679	br	ret_from_sys_call
680
681.align 3
682signal_return:
683	mov	$30,$17
684	br	$1,do_switch_stack
685	mov	$30,$18
686	mov	$31,$16
687	jsr	$26,do_signal
688	bsr	$1,undo_switch_stack
689	br	restore_all
690.end entSys
691
692        .globl  ret_from_fork
693.align 3
694.ent ret_from_fork
695ret_from_fork:
696	lda	$26,ret_from_sys_call
697	mov	$17,$16
698	jsr	$31,schedule_tail
699.end ret_from_fork
700
701.align 3
702.ent reschedule
703reschedule:
704	subq	$30,16,$30
705	stq	$19,0($30)	/* save syscall nr */
706	stq	$20,8($30)	/* and error indication (a3) */
707	jsr	$26,schedule
708	ldq	$19,0($30)
709	ldq	$20,8($30)
710	addq	$30,16,$30
711	br	ret_from_reschedule
712.end reschedule
713
714.align 3
715.ent sys_sigreturn
716sys_sigreturn:
717	mov	$30,$17
718	lda	$18,-SWITCH_STACK_SIZE($30)
719	lda	$30,-SWITCH_STACK_SIZE($30)
720	jsr	$26,do_sigreturn
721	br	$1,undo_switch_stack
722	br	ret_from_sys_call
723.end sys_sigreturn
724
725.align 3
726.ent sys_rt_sigreturn
727sys_rt_sigreturn:
728	mov	$30,$17
729	lda	$18,-SWITCH_STACK_SIZE($30)
730	lda	$30,-SWITCH_STACK_SIZE($30)
731	jsr	$26,do_rt_sigreturn
732	br	$1,undo_switch_stack
733	br	ret_from_sys_call
734.end sys_rt_sigreturn
735
736.align 3
737.ent sys_sigsuspend
738sys_sigsuspend:
739	mov	$30,$17
740	br	$1,do_switch_stack
741	mov	$30,$18
742	subq	$30,16,$30
743	stq	$26,0($30)
744	jsr	$26,do_sigsuspend
745	ldq	$26,0($30)
746	lda	$30,SWITCH_STACK_SIZE+16($30)
747	ret	$31,($26),1
748.end sys_sigsuspend
749
750.align 3
751.ent sys_rt_sigsuspend
752sys_rt_sigsuspend:
753	mov	$30,$18
754	br	$1,do_switch_stack
755	mov	$30,$19
756	subq	$30,16,$30
757	stq	$26,0($30)
758	jsr	$26,do_rt_sigsuspend
759	ldq	$26,0($30)
760	lda	$30,SWITCH_STACK_SIZE+16($30)
761	ret	$31,($26),1
762.end sys_rt_sigsuspend
763
764	.data
765	.align 3
766	.globl sys_call_table
767sys_call_table:
768	.quad alpha_ni_syscall			/* 0 */
769	.quad sys_exit
770	.quad sys_fork
771	.quad sys_read
772	.quad sys_write
773	.quad alpha_ni_syscall			/* 5 */
774	.quad sys_close
775	.quad osf_wait4
776	.quad alpha_ni_syscall
777	.quad sys_link
778	.quad sys_unlink			/* 10 */
779	.quad alpha_ni_syscall
780	.quad sys_chdir
781	.quad sys_fchdir
782	.quad sys_mknod
783	.quad sys_chmod				/* 15 */
784	.quad sys_chown
785	.quad osf_brk
786	.quad alpha_ni_syscall
787	.quad sys_lseek
788	.quad sys_getxpid			/* 20 */
789	.quad osf_mount
790	.quad sys_umount
791	.quad sys_setuid
792	.quad sys_getxuid
793	.quad alpha_ni_syscall			/* 25 */
794	.quad sys_ptrace
795	.quad alpha_ni_syscall
796	.quad alpha_ni_syscall
797	.quad alpha_ni_syscall
798	.quad alpha_ni_syscall			/* 30 */
799	.quad alpha_ni_syscall
800	.quad alpha_ni_syscall
801	.quad sys_access
802	.quad alpha_ni_syscall
803	.quad alpha_ni_syscall			/* 35 */
804	.quad sys_sync
805	.quad sys_kill
806	.quad alpha_ni_syscall
807	.quad sys_setpgid
808	.quad alpha_ni_syscall			/* 40 */
809	.quad sys_dup
810	.quad sys_pipe
811	.quad osf_set_program_attributes
812	.quad alpha_ni_syscall
813	.quad sys_open				/* 45 */
814	.quad alpha_ni_syscall
815	.quad sys_getxgid
816	.quad osf_sigprocmask
817	.quad alpha_ni_syscall
818	.quad alpha_ni_syscall			/* 50 */
819	.quad sys_acct
820	.quad sys_sigpending
821	.quad alpha_ni_syscall
822	.quad sys_ioctl
823	.quad alpha_ni_syscall			/* 55 */
824	.quad alpha_ni_syscall
825	.quad sys_symlink
826	.quad sys_readlink
827	.quad sys_execve
828	.quad sys_umask				/* 60 */
829	.quad sys_chroot
830	.quad alpha_ni_syscall
831	.quad sys_getpgrp
832	.quad sys_getpagesize
833	.quad alpha_ni_syscall			/* 65 */
834	.quad sys_vfork
835	.quad sys_newstat
836	.quad sys_newlstat
837	.quad alpha_ni_syscall
838	.quad alpha_ni_syscall			/* 70 */
839	.quad osf_mmap
840	.quad alpha_ni_syscall
841	.quad sys_munmap
842	.quad sys_mprotect
843	.quad sys_madvise			/* 75 */
844	.quad sys_vhangup
845	.quad alpha_ni_syscall
846	.quad alpha_ni_syscall
847	.quad sys_getgroups
848	/* map BSD's setpgrp to sys_setpgid for binary compatibility: */
849	.quad sys_setgroups			/* 80 */
850	.quad alpha_ni_syscall
851	.quad sys_setpgid
852	.quad osf_setitimer
853	.quad alpha_ni_syscall
854	.quad alpha_ni_syscall			/* 85 */
855	.quad osf_getitimer
856	.quad sys_gethostname
857	.quad sys_sethostname
858	.quad sys_getdtablesize
859	.quad sys_dup2				/* 90 */
860	.quad sys_newfstat
861	.quad sys_fcntl
862	.quad osf_select
863	.quad sys_poll
864	.quad sys_fsync				/* 95 */
865	.quad sys_setpriority
866	.quad sys_socket
867	.quad sys_connect
868	.quad sys_accept
869	.quad osf_getpriority			/* 100 */
870	.quad sys_send
871	.quad sys_recv
872	.quad sys_sigreturn
873	.quad sys_bind
874	.quad sys_setsockopt			/* 105 */
875	.quad sys_listen
876	.quad alpha_ni_syscall
877	.quad alpha_ni_syscall
878	.quad alpha_ni_syscall
879	.quad alpha_ni_syscall			/* 110 */
880	.quad sys_sigsuspend
881	.quad osf_sigstack
882	.quad sys_recvmsg
883	.quad sys_sendmsg
884	.quad alpha_ni_syscall			/* 115 */
885	.quad osf_gettimeofday
886	.quad osf_getrusage
887	.quad sys_getsockopt
888	.quad alpha_ni_syscall
889#ifdef CONFIG_OSF4_COMPAT
890	.quad osf_readv				/* 120 */
891	.quad osf_writev
892#else
893	.quad sys_readv				/* 120 */
894	.quad sys_writev
895#endif
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_ni_syscall			/* 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_setresgid
1147	.quad sys_getresgid
1148	.quad sys_ni_syscall			/* sys_dipc */
1149	.quad sys_pivot_root
1150	.quad sys_mincore			/* 375 */
1151	.quad sys_pciconfig_iobase
1152	.quad sys_getdents64
1153	.quad sys_gettid
1154	.quad sys_readahead
1155	.quad sys_ni_syscall			/* 380, sys_security */
1156	.quad sys_tkill
1157
1158/* Remember to update everything, kids.  */
1159.ifne (. - sys_call_table) - (NR_SYSCALLS * 8)
1160.err
1161.endif
1162