xref: /original-bsd/lib/libc/tahoe/sys/syscall.s (revision 4ec22e22)
1/*
2 * Copyright (c) 1983 Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 */
7
8#if defined(SYSLIBC_SCCS) && !defined(lint)
9	.asciz "@(#)syscall.s	5.4 (Berkeley) 06/01/90"
10#endif /* SYSLIBC_SCCS and not lint */
11
12#include "SYS.h"
13
14ENTRY(syscall)
15	pushl	4(fp)		# syscall number
16	movl	fp,r0		# point to the arg list
17	movl	-4(fp),r1	# (arg_count + 1) (bytes) | mask
18	andl2	$0xFFFF,r1	# clear the mask bits
19	shrl	$2,r1,r1	# convert to words
20	subl2	$2,r1		# don't count the first arg
211:
22	addl2	$4,r0		# point to the next arg
23	movl	4(r0),(r0)	# move an arg down
24	decl	r1		# count it
25	jgtr	1b		# any more?
26	movl	(sp)+,r0	# no, get the syscall number back
27	kcall	r0
28	jcs	1f
29	ret
301:
31	jmp	cerror
32