xref: /csrg-svn/lib/libc/tahoe/sys/syscall.s (revision 61190)
129499Ssam/*
2*61190Sbostic * Copyright (c) 1983, 1993
3*61190Sbostic *	The Regents of the University of California.  All rights reserved.
434389Sbostic *
542648Sbostic * %sccs.include.redist.c%
629499Ssam */
729499Ssam
834389Sbostic#if defined(SYSLIBC_SCCS) && !defined(lint)
9*61190Sbostic	.asciz "@(#)syscall.s	8.1 (Berkeley) 06/04/93"
1034389Sbostic#endif /* SYSLIBC_SCCS and not lint */
1129499Ssam
1229499Ssam#include "SYS.h"
1329499Ssam
1429499SsamENTRY(syscall)
1529499Ssam	pushl	4(fp)		# syscall number
1629499Ssam	movl	fp,r0		# point to the arg list
1729499Ssam	movl	-4(fp),r1	# (arg_count + 1) (bytes) | mask
1829499Ssam	andl2	$0xFFFF,r1	# clear the mask bits
1929499Ssam	shrl	$2,r1,r1	# convert to words
2029499Ssam	subl2	$2,r1		# don't count the first arg
2129499Ssam1:
2229499Ssam	addl2	$4,r0		# point to the next arg
2329499Ssam	movl	4(r0),(r0)	# move an arg down
2429499Ssam	decl	r1		# count it
2529499Ssam	jgtr	1b		# any more?
2629499Ssam	movl	(sp)+,r0	# no, get the syscall number back
2729499Ssam	kcall	r0
2829499Ssam	jcs	1f
2929499Ssam	ret
3029499Ssam1:
3129499Ssam	jmp	cerror
32