1/* 2 * Copyright (c) 1983 Regents of the University of California. 3 * All rights reserved. The Berkeley software License Agreement 4 * specifies the terms and conditions for redistribution. 5 */ 6 7#ifdef SYSLIBC_SCCS 8_sccsid:.asciz "@(#)syscall.s 5.1 (Berkeley) 07/02/86" 9#endif SYSLIBC_SCCS 10 11#include "SYS.h" 12 13ENTRY(syscall) 14 pushl 4(fp) # syscall number 15 movl fp,r0 # point to the arg list 16 movl -4(fp),r1 # (arg_count + 1) (bytes) | mask 17 andl2 $0xFFFF,r1 # clear the mask bits 18 shrl $2,r1,r1 # convert to words 19 subl2 $2,r1 # don't count the first arg 201: 21 addl2 $4,r0 # point to the next arg 22 movl 4(r0),(r0) # move an arg down 23 decl r1 # count it 24 jgtr 1b # any more? 25 movl (sp)+,r0 # no, get the syscall number back 26 kcall r0 27 jcs 1f 28 ret 291: 30 jmp cerror 31