1/* 2 * Copyright (c) 1983 Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that this notice is preserved and that due credit is given 7 * to the University of California at Berkeley. The name of the University 8 * may not be used to endorse or promote products derived from this 9 * software without specific written prior permission. This software 10 * is provided ``as is'' without express or implied warranty. 11 */ 12 13#if defined(SYSLIBC_SCCS) && !defined(lint) 14_sccsid:.asciz "@(#)syscall.s 5.2 (Berkeley) 05/20/88" 15#endif /* SYSLIBC_SCCS and not lint */ 16 17#include "SYS.h" 18 19ENTRY(syscall) 20 pushl 4(fp) # syscall number 21 movl fp,r0 # point to the arg list 22 movl -4(fp),r1 # (arg_count + 1) (bytes) | mask 23 andl2 $0xFFFF,r1 # clear the mask bits 24 shrl $2,r1,r1 # convert to words 25 subl2 $2,r1 # don't count the first arg 261: 27 addl2 $4,r0 # point to the next arg 28 movl 4(r0),(r0) # move an arg down 29 decl r1 # count it 30 jgtr 1b # any more? 31 movl (sp)+,r0 # no, get the syscall number back 32 kcall r0 33 jcs 1f 34 ret 351: 36 jmp cerror 37