/*
 * |-----------------------------------------------------------|
 * | Copyright (c) 1991, 1990 MIPS Computer Systems, Inc.      |
 * | All Rights Reserved                                       |
 * |-----------------------------------------------------------|
 * |          Restricted Rights Legend                         |
 * | Use, duplication, or disclosure by the Government is      |
 * | subject to restrictions as set forth in                   |
 * | subparagraph (c)(1)(ii) of the Rights in Technical        |
 * | Data and Computer Software Clause of DFARS 252.227-7013.  |
 * |         MIPS Computer Systems, Inc.                       |
 * |         950 DeGuigne Avenue                               |
 * |         Sunnyvale, California 94088-3650, USA             |
 * |-----------------------------------------------------------|
 */
/* $Header: sys.s,v 1.29.2.1 92/06/24 13:57:20 marker Exp $ */
/*
 * Copyright 1985 by MIPS Computer Systems, Inc.
 *
 * $Header: sys.s,v 1.29.2.1 92/06/24 13:57:20 marker Exp $
 */

/* System call numbers */
/* These must match with the table entries appearing in os/sysent.c */
#define SYSVoffset	1000	/* to offset us from 4.2 calls, when desired */

#define SYS_syscall	(0+SYSVoffset)
#define SYS_exit	(1+SYSVoffset)
#define SYS_fork	(2+SYSVoffset)
#define SYS_read	(3+SYSVoffset)
#define SYS_write	(4+SYSVoffset)
#define SYS_open	(5+SYSVoffset)
#define SYS_close	(6+SYSVoffset)
#define SYS_wait	(7+SYSVoffset)
#define SYS_creat	(8+SYSVoffset)
#define SYS_link	(9+SYSVoffset)
#define SYS_unlink	(10+SYSVoffset)
#define SYS_execv	(11+SYSVoffset)
#define SYS_chdir	(12+SYSVoffset)
#define SYS_time	(13+SYSVoffset)
#define SYS_mknod	(14+SYSVoffset)
#define SYS_chmod	(15+SYSVoffset)
#define SYS_chown	(16+SYSVoffset)
#define SYS_brk		(17+SYSVoffset)
#define SYS_stat	(18+SYSVoffset)
#define SYS_lseek	(19+SYSVoffset)
#define SYS_getpid	(20+SYSVoffset)
#define SYS_mount	(21+SYSVoffset)
#define SYS_umount	(22+SYSVoffset)
#define SYS_setuid	(23+SYSVoffset)
#define SYS_getuid	(24+SYSVoffset)
#define SYS_stime	(25+SYSVoffset)
#define SYS_ptrace	(26+SYSVoffset)
#define SYS_alarm	(27+SYSVoffset)
#define SYS_fstat	(28+SYSVoffset)
#define SYS_pause	(29+SYSVoffset)
#define SYS_utime	(30+SYSVoffset)
#define SYS_stty	(31+SYSVoffset)
#define SYS_gtty	(32+SYSVoffset)
#define SYS_access	(33+SYSVoffset)
#define SYS_nice	(34+SYSVoffset)
#define SYS_statfs	(35+SYSVoffset)
#define SYS_sync	(36+SYSVoffset)
#define SYS_kill	(37+SYSVoffset)
#define SYS_fstatfs	(38+SYSVoffset)
#define SYS_setpgrp	(39+SYSVoffset)
#define SYS_dup		(41+SYSVoffset)
#define SYS_pipe	(42+SYSVoffset)
#define SYS_times	(43+SYSVoffset)
#define SYS_profil	(44+SYSVoffset)
#define SYS_plock	(45+SYSVoffset)
#define SYS_setgid	(46+SYSVoffset)
#define SYS_getgid	(47+SYSVoffset)
#define SYS_signal	(48+SYSVoffset)
#define SYS_msgsys	(49+SYSVoffset)
#define SYS_sysmips	(50+SYSVoffset)
#define SYS_acct	(51+SYSVoffset)
#define SYS_shmsys	(52+SYSVoffset)
#define SYS_semsys	(53+SYSVoffset)
#define SYS_ioctl	(54+SYSVoffset)
#define SYS_uadmin	(55+SYSVoffset)
#define SYS_utssys	(57+SYSVoffset)
#define SYS_execve	(59+SYSVoffset)
#define SYS_umask	(60+SYSVoffset)
#define SYS_chroot	(61+SYSVoffset)
#define SYS_ofcntl	(62+SYSVoffset)
#define SYS_ulimit	(63+SYSVoffset)
#define SYS_advfs	(70+SYSVoffset)
#define SYS_unadvfs	(71+SYSVoffset)
#define SYS_rmount	(72+SYSVoffset)
#define SYS_rumount	(73+SYSVoffset)
#define SYS_rfstart	(74+SYSVoffset)
#define SYS_rdebug	(76+SYSVoffset)
#define SYS_rfstop	(77+SYSVoffset)
#define SYS_rfsys	(78+SYSVoffset)
#define SYS_rmdir	(79+SYSVoffset)
#define SYS_mkdir	(80+SYSVoffset)
#define SYS_getdents	(81+SYSVoffset)
#define SYS_sysfs	(84+SYSVoffset)
#define SYS_getmsg	(85+SYSVoffset)
#define SYS_putmsg	(86+SYSVoffset)
#define SYS_poll	(87+SYSVoffset)
/* This system call is internal for mips signal handling code */
#define SYS_sigreturn	(88+SYSVoffset)

/* 4.2 compatible socket/TCP/IP system calls */
#define SYS_accept	(89+SYSVoffset)
#define SYS_bind	(90+SYSVoffset)
#define SYS_connect	(91+SYSVoffset)
#define SYS_gethostid	(92+SYSVoffset)
#define SYS_getpeername	(93+SYSVoffset)
#define SYS_getsockname	(94+SYSVoffset)
#define SYS_getsockopt	(95+SYSVoffset)
#define SYS_listen	(96+SYSVoffset)
#define SYS_recv	(97+SYSVoffset)
#define SYS_recvfrom	(98+SYSVoffset)
#define SYS_recvmsg	(99+SYSVoffset)
#define SYS_select	(100+SYSVoffset)
#define SYS_send	(101+SYSVoffset)
#define SYS_sendmsg	(102+SYSVoffset)
#define SYS_sendto	(103+SYSVoffset)
#define SYS_sethostid	(104+SYSVoffset)
#define SYS_setsockopt	(105+SYSVoffset)
#define SYS_shutdown	(106+SYSVoffset)
#define SYS_socket	(107+SYSVoffset)
#define SYS_gethostname	(108+SYSVoffset)
#define SYS_sethostname	(109+SYSVoffset)
#define SYS_getdomainname (110+SYSVoffset)
#define SYS_setdomainname (111+SYSVoffset)

/* other 4.2 system calls */
#define SYS_truncate	(112+SYSVoffset)
#define SYS_ftruncate	(113+SYSVoffset)
#define SYS_rename	(114+SYSVoffset)
#define	SYS_symlink	(115+SYSVoffset)
#define	SYS_readlink	(116+SYSVoffset)
#define	SYS_lstat	(117+SYSVoffset)
#define	SYS_nfsmount	(118+SYSVoffset)
#define	SYS_nfssvc	(119+SYSVoffset)
#define	SYS_getfh	(120+SYSVoffset)
#define	SYS_async_daemon (121+SYSVoffset)
#define	SYS_old_exportfs (122+SYSVoffset)

#if 0
/*
 * These interfaces are left for backward compatability, but are
 * no longer used.
 */

#define	SYS_mmap	(123+SYSVoffset)
#define	SYS_munmap	(124+SYSVoffset)
#endif

#define	SYS_getitimer	(125+SYSVoffset)
#define	SYS_setitimer	(126+SYSVoffset)

/* more system calls */
#define	SYS_cacheflush	(150+SYSVoffset)
#define	SYS_cachectl	(151+SYSVoffset)
#define SYS_fchown	(152+SYSVoffset)
#define SYS_fchmod	(153+SYSVoffset)
#define SYS_wait3	(154+SYSVoffset)
#define SYS_mmap	(155+SYSVoffset)
#define SYS_munmap	(156+SYSVoffset)
#define SYS_madvise	(157+SYSVoffset)
#define SYS_getpagesize	(158+SYSVoffset)
#define SYS_setreuid	(159+SYSVoffset)
#define SYS_setregid	(160+SYSVoffset)
#define SYS_setpgid	(161+SYSVoffset)
#define SYS_getgroups	(162+SYSVoffset)
#define SYS_setgroups	(163+SYSVoffset)
#define SYS_gettimeofday (164+SYSVoffset)
#define SYS_getrusage	(165+SYSVoffset)
#define SYS_getrlimit	(166+SYSVoffset)
#define SYS_setrlimit	(167+SYSVoffset)
#define SYS_exportfs	(168+SYSVoffset)
#define SYS_fcntl	(169+SYSVoffset)


/* These calls have library stubs but no kernel handler */
/* Either AT+T will have to provide a handler later or we will have to
   nuke them */
#define SYS_netboot	(260+SYSVoffset)
#define SYS_netunboot	(261+SYSVoffset)
#define SYS_rdump	(262+SYSVoffset)
#define SYS_libattach	(263+SYSVoffset)
#define SYS_libdetach	(264+SYSVoffset)
#define SYS_security    (265+SYSVoffset)
#define SYS_aread	(266+SYSVoffset)
#define SYS_awrite	(267+SYSVoffset)
#define SYS_listio	(268+SYSVoffset)
#define SYS_acancel	(269+SYSVoffset)
#define SYS_astatus	(270+SYSVoffset)
#define SYS_await	(271+SYSVoffset)
#define SYS_areadv	(272+SYSVoffset)
#define SYS_awritev	(273+SYSVoffset)
